...
|
...
|
@@ -20,7 +20,7 @@ import com.yohoufo.dal.order.model.*; |
|
|
import com.yohoufo.order.common.RefundCase;
|
|
|
import com.yohoufo.order.common.TransferCase;
|
|
|
import com.yohoufo.order.constants.AlarmConfig;
|
|
|
import com.yohoufo.order.constants.CutomsClearanceFailType;
|
|
|
import com.yohoufo.order.constants.ClearanceFailType;
|
|
|
import com.yohoufo.order.constants.MetaKey;
|
|
|
import com.yohoufo.order.event.*;
|
|
|
import com.yohoufo.order.model.PayRefundBo;
|
...
|
...
|
@@ -347,8 +347,8 @@ public class BuyerOrderCancelService { |
|
|
}
|
|
|
|
|
|
|
|
|
public void cancelOverseasOrder(long orderCode, String failReason, CutomsClearanceFailType failType){
|
|
|
new CancelOverseasOrderModel(orderCode, failReason, failType).invoke().cancel();
|
|
|
public void clearanceFail(long orderCode, String failReason, ClearanceFailType failType){
|
|
|
new ClearanceFailModel(orderCode, failReason, failType).invoke().cancel();
|
|
|
}
|
|
|
|
|
|
private void compensateCoupon2Buyer(BigDecimal goodsAmount, int uid, long orderCode) {
|
...
|
...
|
@@ -543,10 +543,10 @@ public class BuyerOrderCancelService { |
|
|
EventBusPublisher.publishEvent(buyerRefundCouponEvent);
|
|
|
}
|
|
|
|
|
|
private class CancelOverseasOrderModel {
|
|
|
private class ClearanceFailModel {
|
|
|
private final long orderCode;
|
|
|
private final String failReason;
|
|
|
private final CutomsClearanceFailType failType;
|
|
|
private final ClearanceFailType failType;
|
|
|
|
|
|
|
|
|
String logTag;
|
...
|
...
|
@@ -554,18 +554,18 @@ public class BuyerOrderCancelService { |
|
|
private Consumer<RefundGoodsAmountNode> refundGoodsAmountConsumer;
|
|
|
private BuyerOrder buyerOrder;
|
|
|
|
|
|
CancelOverseasOrderModel(long orderCode, String failReason, CutomsClearanceFailType failType) {
|
|
|
ClearanceFailModel(long orderCode, String failReason, ClearanceFailType failType) {
|
|
|
this.orderCode = orderCode;
|
|
|
this.failReason = failReason;
|
|
|
this.failType = failType;
|
|
|
}
|
|
|
|
|
|
public CancelOverseasOrderModel invoke() {
|
|
|
logTag = String.format("cancel overseas order %s", orderCode);
|
|
|
public ClearanceFailModel invoke() {
|
|
|
logTag = String.format("clearance fail %s", orderCode);
|
|
|
logger.info("{} failType is {} failReason is {}", logTag, failType, failReason);
|
|
|
|
|
|
throwServiceExceptionIf(orderCode <= 0L, "订单号不存在");
|
|
|
throwServiceExceptionIf(StringUtils.isBlank(failReason), "失败原因不能为空");
|
|
|
throwServiceExceptionIf(StringUtils.isBlank(failReason), "清关失败原因不能为空");
|
|
|
targetStatus = null;
|
|
|
refundGoodsAmountConsumer = null;
|
|
|
switch (failType) {
|
...
|
...
|
@@ -578,7 +578,7 @@ public class BuyerOrderCancelService { |
|
|
refundGoodsAmountConsumer = refundGoodsAmountNode -> userReason(refundGoodsAmountNode);
|
|
|
break;
|
|
|
default:
|
|
|
throwServiceException("无效的目标状态");
|
|
|
throwServiceException("无效的清关失败原因");
|
|
|
}
|
|
|
|
|
|
buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
...
|
...
|
@@ -708,7 +708,7 @@ public class BuyerOrderCancelService { |
|
|
Long orderCode = buyerOrder.getOrderCode();
|
|
|
//
|
|
|
|
|
|
logger.info("cancelOverseasOrder refundGoodsAmount begin payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundAmount {}",
|
|
|
logger.info("clearanceFail refundGoodsAmount begin payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundAmount {}",
|
|
|
buyerUid, orderCode, skup, leftBuyerMoney );
|
|
|
|
|
|
new RefundGoodsMoneyHandler().loadLogger(logger)
|
...
|
...
|
@@ -717,7 +717,7 @@ public class BuyerOrderCancelService { |
|
|
.loadTargetOrderStatus(targetOrderStatus)
|
|
|
.loadSellerOrderGoods(sellerUid, skup)
|
|
|
.refund();
|
|
|
logger.info("cancelOverseasOrder refundGoodsAmount after payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundAmount {}",
|
|
|
logger.info("clearanceFail refundGoodsAmount after payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundAmount {}",
|
|
|
buyerUid, orderCode, skup, leftBuyerMoney );
|
|
|
}
|
|
|
}
|
...
|
...
|
|