...
|
...
|
@@ -39,6 +39,7 @@ import com.yohoufo.order.service.cache.CacheCleaner; |
|
|
import com.yohoufo.order.service.cache.CacheKeyBuilder;
|
|
|
import com.yohoufo.order.service.cache.OrderCacheService;
|
|
|
import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler;
|
|
|
import com.yohoufo.order.service.listener.OrderChangeListenerContainer;
|
|
|
import com.yohoufo.order.service.pay.AbstractPayService;
|
|
|
import com.yohoufo.order.service.proxy.InBoxFacade;
|
|
|
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
|
...
|
...
|
@@ -110,6 +111,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
@Autowired
|
|
|
private ProductMapper productMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private OrderChangeListenerContainer orderChangeListenerContainer;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 提交订单
|
...
|
...
|
@@ -346,6 +350,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
DataNode node = checkBase(orderRequest);
|
|
|
cancelBeforePaid(orderRequest, node, expectStatus, targetStatus);
|
|
|
|
|
|
//取消事件
|
|
|
orderChangeListenerContainer.fireAsyncEvent(new BuyerOrderChangeEvent(node.buyerOrderInDB, BuyerOrderChangeEvent.BizCase.CANCEL_BYSYSAUTO, targetStatus));
|
|
|
|
|
|
//记录状态变更信息
|
|
|
logger.info("in cancelByAuto record status change, orderRequest {}", orderRequest);
|
|
|
orderStatusFlowService.addAsy(orderRequest.getOrderCode(),targetStatus.getCode());
|
...
|
...
|
@@ -370,6 +377,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
targetStatus = OrderStatus.BUYER_CANCEL_BEFORE_PAY;
|
|
|
cancelBeforePaid(orderRequest, node, expectStatus, targetStatus);
|
|
|
|
|
|
orderChangeListenerContainer.fireAsyncEvent(new BuyerOrderChangeEvent(buyerOrder, BuyerOrderChangeEvent.BizCase.CANCEL_BYBUYER, targetStatus));
|
|
|
|
|
|
//记录状态变更信息
|
|
|
logger.info("in doCancel record status WAITING_PAY change, orderRequest {}", orderRequest);
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
|
...
|
...
|
@@ -385,6 +394,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
.amount(buyerOrder.getAmount())
|
|
|
.build();
|
|
|
buyerOrderCancelService.cancel(bsde);
|
|
|
|
|
|
orderChangeListenerContainer.fireAsyncEvent(new BuyerOrderChangeEvent(buyerOrder, BuyerOrderChangeEvent.BizCase.CANCEL_BYBUYER, targetStatus));
|
|
|
|
|
|
//记录状态变更信息
|
|
|
logger.info("in doCancel record status HAS_PAYED change, orderRequest {}", orderRequest);
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
|
...
|
...
|
@@ -400,6 +412,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
.amount(buyerOrder.getAmount())
|
|
|
.build();
|
|
|
buyerOrderCancelService.cancel(bdre);
|
|
|
|
|
|
//取消事件
|
|
|
orderChangeListenerContainer.fireAsyncEvent(new BuyerOrderChangeEvent(buyerOrder, BuyerOrderChangeEvent.BizCase.CANCEL_BYBUYER, targetStatus));
|
|
|
|
|
|
//记录状态变更信息
|
|
|
logger.info("in doCancel record status HAS_PAYED change, orderRequest {}", orderRequest);
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
|
...
|
...
|
|