From 28e645586ce19bd824892a36b39b17d378d768db Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 21 Nov 2023 09:57:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=AF=E4=BB=98=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ms/biz/service/DsApiService.java | 2 +- .../impl/DistributionOrderServiceImpl.java | 38 ++++++++++--------- .../ms/biz/service/impl/DsApiServiceImpl.java | 5 ++- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/ms-biz/src/main/java/com/ms/biz/service/DsApiService.java b/ms-biz/src/main/java/com/ms/biz/service/DsApiService.java index 3f8d406..01830ae 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/DsApiService.java +++ b/ms-biz/src/main/java/com/ms/biz/service/DsApiService.java @@ -20,7 +20,7 @@ public interface DsApiService { BatchAddDsPurchaseConfirmLogResponseDTO batchAddPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request); CommonResponseDTO cancelPurchaseOrderRelate(String platform, Long shopId, String orderId, List skuIds); CommonResponseDTO cancelPurchaseOrder(String platform, Long shopId, String orderId, String purchaseOrderSn); - GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(List sourceOrderId, Long shopId); + GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(Long shopId, List sourceOrderIds, String payPlatformType); GetPlatformAuthUrlResponseDTO getPlatformAuthUrl(ShopBO shopBO); GetSourceItemInfosResponseDTO getSourceItemInfos(Long shopId, List sourceItemIds); GetAuthInfoResponseDTO getAuthInfo(Long shopId); diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DistributionOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DistributionOrderServiceImpl.java index 0cd286a..57bcfea 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/DistributionOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DistributionOrderServiceImpl.java @@ -472,24 +472,28 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { List 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 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); } diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DsApiServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DsApiServiceImpl.java index 1bd7fd7..3d93d63 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/DsApiServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DsApiServiceImpl.java @@ -103,11 +103,12 @@ public class DsApiServiceImpl implements DsApiService { } @Override - public GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(List sourceOrderId, Long shopId) { + public GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(Long shopId, List sourceOrderIds, String payPlatformType) { OperateInfoDTO operateInfo = createOperateInfo(shopId); Map params = new HashMap<>(); - params.put("sourceOrderId", sourceOrderId); + params.put("sourceOrderId", sourceOrderIds); params.put("operateInfo", operateInfo); + params.put("payPlatformType", payPlatformType); String resp = execute("/order/getPurchaseOrderPayUrl", params); return JSON.parseObject(resp, GetPurchaseOrderPayUrlResponseDTO.class); }