20240115-ljl-multiPay
ljl 12 months ago
parent 8a400b6bdd
commit 2aeabad6cd

@ -417,6 +417,8 @@ public class DsMessageServiceImpl implements DsMessageService {
SupplyCenterRefundOperateParam param = new SupplyCenterRefundOperateParam(); SupplyCenterRefundOperateParam param = new SupplyCenterRefundOperateParam();
param.setPurOrderId(purchaseOrder.getPurOrderId()); param.setPurOrderId(purchaseOrder.getPurOrderId());
boolean isAfterSale = StringUtil.isNotEmpty(purchaseOrderDTO.getPurchaseOrderWaybillCode()) && StringUtil.isNotEmpty(purchaseOrderDTO.getPurchaseOrderLogisticsName());
List<SkuRefundInfosItem> skuRefundInfosItems = new ArrayList<>(); List<SkuRefundInfosItem> skuRefundInfosItems = new ArrayList<>();
Set<String> subItemIds = refundInfo.getOrderEntryCountMap().keySet(); Set<String> subItemIds = refundInfo.getOrderEntryCountMap().keySet();
for (String subItemId: subItemIds) { for (String subItemId: subItemIds) {
@ -425,7 +427,7 @@ public class DsMessageServiceImpl implements DsMessageService {
continue; continue;
} }
String purSkuOrderId = skuItemIdAndPurSkuOrderIdMap.get(subItemId); String purSkuOrderId = skuItemIdAndPurSkuOrderIdMap.get(subItemId);
SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(purSkuOrderId, refundInfo, alibabaMessage); SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(purSkuOrderId, refundInfo, alibabaMessage, isAfterSale);
skuRefundInfosItems.add(skuRefundInfosItem); skuRefundInfosItems.add(skuRefundInfosItem);
} }
param.setSkuRefundInfos(skuRefundInfosItems); 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 skuRefundInfosItem = new SkuRefundInfosItem();
skuRefundInfosItem.setPurSkuOrderId(purSkuOrderId); skuRefundInfosItem.setPurSkuOrderId(purSkuOrderId);
skuRefundInfosItem.setRejectReason(refundInfo.getRejectReason()); skuRefundInfosItem.setRejectReason(refundInfo.getRejectReason());
@ -491,7 +493,7 @@ public class DsMessageServiceImpl implements DsMessageService {
} }
skuRefundInfosItem.setCloseReason(""); skuRefundInfosItem.setCloseReason("");
skuRefundInfosItem.setOperationType(getOperateType(refundInfo, alibabaMessage)); skuRefundInfosItem.setOperationType(getOperateType(refundInfo, alibabaMessage));
skuRefundInfosItem.setAftersaleType(getAftersaleType(refundInfo, alibabaMessage)); skuRefundInfosItem.setAftersaleType(getAftersaleType(refundInfo, isAfterSale));
return skuRefundInfosItem; return skuRefundInfosItem;
} }
@ -525,11 +527,11 @@ public class DsMessageServiceImpl implements DsMessageService {
return 0; return 0;
} }
private int getAftersaleType(RefundInfoDTO refundInfo, AlibabaMessage alibabaMessage) { private int getAftersaleType(RefundInfoDTO refundInfo, boolean isAfterSale) {
if (alibabaMessage.isRefundInMsg() && refundInfo.getOnlyRefund() == 1) { if (!isAfterSale && refundInfo.getOnlyRefund() == 1) {
return 2; return 2;
} }
if (alibabaMessage.isRefundAfterMsg() && refundInfo.getOnlyRefund() == 1) { if (isAfterSale && refundInfo.getOnlyRefund() == 1) {
return 1; return 1;
} }
return 3; return 3;

Loading…
Cancel
Save