...
|
...
|
@@ -44,6 +44,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder; |
|
|
import com.yohoufo.order.service.cache.OrderCacheService;
|
|
|
import com.yohoufo.order.service.pay.AbstractPayService;
|
|
|
import com.yohoufo.order.service.proxy.InBoxFacade;
|
|
|
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
|
|
|
import com.yohoufo.order.service.proxy.ProductProxyService;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
...
|
...
|
@@ -102,6 +103,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
@Autowired
|
|
|
private IExpressInfoService expressInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
private OrderStatusFlowService orderStatusFlowService;
|
|
|
|
|
|
/**
|
|
|
* 提交订单
|
|
|
* @param orderRequest
|
...
|
...
|
@@ -122,6 +126,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(uid, orderCode);
|
|
|
SellerOrderGoods sog = sellerOrderGoodsMapper.selectByPrimaryKey(bog.getSkup());
|
|
|
|
|
|
//记录状态信息
|
|
|
logger.info("in seller confirm record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
|
|
|
orderStatusFlowService.addAsy(orderCode,OrderStatus.DONE.getCode());
|
|
|
|
|
|
cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()),
|
|
|
CacheKeyBuilder.orderListKey(uid, TabType.BUY.getValue()),
|
|
|
CacheKeyBuilder.sellerOrderDetailKey(sog),
|
...
|
...
|
@@ -314,6 +322,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
OrderStatus targetStatus = OrderStatus.BUYER_CANCEL_TIMEOUT;
|
|
|
DataNode node = checkBase(orderRequest);
|
|
|
cancelBeforePaid(orderRequest, node, expectStatus, targetStatus);
|
|
|
|
|
|
//记录状态变更信息
|
|
|
logger.info("in cancelByAuto record status change, orderRequest {}", orderRequest);
|
|
|
orderStatusFlowService.addAsy(orderRequest.getOrderCode(),targetStatus.getCode());
|
|
|
}
|
|
|
|
|
|
private void doCancel(OrderRequest orderRequest){
|
...
|
...
|
@@ -335,6 +347,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
targetStatus = OrderStatus.BUYER_CANCEL_BEFORE_PAY;
|
|
|
cancelBeforePaid(orderRequest, node, expectStatus, targetStatus);
|
|
|
buyerOrderCancelService.refundCouponIfNeed(buyerOrder.getUid(), buyerOrder.getOrderCode());
|
|
|
//记录状态变更信息
|
|
|
logger.info("in doCancel record status WAITING_PAY change, orderRequest {}", orderRequest);
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
|
|
|
break;
|
|
|
case HAS_PAYED:
|
|
|
BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(orderRequest.getUid(),
|
...
|
...
|
@@ -347,6 +362,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
.amount(buyerOrder.getAmount())
|
|
|
.build();
|
|
|
buyerOrderCancelService.cancel(bsde);
|
|
|
//记录状态变更信息
|
|
|
logger.info("in doCancel record status HAS_PAYED change, orderRequest {}", orderRequest);
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
|
|
|
break;
|
|
|
case SELLER_SEND_OUT:
|
|
|
bog = buyerOrderGoodsMapper.selectByOrderCode(orderRequest.getUid(),
|
...
|
...
|
@@ -359,6 +377,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
.amount(buyerOrder.getAmount())
|
|
|
.build();
|
|
|
buyerOrderCancelService.cancel(bdre);
|
|
|
//记录状态变更信息
|
|
|
logger.info("in doCancel record status HAS_PAYED change, orderRequest {}", orderRequest);
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
|
|
|
break;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -638,9 +659,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
int uid = buyerOrder.getUid();
|
|
|
int sellerUid = buyerOrder.getSellerUid();
|
|
|
logger.info("in confirmReceive begin update status orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
|
|
|
buyerOrderMapper.updateStatusByOrderCode(orderCode, uid, expectStatus.getCode(),
|
|
|
int num = buyerOrderMapper.updateStatusByOrderCode(orderCode, uid, expectStatus.getCode(),
|
|
|
targetStatus.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
|
|
|
//记录订单的状态变更信息
|
|
|
if(num>=1){
|
|
|
logger.info("in confirmReceive record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
|
|
|
}else{
|
|
|
logger.warn("in confirmReceive not record status change cause of update empty num , orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
|
|
|
}
|
|
|
|
|
|
//记录调拨信息(只保存卖家一条)
|
|
|
EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
|
|
|
EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
|
...
|
...
|
@@ -678,9 +707,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
int uid = buyerOrder.getUid();
|
|
|
int sellerUid = buyerOrder.getSellerUid();
|
|
|
logger.info("in judgeBegin begin update status orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
|
|
|
buyerOrderMapper.updateStatusByOrderCode(orderCode, uid, expectStatus.getCode(),
|
|
|
int num=buyerOrderMapper.updateStatusByOrderCode(orderCode, uid, expectStatus.getCode(),
|
|
|
targetStatus.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
|
|
|
//记录订单的状态变更信息
|
|
|
if(num>=1){
|
|
|
logger.info("in judgeBegin record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
|
|
|
}else{
|
|
|
logger.warn("in judgeBegin not record status change cause of update empty num , orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
|
|
|
}
|
|
|
|
|
|
//记录调拨信息(只保存卖家一条)
|
|
|
EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
|
|
|
EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
|
...
|
...
|
|