|
|
@ -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()) {
|
|
|
|