|
|
|
@ -472,24 +472,28 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
|
|
|
|
|
|
|
|
|
|
List<PaymentResult> paymentResults = new ArrayList<>();
|
|
|
|
|
for (BatchPayParam.Param p: param.getParams()) {
|
|
|
|
|
GetPurchaseOrderPayUrlResponseDTO response = dsApiService.getPurchaseOrderPayUrl(Collections.singletonList(purchaseOrder.getPurchaseOrderSn()), p.getShopId());
|
|
|
|
|
if (response.isSuccess()) {
|
|
|
|
|
PaymentResult paymentResult = new PaymentResult();
|
|
|
|
|
PaymentResult.PayUrl payUrl = new PaymentResult.PayUrl();
|
|
|
|
|
payUrl.setH5Url(response.getPayUrl());
|
|
|
|
|
payUrl.setPcUrl(response.getPayUrl());
|
|
|
|
|
|
|
|
|
|
paymentResult.setPayUrl(payUrl);
|
|
|
|
|
paymentResult.setPurOrderId(p.getPurOrderId());
|
|
|
|
|
paymentResults.add(paymentResult);
|
|
|
|
|
|
|
|
|
|
platformPurchaseOrder.setPayPcUrl(response.getPayUrl());
|
|
|
|
|
platformPurchaseOrder.setPayH5Url(response.getPayUrl());
|
|
|
|
|
platformPurchaseOrderMapper.updateByPrimaryKeySelective(platformPurchaseOrder);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
throw new RuntimeException(response.getReason());
|
|
|
|
|
List<String> sourceOrderIds = Collections.singletonList(purchaseOrder.getPurchaseOrderSn());
|
|
|
|
|
GetPurchaseOrderPayUrlResponseDTO response1 = dsApiService.getPurchaseOrderPayUrl(p.getShopId(), sourceOrderIds, "PC");
|
|
|
|
|
GetPurchaseOrderPayUrlResponseDTO response2 = dsApiService.getPurchaseOrderPayUrl(p.getShopId(), sourceOrderIds, "WIRELESS");
|
|
|
|
|
if (!response1.isSuccess()) {
|
|
|
|
|
throw new RuntimeException(response1.getReason());
|
|
|
|
|
}
|
|
|
|
|
if (!response2.isSuccess()) {
|
|
|
|
|
throw new RuntimeException(response2.getReason());
|
|
|
|
|
}
|
|
|
|
|
PaymentResult paymentResult = new PaymentResult();
|
|
|
|
|
PaymentResult.PayUrl payUrl = new PaymentResult.PayUrl();
|
|
|
|
|
|
|
|
|
|
payUrl.setPcUrl(response1.getPayUrl());
|
|
|
|
|
payUrl.setH5Url(response2.getPayUrl());
|
|
|
|
|
|
|
|
|
|
paymentResult.setPayUrl(payUrl);
|
|
|
|
|
paymentResult.setPurOrderId(p.getPurOrderId());
|
|
|
|
|
paymentResults.add(paymentResult);
|
|
|
|
|
|
|
|
|
|
platformPurchaseOrder.setPayPcUrl(response1.getPayUrl());
|
|
|
|
|
platformPurchaseOrder.setPayH5Url(response2.getPayUrl());
|
|
|
|
|
platformPurchaseOrderMapper.updateByPrimaryKeySelective(platformPurchaseOrder);
|
|
|
|
|
}
|
|
|
|
|
data.setPaymentResults(paymentResults);
|
|
|
|
|
}
|
|
|
|
|