Authored by chenchao

update parent order status when platform receive all goods

... ... @@ -695,6 +695,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return false;
}
@Autowired
private AppraiseOrderMapper appraiseOrderMapper;
@Override
public void confirmReceive(long orderCode) {
... ... @@ -721,13 +723,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
List<Integer> status = Lists.newArrayList(AppraiseOrderStatus.SELLER_SEND_OUT.getCode());
int cnt = serviceOrderProcessor.getSubOrderCntNotDefinedStatus(parentOrderCode, status);
logger.info("no confirm delivery sub order cnt is {}, parentOrderCode {}", cnt, parentOrderCode);
int cdt = DateUtil.getCurrentTimeSecond();
//
if (cnt == 0){
// 平台收货 内部调拨信息
EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive;
expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(),parentOrderCode ,expressType.getCode(),expressDataType,operateTransferCode);
try {
EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive;
expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(), parentOrderCode, expressType.getCode(), expressDataType, operateTransferCode);
}catch (Exception ex){
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);
}
return;
... ...
... ... @@ -1105,7 +1105,7 @@ public class InBoxFacade extends BaseNoticeFacade{
inboxParams = buildParams4SellerDepositOrder(orderCode);
break;
case JUDGE_PASS:
case JUDGE_PASS_WAIT_WAREHOUSE:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_APPRAISE_PASS;
//get product info 「商品名称」「尺码」「货号」
inboxParams = buildParams4SellerDepositOrder(orderCode);
... ...
... ... @@ -334,14 +334,17 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
*/
@Override
public int appraisePass(AppraiseOrder pao){
int rows = super.appraisePass(pao);
long orderCode = pao.getOrderCode();
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.JUDGE_PASS_WAIT_WAREHOUSE,
expectedStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
int rows = triggerStatusChange(orderCode, targetStatus, expectedStatus);
if (rows == 0){
return rows;
}
Long orderCode = pao.getOrderCode();
Long paidCode = pao.getParentOrderCode();
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.JUDGE_PASS;
inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus);
inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetStatus);
BigDecimal left = calLeftMoney(pao.getAmount(), orderCode);
if (left.compareTo(BigDecimal.ZERO)>0){
... ...