Authored by tanling

Merge branch 'test6.9.10' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.10

... ... @@ -698,6 +698,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
@Autowired
private AppraiseOrderMapper appraiseOrderMapper;
@Override
public void confirmReceive(long orderCode) {
logger.info("in confirmReceive, orderCode {}", orderCode);
... ... @@ -710,6 +711,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return;
}
// 确认收货过来的是子订单号
int uid = existenceNode.getAppraiseOrder().getUid();
Long parentOrderCode = existenceNode.getAppraiseOrder().getParentOrderCode();
if (parentOrderCode == null){
// 平台收货 内部调拨信息
... ... @@ -736,14 +738,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
logger.warn("in confirmReceive isGoodsServiceOrder saveOperateTransferExpressInfo fail ,orderCode {} ", orderCode, ex);
}
//update
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_RECEIVE,
expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
appraiseOrderMapper.updateStatusByOrderCode(parentOrderCode, targetStatus.getCode(), expectedStatus.getCode(), cdt);
sellerDepositOrderService.platformFinishReceiveGoods(uid, parentOrderCode);
}
return;
}else{
confirmReceive4BuyerOrder(orderCode);
}
}
private void confirmReceive4BuyerOrder(long orderCode){
OrderStatus expectStatus = OrderStatus.SELLER_SEND_OUT;
OrderStatus targetStatus = OrderStatus.PLATFORM_RECEIVE;
... ... @@ -775,6 +780,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
}
// 质检通过,不需要记录物流调拨信息
@Override
@Deprecated
... ...
... ... @@ -533,11 +533,13 @@ public class DepositServiceImpl implements DepositService {
depositDetailBoBuilder.depositStatusName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(0) : "")
.depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : "")
.orderCode(storageDeposit.getParentOrderCode());
.orderCode(storageDeposit.getOrderCode())
.parentOrderCode(storageDeposit.getParentOrderCode());
} else { // 正常的买家订单召回
depositDetailBoBuilder.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus()))
.depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus()))
.orderCode(storageDeposit.getOrderCode());
.orderCode(storageDeposit.getOrderCode())
.parentOrderCode(storageDeposit.getOrderCode());
}
return depositDetailBoBuilder.build();
... ...
... ... @@ -316,10 +316,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
public int platformReceiveGoods(AppraiseOrder appraiseOrder){
int rows = super.platformReceiveGoods(appraiseOrder);
if (rows>0) {
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
}
}
return rows;
}
... ... @@ -653,6 +650,14 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
return appraiseOrder.getParentOrderCode()==null ? orderCode : appraiseOrder.getParentOrderCode();
}
private Long findoutParentOrderCode(AppraiseOrder appraiseOrder){
Long orderCode = appraiseOrder.getOrderCode();
if (Objects.isNull(appraiseOrder)){
logger.warn("in getSubOrderStatistic selectByOrderCode null, orderCode {}", orderCode);
return orderCode;
}
return appraiseOrder.getParentOrderCode()==null ? orderCode : appraiseOrder.getParentOrderCode();
}
public DepositOrderStatisticInfo getAppraiseProgress(int uid, long orderCode){
... ... @@ -710,7 +715,21 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
return dosi;
}
public int platformFinishReceiveGoods(long parentCode){
public int platformFinishReceiveGoods(int uid, long parentCode){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_RECEIVE,
expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
int rows = triggerStatusChange(parentCode,targetStatus,expectedStatus);
if(rows>0){
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
inBoxFacade.sellerDepositOrderNotice(uid, parentCode, targetOrderStatus);
}
return rows;
}
public int platformFinishAppraiseGoods(long parentCode){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.FINISH,
expectedStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
return triggerStatusChange(parentCode,targetStatus,expectedStatus);
... ... @@ -719,14 +738,20 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
public int detectAppraiseFinish(SellerDepositOrderStatusConsistencyAsyncEvent event ){
logger.info("detectAppraiseFinish event {}", event);
long orderCode = event.getOrderCode();
long parentOrderCode = findoutParentOrderCode(orderCode);
AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
long parentOrderCode = findoutParentOrderCode(appraiseOrder);
int cnt =appraiseOrderMapper.selectSubOrderCntIncludeStatus(parentOrderCode,Arrays.asList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode()));
logger.info("detectAppraiseFinish event {},parentOrderCode {} PLATFORM_RECEIVE count {}", event, parentOrderCode, cnt);
if (cnt == 0){
int prows = platformFinishReceiveGoods(parentOrderCode);
int prows = platformFinishAppraiseGoods(parentOrderCode);
logger.info("detectAppraiseFinish platformFinishReceiveGoods, orderCode {},parentOrderCode {} parent count {}",
orderCode, parentOrderCode, prows);
if (prows>0){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.FINISH;
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), parentOrderCode, targetStatus);
}
return prows;
}
return 0;
... ...