...
|
...
|
@@ -30,6 +30,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder; |
|
|
import com.yohoufo.order.service.handler.penalty.PenaltyResult;
|
|
|
import com.yohoufo.order.service.handler.penalty.SellerEarnestMoney2BuyerPenaltyCalculator;
|
|
|
import com.yohoufo.order.service.impl.function.BuyerNoticeSender;
|
|
|
import com.yohoufo.order.service.impl.function.RecordSuppleExpressSender;
|
|
|
import com.yohoufo.order.service.impl.function.SellerNoticeSender;
|
|
|
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
|
|
|
import lombok.Data;
|
...
|
...
|
@@ -80,6 +81,8 @@ class BuyerOrderCancelHandler { |
|
|
|
|
|
private NoticeBuyer noticeBuyer;
|
|
|
|
|
|
private RecordSuppleExpress recordSuppleExpress;
|
|
|
|
|
|
private BuyerRefundCouponEvent.BizCase refundCouponCase;
|
|
|
|
|
|
private AlarmConfig failAlarm;
|
...
|
...
|
@@ -133,6 +136,10 @@ class BuyerOrderCancelHandler { |
|
|
return new NoticeBuyer(buyerNoticeSender);
|
|
|
}
|
|
|
|
|
|
public RecordSuppleExpress withRecordSuppleExpress(RecordSuppleExpressSender recordSuppleExpressSender){
|
|
|
return new RecordSuppleExpress(recordSuppleExpressSender);
|
|
|
}
|
|
|
|
|
|
public BuyerOrderCancelHandler withRefundCoupon(BuyerRefundCouponEvent.BizCase refundCouponCase) {
|
|
|
this.refundCouponCase = refundCouponCase;
|
|
|
return this;
|
...
|
...
|
@@ -176,6 +183,7 @@ class BuyerOrderCancelHandler { |
|
|
// 更新订单状态成功
|
|
|
if (updateBuyerOrderStatus()) {
|
|
|
log.info("cancel order {} from {} to {} success", orderCode, expectStatus, targetStatus);
|
|
|
addSuppleExpress(sellerUid);
|
|
|
refundCoupon();
|
|
|
transferEarnestMoney2Buyer(buyerOrderGoods.getSkup());
|
|
|
refundPayGoodsMoney(buyerOrder, buyerOrderGoods);
|
...
|
...
|
@@ -360,6 +368,17 @@ class BuyerOrderCancelHandler { |
|
|
return ensure;
|
|
|
}
|
|
|
|
|
|
private void addSuppleExpress(Integer uid){
|
|
|
if (Objects.nonNull(recordSuppleExpress)) {
|
|
|
try {
|
|
|
log.info("addSuppleExpress uid {} ,order code {}",uid, orderCode);
|
|
|
recordSuppleExpress.recordSuppleExpressSender().notice(uid, orderCode);
|
|
|
} catch (Exception e) {
|
|
|
log.warn("addSuppleExpress uid {} ,order code {} fail",uid, orderCode, e);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void noticeSeller(SellerOrderGoods sellerOrderGoods) {
|
|
|
if (Objects.nonNull(noticeSeller)) {
|
|
|
try {
|
...
|
...
|
@@ -456,5 +475,17 @@ class BuyerOrderCancelHandler { |
|
|
}
|
|
|
}
|
|
|
|
|
|
@Data
|
|
|
@Accessors(fluent = true)
|
|
|
class RecordSuppleExpress {
|
|
|
|
|
|
private final RecordSuppleExpressSender recordSuppleExpressSender;
|
|
|
|
|
|
BuyerOrderCancelHandler and() {
|
|
|
BuyerOrderCancelHandler.this.recordSuppleExpress = this;
|
|
|
return BuyerOrderCancelHandler.this;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|