Authored by qinchao

卖家发货前,买家取消订单,重新上架,恢复库存

... ... @@ -32,6 +32,7 @@ import com.yohoufo.order.service.handler.RefundGoodsMoneyHandler;
import com.yohoufo.order.service.proxy.CouponProxyService;
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 com.yohoufo.order.utils.OrderAssist;
import com.yohoufo.order.utils.PaymentHelper;
... ... @@ -76,6 +77,8 @@ public class BuyerOrderCancelService {
@Autowired
private SellerOrderMetaMapper sellerOrderMetaMapper;
@Autowired
private ProductProxyService productProxyService;
@Autowired
private PayRefundService payRefundService;
... ... @@ -139,10 +142,19 @@ public class BuyerOrderCancelService {
targetGoods.setExceptStatus(SkupStatus.SELL_OUT.getCode());
sellerOrderGoodsMapper.updateStatusBySkpu(targetGoods);
SellerOrder soc = new SellerOrder();
soc.setStatus(targetSellerOrderStatus);
soc.setUpdateTime(DateUtil.getCurrentTimeSecond());
sellerOrderMapper.updateBySkups(soc, Arrays.asList(skup));
logger.info("in buyer cancel BeforeSellerDeliver reSellAfterCancel {}, buyerUid {}, orderCode {}, skup {} buyerOrder {}",
reSellAfterCancel, buyerUid, orderCode, buyerOrder );
if(reSellAfterCancel){
// 恢复product skup的库存
boolean isReturnSuccess = productProxyService.returnStorage(skup);
logger.info("in buyer cancel BeforeSellerDeliver returnStorage {} reSellAfterCancel {}, buyerUid {}, orderCode {}, skup {} buyerOrder {}",isReturnSuccess,
reSellAfterCancel, buyerUid, orderCode, buyerOrder );
}else{
SellerOrder soc = new SellerOrder();
soc.setStatus(targetSellerOrderStatus);
soc.setUpdateTime(DateUtil.getCurrentTimeSecond());
sellerOrderMapper.updateBySkups(soc, Arrays.asList(skup));
}
if (noResponsibility){
inBoxFacade.noticeSellerWhenBuyerCancelNoResponsibility(psog, orderCode);
... ...