修改bug

master
ljl 8 months ago
parent 5354f9175a
commit 1fa0154147

@ -115,8 +115,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
} }
} }
data.setOrderResults(orderResults); data.setOrderResults(orderResults);
PurchaseOrder purchaseOrder = purchaseOrderMapper.getByPurOrderId(purOrderIds.iterator().next()); List<PurchaseOrder> currentPurchaseOrders = purchaseOrderMapper.getListByPurOrderId(purOrderIds.iterator().next());
if (purchaseOrder == null) { if (currentPurchaseOrders.isEmpty()) {
purchaseOrderMapper.insertBatch(purchaseOrders); purchaseOrderMapper.insertBatch(purchaseOrders);
purchaseOrderItemMapper.insertBatch(purchaseOrderItems); purchaseOrderItemMapper.insertBatch(purchaseOrderItems);
} }
@ -488,11 +488,17 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
throw new RuntimeException("采购单不存在"); throw new RuntimeException("采购单不存在");
} }
PurchaseOrder purchaseOrder = purchaseOrderMapper.getByPurOrderId(purOrderId); List<PurchaseOrder> purchaseOrders = purchaseOrderMapper.getListByPurOrderId(purOrderId);
List<String> sourceOrderIds = new ArrayList<>();
for (PurchaseOrder purchaseOrder: purchaseOrders) {
sourceOrderIds.add(purchaseOrder.getPurchaseOrderSn());
}
if (sourceOrderIds.isEmpty()) {
throw new RuntimeException("采购单号不存在");
}
List<PaymentResult> paymentResults = new ArrayList<>(); List<PaymentResult> paymentResults = new ArrayList<>();
for (BatchPayParam.Param p: param.getParams()) { for (BatchPayParam.Param p: param.getParams()) {
List<String> sourceOrderIds = Collections.singletonList(purchaseOrder.getPurchaseOrderSn());
GetPurchaseOrderPayUrlResponseDTO response1 = dsApiService.getPurchaseOrderPayUrl(p.getShopId(), sourceOrderIds, "PC"); GetPurchaseOrderPayUrlResponseDTO response1 = dsApiService.getPurchaseOrderPayUrl(p.getShopId(), sourceOrderIds, "PC");
GetPurchaseOrderPayUrlResponseDTO response2 = dsApiService.getPurchaseOrderPayUrl(p.getShopId(), sourceOrderIds, "WIRELESS"); GetPurchaseOrderPayUrlResponseDTO response2 = dsApiService.getPurchaseOrderPayUrl(p.getShopId(), sourceOrderIds, "WIRELESS");
if (!response1.isSuccess()) { if (!response1.isSuccess()) {

@ -32,4 +32,6 @@ public interface PurchaseOrderMapper {
PurchaseOrder getByPurchaseOrderSn(@Param("purchaseOrderSn") String purchaseOrderSn); PurchaseOrder getByPurchaseOrderSn(@Param("purchaseOrderSn") String purchaseOrderSn);
PurchaseOrder getByPurOrderId(@Param("purOrderId") String purOrderId); PurchaseOrder getByPurOrderId(@Param("purOrderId") String purOrderId);
List<PurchaseOrder> getListByPurOrderId(@Param("purOrderId") String purOrderId);
} }

@ -56,6 +56,12 @@
from purchase_order from purchase_order
where pur_order_id = #{purOrderId,jdbcType=VARCHAR} where pur_order_id = #{purOrderId,jdbcType=VARCHAR}
</select> </select>
<select id="getListByPurOrderId" resultType="com.ms.dal.entity.PurchaseOrder">
select
<include refid="Base_Column_List" />
from purchase_order
where pur_order_id = #{purOrderId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from purchase_order delete from purchase_order

Loading…
Cancel
Save