From 2aeabad6cd2cdea6b807d74abbc012064c385040 Mon Sep 17 00:00:00 2001 From: ljl Date: Thu, 30 Nov 2023 15:38:45 +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 --- .../ms/biz/service/impl/DsMessageServiceImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 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 040404f..cecd0e3 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 @@ -417,6 +417,8 @@ public class DsMessageServiceImpl implements DsMessageService { SupplyCenterRefundOperateParam param = new SupplyCenterRefundOperateParam(); param.setPurOrderId(purchaseOrder.getPurOrderId()); + boolean isAfterSale = StringUtil.isNotEmpty(purchaseOrderDTO.getPurchaseOrderWaybillCode()) && StringUtil.isNotEmpty(purchaseOrderDTO.getPurchaseOrderLogisticsName()); + List skuRefundInfosItems = new ArrayList<>(); Set subItemIds = refundInfo.getOrderEntryCountMap().keySet(); for (String subItemId: subItemIds) { @@ -425,7 +427,7 @@ public class DsMessageServiceImpl implements DsMessageService { continue; } String purSkuOrderId = skuItemIdAndPurSkuOrderIdMap.get(subItemId); - SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(purSkuOrderId, refundInfo, alibabaMessage); + SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(purSkuOrderId, refundInfo, alibabaMessage, isAfterSale); skuRefundInfosItems.add(skuRefundInfosItem); } param.setSkuRefundInfos(skuRefundInfosItems); @@ -477,7 +479,7 @@ public class DsMessageServiceImpl implements DsMessageService { } } - private SkuRefundInfosItem buildSkuRefundInfosItem(String purSkuOrderId, RefundInfoDTO refundInfo, AlibabaMessage alibabaMessage) { + private SkuRefundInfosItem buildSkuRefundInfosItem(String purSkuOrderId, RefundInfoDTO refundInfo, AlibabaMessage alibabaMessage, boolean isAfterSale) { SkuRefundInfosItem skuRefundInfosItem = new SkuRefundInfosItem(); skuRefundInfosItem.setPurSkuOrderId(purSkuOrderId); skuRefundInfosItem.setRejectReason(refundInfo.getRejectReason()); @@ -491,7 +493,7 @@ public class DsMessageServiceImpl implements DsMessageService { } skuRefundInfosItem.setCloseReason(""); skuRefundInfosItem.setOperationType(getOperateType(refundInfo, alibabaMessage)); - skuRefundInfosItem.setAftersaleType(getAftersaleType(refundInfo, alibabaMessage)); + skuRefundInfosItem.setAftersaleType(getAftersaleType(refundInfo, isAfterSale)); return skuRefundInfosItem; } @@ -525,11 +527,11 @@ public class DsMessageServiceImpl implements DsMessageService { return 0; } - private int getAftersaleType(RefundInfoDTO refundInfo, AlibabaMessage alibabaMessage) { - if (alibabaMessage.isRefundInMsg() && refundInfo.getOnlyRefund() == 1) { + private int getAftersaleType(RefundInfoDTO refundInfo, boolean isAfterSale) { + if (!isAfterSale && refundInfo.getOnlyRefund() == 1) { return 2; } - if (alibabaMessage.isRefundAfterMsg() && refundInfo.getOnlyRefund() == 1) { + if (isAfterSale && refundInfo.getOnlyRefund() == 1) { return 1; } return 3;