...
|
...
|
@@ -28,9 +28,12 @@ import com.yohoufo.order.model.dto.BuyerPenaltyCalResult; |
|
|
import com.yohoufo.order.model.request.PaymentRequest;
|
|
|
import com.yohoufo.order.model.request.TranseferCellNode;
|
|
|
import com.yohoufo.order.model.request.TransferMoneyRequest;
|
|
|
import com.yohoufo.order.service.DepositService;
|
|
|
import com.yohoufo.order.service.IBuyerOrderMetaService;
|
|
|
import com.yohoufo.order.service.cache.CacheCleaner;
|
|
|
import com.yohoufo.order.service.cache.CacheKeyBuilder;
|
|
|
import com.yohoufo.order.service.concurrent.ThreadPoolFactory;
|
|
|
import com.yohoufo.order.service.deposit.DepositOrderService;
|
|
|
import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler;
|
|
|
import com.yohoufo.order.service.handler.RefundEarnestMoneyHandler;
|
|
|
import com.yohoufo.order.service.handler.RefundGoodsMoneyHandler;
|
...
|
...
|
@@ -140,6 +143,12 @@ public class BuyerOrderCancelService { |
|
|
@Resource(name = "tradeMqProducer")
|
|
|
private YhProducer tradeMqProducer;
|
|
|
|
|
|
@Autowired
|
|
|
private DepositService depositService;
|
|
|
|
|
|
@Autowired
|
|
|
private IBuyerOrderMetaService buyerOrderMetaService;
|
|
|
|
|
|
public void cancel(BeforeSellerDeliverEvent bsdEvent){
|
|
|
int buyerUid = bsdEvent.getBuyerUid();
|
|
|
int sellerUid = bsdEvent.getSellerUid();
|
...
|
...
|
@@ -353,11 +362,30 @@ public class BuyerOrderCancelService { |
|
|
EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder().setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_ORDER_CANCEL)
|
|
|
.addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计取消订单的次数
|
|
|
|
|
|
//
|
|
|
String depositCode = buyerOrderMetaService.getDepositCode(buyerUid, orderCode);
|
|
|
if (StringUtils.isNotBlank(depositCode)){
|
|
|
logger.info("cancel buyer order Before Depot Receive trigger DepositGoodsCompensateAsyncEvent orderCode {} depositCode {}", orderCode, depositCode);
|
|
|
triggerDepositGoodsCompensateAsyncEvent(sellerUid, depositCode);
|
|
|
}
|
|
|
logger.info("use one thread to execute buyer cancel BeforeDepotReceive buyerUid {}, orderCode {}, skup {}, compensate {}, transferCase {}",
|
|
|
buyerUid, orderCode, skup, bpcr, transferCase);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private int compensateDepositGoods(DepositGoodsCompensateAsyncEvent event){
|
|
|
logger.info("cancel buyer order compensateDepositGoods, event {}", event);
|
|
|
return depositService.updateDepositAfterCancelBuy(event.getUid(), event.getDepositCode());
|
|
|
}
|
|
|
|
|
|
private void triggerDepositGoodsCompensateAsyncEvent(int sellerUid, String depositCode){
|
|
|
logger.info("trigger DepositGoodsCompensateAsyncEvent sellerUid {} depositCode {}", sellerUid, depositCode);
|
|
|
DepositGoodsCompensateAsyncEvent asyncEvent
|
|
|
= new DepositGoodsCompensateAsyncEvent(this::compensateDepositGoods);
|
|
|
asyncEvent.setUid(sellerUid);
|
|
|
asyncEvent.setDepositCode(depositCode);
|
|
|
EventBusPublisher.publishEvent(asyncEvent);
|
|
|
}
|
|
|
|
|
|
public void clearanceFail(long orderCode, String failReason, ClearanceFailType failType){
|
|
|
new ClearanceFailModel(orderCode, failReason, failType).invoke().cancel();
|
...
|
...
|
|