From 7de099f79f51f6fb30eb5dd8fd14de4cd623bf2a Mon Sep 17 00:00:00 2001 From: ljl Date: Wed, 22 Nov 2023 16:15:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DsMessageServiceImpl.java | 6 ++--- .../src/main/java/com/ms/biz/util/DDApi.java | 26 +++++++------------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java index 84b5800..5a8207d 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java @@ -258,7 +258,7 @@ public class DsMessageServiceImpl implements DsMessageService { case PurchaseOrderConst.PURCHASE_ORDER_STATUS_WAIT_SEND: handlePurchaseOrderAfterPay(purchaseOrderDTO, purchaseOrder, skuIdAndPlatformPurchaseOrderSkuMap); break; - case PurchaseOrderConst.PURCHASE_ORDER_STATUS_WAIT_CONFIRM: + case PurchaseOrderConst.PURCHASE_ORDER_STATUS_HAS_SEND: handlePurchaseOrderAfterSend(purchaseOrderDTO, purchaseOrder); break; case PurchaseOrderConst.PURCHASE_ORDER_STATUS_FINISHED: @@ -297,7 +297,7 @@ public class DsMessageServiceImpl implements DsMessageService { for (PurchaseOrderItemDTO item: purchaseOrderDTO.getItems()) { PlatformPurchaseOrderSku platformPurchaseOrderSku = skuIdAndPlatformPurchaseOrderSkuMap.get(item.getSkuId()); SkuOrderPayInfosItem skuOrderPayInfosItem = new SkuOrderPayInfosItem(); - skuOrderPayInfosItem.setPayAmount((long)(item.getPurchasePrice() * 100)); + skuOrderPayInfosItem.setPayAmount((long)(item.getPurchasePrice() * 100 * item.getPurchaseNum())); skuOrderPayInfosItem.setPurSkuOrderId(platformPurchaseOrderSku.getPurSkuOrderId()); skuOrderPayInfosItems.add(skuOrderPayInfosItem); } @@ -306,7 +306,7 @@ public class DsMessageServiceImpl implements DsMessageService { } private void handlePurchaseOrderAfterSend(PurchaseOrderDTO purchaseOrderDTO, PurchaseOrder purchaseOrder) { - Date purchaseOrderSendTime = CommonTool.parseDate(purchaseOrderDTO.getPurchaseOrderSendTime()); + Date purchaseOrderSendTime = CommonTool.parseDate(purchaseOrderDTO.getPurchaseOrderUpdateTime()); purchaseOrder.setPurchaseOrderSendTime(purchaseOrderSendTime); purchaseOrder.setPurchaseOrderLogisticsName(purchaseOrder.getPurchaseOrderLogisticsName()); purchaseOrder.setPurchaseOrderWaybillCode(purchaseOrder.getPurchaseOrderWaybillCode()); diff --git a/ms-biz/src/main/java/com/ms/biz/util/DDApi.java b/ms-biz/src/main/java/com/ms/biz/util/DDApi.java index 77cd743..8fd37e0 100644 --- a/ms-biz/src/main/java/com/ms/biz/util/DDApi.java +++ b/ms-biz/src/main/java/com/ms/biz/util/DDApi.java @@ -50,20 +50,18 @@ public class DDApi { SupplyCenterOrderConfirmRequest request = new SupplyCenterOrderConfirmRequest(); request.setParam(param); SupplyCenterOrderConfirmResponse response = execute(request); - boolean success = CommonTool.checkDdApiRequestIsSuccess(response); - if (success && ObjectUtil.isNotEmpty(response.getData())) { + if (response.isSuccess()) { return response.getData(); } throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); } public static SupplyCenterOrderSyncSupplierInfoData supplyCenterOrderSyncSupplierInfo(SupplyCenterOrderSyncSupplierInfoParam param) { - log.info("DdApi:{}", "supplyCenterOrderConfirm"); + log.info("DdApi:{}", "supplyCenterOrderSyncSupplierInfo"); SupplyCenterOrderSyncSupplierInfoRequest request = new SupplyCenterOrderSyncSupplierInfoRequest(); request.setParam(param); SupplyCenterOrderSyncSupplierInfoResponse response = execute(request); - boolean success = CommonTool.checkDdApiRequestIsSuccess(response); - if (success && ObjectUtil.isNotEmpty(response.getData())) { + if (response.isSuccess()) { return response.getData(); } throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); @@ -74,8 +72,7 @@ public class DDApi { SupplyCenterOrderLogisticsRequest request = new SupplyCenterOrderLogisticsRequest(); request.setParam(param); SupplyCenterOrderLogisticsResponse response = execute(request); - boolean success = CommonTool.checkDdApiRequestIsSuccess(response); - if (success && ObjectUtil.isNotEmpty(response.getData())) { + if (response.isSuccess()) { return response.getData(); } throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); @@ -86,8 +83,7 @@ public class DDApi { SupplyCenterOrderCancelRequest request = new SupplyCenterOrderCancelRequest(); request.setParam(param); SupplyCenterOrderCancelResponse response = execute(request); - boolean success = CommonTool.checkDdApiRequestIsSuccess(response); - if (success && ObjectUtil.isNotEmpty(response.getData())) { + if (response.isSuccess()) { return response.getData(); } throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); @@ -98,8 +94,7 @@ public class DDApi { SupplyCenterOrderPayRequest request = new SupplyCenterOrderPayRequest(); request.setParam(param); SupplyCenterOrderPayResponse response = execute(request); - boolean success = CommonTool.checkDdApiRequestIsSuccess(response); - if (success && ObjectUtil.isNotEmpty(response.getData())) { + if (response.isSuccess()) { return response.getData(); } throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); @@ -110,8 +105,7 @@ public class DDApi { SupplyCenterRefundOperateRequest request = new SupplyCenterRefundOperateRequest(); request.setParam(param); SupplyCenterRefundOperateResponse response = execute(request); - boolean success = CommonTool.checkDdApiRequestIsSuccess(response); - if (success && ObjectUtil.isNotEmpty(response.getData())) { + if (response.isSuccess()) { return response.getData(); } throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); @@ -122,8 +116,7 @@ public class DDApi { SupplyCenterCargoDetailRequest request = new SupplyCenterCargoDetailRequest(); request.setParam(param); SupplyCenterCargoDetailResponse response = execute(request); - boolean success = CommonTool.checkDdApiRequestIsSuccess(response); - if (success && ObjectUtil.isNotEmpty(response.getData())) { + if (response.isSuccess()) { return response.getData(); } throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); @@ -134,8 +127,7 @@ public class DDApi { SupplyCenterOrderQueryRequest request = new SupplyCenterOrderQueryRequest(); request.setParam(param); SupplyCenterOrderQueryResponse response = execute(request); - boolean success = CommonTool.checkDdApiRequestIsSuccess(response); - if (success && ObjectUtil.isNotEmpty(response.getData())) { + if (response.isSuccess()) { return response.getData(); } throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg()));