Authored by chenchao

Merge branch 'hotfix_现货寄存订单发货变更' into test6.9.13

# Conflicts:
#	order/src/main/java/com/yohoufo/order/service/impl/BuyerOrderServiceImpl.java
... ... @@ -143,4 +143,12 @@ public interface DepositService {
*/
int updateSellLock(Integer uid, String depositCode, Integer sellLock);
/**
* 把记录置为无效
* @param uid
* @param depositCode
* @return
*/
int updateDelStatus(Integer uid, String depositCode);
}
... ...
... ... @@ -135,6 +135,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
private StorageDepositMapper storageDepositMapper;
@Autowired
private AppraiseOrderMapper appraiseOrderMapper;
@Autowired
private BuyerOrderAssistant buyerOrderAssistant;
@Autowired
private BuyerOrderStateChangers buyerOrderStateChangers;
/**
... ... @@ -830,7 +836,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
OrderStatus expectStatus = OrderStatus.SELLER_SEND_OUT;
OrderStatus targetStatus = OrderStatus.PLATFORM_RECEIVE;
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
BuyerOrderAssistant.PreparedData preparedData = buyerOrderAssistant.prepare(orderCode);
BuyerOrder buyerOrder = preparedData.getBuyerOrder();
if (buyerOrder != null && buyerOrder.getStatus() == expectStatus.getCode()){
int uid = buyerOrder.getUid();
... ... @@ -844,6 +852,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
logger.info("in confirmReceive record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
buyerNoticeFacade.platformReceiveGoods(uid,orderCode);
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
//
finishDepositGoodsIf(preparedData);
}else{
logger.warn("in confirmReceive not record status change cause of update empty num , orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
}
... ... @@ -858,6 +868,30 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
}
/**
* 现货寄存订单
* 卖家使用寄存商品发货
* @param preparedData
*/
private void finishDepositGoodsIf(BuyerOrderAssistant.PreparedData preparedData){
BuyerOrder buyerOrder = preparedData.getBuyerOrder();
int uid = buyerOrder.getUid();
Long orderCode = buyerOrder.getOrderCode();
SellerOrderGoods psog = preparedData.getSellerOrderGoods();
SkupType skupType = SkupType.getSkupType(psog.getAttributes());
boolean isInstockDepositOrder = BuyerOrderUtils.isInstockDeposit(skupType, buyerOrder.getAttributes());
logger.info("platform confirmReceive orderCode {} buyerUid {} isInstockDepositOrder {}", orderCode, uid, isInstockDepositOrder);
if(isInstockDepositOrder){
String depositCode = buyerOrderMetaService.getDepositCode(uid, orderCode);
logger.info("platform confirmReceive orderCode {} buyerUid {} isInstockDepositOrder {} depositCode {}",
orderCode, uid, isInstockDepositOrder, depositCode);
if (StringUtils.isNotBlank(depositCode)){
int depositUpdate = depositService.updateDelStatus(psog.getUid(), depositCode);
logger.info("platform confirmReceive update deposit DelStatus {} orderCode {} buyerUid {} depositCode {}",
depositUpdate, orderCode, uid, depositCode);
}
}
}
// 质检通过,不需要记录物流调拨信息
@Override
... ... @@ -1108,6 +1142,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
//寄存商品 出库准备
int rows = 0;
/*
boolean isInstockDepositOrder = dscNode.isInstockDepositOrder();
if (isInstockDepositOrder){
//上架的寄存商品 || 未上架的寄存商品
... ... @@ -1126,7 +1161,11 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
rows = depositService.updateDepositWaitToPick(ownerUid, depositCode, orderCode, Optional.ofNullable(preparedData.getBuyerOrderGoods())
.map(BuyerOrderGoods::getSkup).orElse(0));
logger.info("processOrderDeliverByDepositGoods orderCode {} depositCode {} updateDepositWaitToPick {}", orderCode, depositCode, rows);
}
}*/
rows = depositService.updateDepositWaitToPick(ownerUid, depositCode, orderCode, Optional.ofNullable(preparedData.getBuyerOrderGoods())
.map(BuyerOrderGoods::getSkup).orElse(0));
logger.info("processOrderDeliverByDepositGoods orderCode {} depositCode {} updateDepositWaitToPick {}", orderCode, depositCode, rows);
if (rows>0){
//bind deposit code 2 buyer order
... ...
... ... @@ -872,6 +872,22 @@ public class DepositServiceImpl implements DepositService {
}
@Override
public int updateDelStatus(Integer uid, String depositCode) {
StorageDeposit deposit = storageDepositMapper.queryByDepositCode(uid, depositCode);
if(null == deposit) {
throw new UfoServiceException(400, "寄存商品不存在");
}
LOGGER.info("updateDelStatus, uid is {}, depositCode is {}, old depositInfo is {}", uid, depositCode, deposit);
//当前记录置为无效
int num = storageDepositMapper.updateDelStatusByCode(uid, depositCode, deposit.getStatus());
//清缓存
clearCache(uid, deposit.getProductId(), deposit.getStorageId());
return num;
}
@Override
public boolean updateDepositAfterCancelBuy(Integer uid, String depositCode) {
StorageDeposit deposit = storageDepositMapper.queryByDepositCode(uid, depositCode);
if(null == deposit) {
... ...
... ... @@ -259,6 +259,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
BuyerOrderAssistant.DepositSkuCheckNode dscNode,
SellerDeliverToDepotReq req4Log
){
/*
final BuyerOrder pbo = preparedData.getBuyerOrder();
Long orderCode = pbo.getOrderCode();
... ... @@ -281,6 +282,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
sellerNoticeFacade.appraisePassCore(buyerUid, orderCode, psog, true, MsgSendFlg.OTHER);
}
return updateOrderCnt;
*/
return processBuyerOrderOfNotInstockDepositUsingDepositGoods(preparedData, dscNode, req4Log);
}
private int processBuyerOrderOfNotInstockDepositUsingDepositGoods(BuyerOrderAssistant.PreparedData preparedData,
... ...