|
|
|
@ -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<SkuRefundInfosItem> skuRefundInfosItems = new ArrayList<>();
|
|
|
|
|
Set<String> 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;
|
|
|
|
|