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 { @@ -698,6 +698,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
698 @Autowired 698 @Autowired
699 private AppraiseOrderMapper appraiseOrderMapper; 699 private AppraiseOrderMapper appraiseOrderMapper;
700 700
  701 +
701 @Override 702 @Override
702 public void confirmReceive(long orderCode) { 703 public void confirmReceive(long orderCode) {
703 logger.info("in confirmReceive, orderCode {}", orderCode); 704 logger.info("in confirmReceive, orderCode {}", orderCode);
@@ -710,6 +711,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -710,6 +711,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
710 return; 711 return;
711 } 712 }
712 // 确认收货过来的是子订单号 713 // 确认收货过来的是子订单号
  714 + int uid = existenceNode.getAppraiseOrder().getUid();
713 Long parentOrderCode = existenceNode.getAppraiseOrder().getParentOrderCode(); 715 Long parentOrderCode = existenceNode.getAppraiseOrder().getParentOrderCode();
714 if (parentOrderCode == null){ 716 if (parentOrderCode == null){
715 // 平台收货 内部调拨信息 717 // 平台收货 内部调拨信息
@@ -736,14 +738,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -736,14 +738,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
736 logger.warn("in confirmReceive isGoodsServiceOrder saveOperateTransferExpressInfo fail ,orderCode {} ", orderCode, ex); 738 logger.warn("in confirmReceive isGoodsServiceOrder saveOperateTransferExpressInfo fail ,orderCode {} ", orderCode, ex);
737 } 739 }
738 //update 740 //update
739 - AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_RECEIVE,  
740 - expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;  
741 - appraiseOrderMapper.updateStatusByOrderCode(parentOrderCode, targetStatus.getCode(), expectedStatus.getCode(), cdt); 741 + sellerDepositOrderService.platformFinishReceiveGoods(uid, parentOrderCode);
742 } 742 }
743 743
744 - return; 744 + }else{
  745 +
  746 + confirmReceive4BuyerOrder(orderCode);
745 } 747 }
746 748
  749 + }
  750 +
  751 + private void confirmReceive4BuyerOrder(long orderCode){
747 752
748 OrderStatus expectStatus = OrderStatus.SELLER_SEND_OUT; 753 OrderStatus expectStatus = OrderStatus.SELLER_SEND_OUT;
749 OrderStatus targetStatus = OrderStatus.PLATFORM_RECEIVE; 754 OrderStatus targetStatus = OrderStatus.PLATFORM_RECEIVE;
@@ -775,6 +780,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -775,6 +780,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
775 } 780 }
776 } 781 }
777 782
  783 +
778 // 质检通过,不需要记录物流调拨信息 784 // 质检通过,不需要记录物流调拨信息
779 @Override 785 @Override
780 @Deprecated 786 @Deprecated
@@ -533,11 +533,13 @@ public class DepositServiceImpl implements DepositService { @@ -533,11 +533,13 @@ public class DepositServiceImpl implements DepositService {
533 533
534 depositDetailBoBuilder.depositStatusName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(0) : "") 534 depositDetailBoBuilder.depositStatusName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(0) : "")
535 .depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : "") 535 .depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : "")
536 - .orderCode(storageDeposit.getParentOrderCode()); 536 + .orderCode(storageDeposit.getOrderCode())
  537 + .parentOrderCode(storageDeposit.getParentOrderCode());
537 } else { // 正常的买家订单召回 538 } else { // 正常的买家订单召回
538 depositDetailBoBuilder.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus())) 539 depositDetailBoBuilder.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus()))
539 .depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus())) 540 .depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus()))
540 - .orderCode(storageDeposit.getOrderCode()); 541 + .orderCode(storageDeposit.getOrderCode())
  542 + .parentOrderCode(storageDeposit.getOrderCode());
541 } 543 }
542 544
543 return depositDetailBoBuilder.build(); 545 return depositDetailBoBuilder.build();
@@ -316,10 +316,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -316,10 +316,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
316 public int platformReceiveGoods(AppraiseOrder appraiseOrder){ 316 public int platformReceiveGoods(AppraiseOrder appraiseOrder){
317 int rows = super.platformReceiveGoods(appraiseOrder); 317 int rows = super.platformReceiveGoods(appraiseOrder);
318 if (rows>0) { 318 if (rows>0) {
319 -  
320 - AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;  
321 - inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);  
322 - } 319 + }
323 return rows; 320 return rows;
324 } 321 }
325 322
@@ -653,6 +650,14 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -653,6 +650,14 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
653 return appraiseOrder.getParentOrderCode()==null ? orderCode : appraiseOrder.getParentOrderCode(); 650 return appraiseOrder.getParentOrderCode()==null ? orderCode : appraiseOrder.getParentOrderCode();
654 } 651 }
655 652
  653 + private Long findoutParentOrderCode(AppraiseOrder appraiseOrder){
  654 + Long orderCode = appraiseOrder.getOrderCode();
  655 + if (Objects.isNull(appraiseOrder)){
  656 + logger.warn("in getSubOrderStatistic selectByOrderCode null, orderCode {}", orderCode);
  657 + return orderCode;
  658 + }
  659 + return appraiseOrder.getParentOrderCode()==null ? orderCode : appraiseOrder.getParentOrderCode();
  660 + }
656 661
657 662
658 public DepositOrderStatisticInfo getAppraiseProgress(int uid, long orderCode){ 663 public DepositOrderStatisticInfo getAppraiseProgress(int uid, long orderCode){
@@ -710,7 +715,21 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -710,7 +715,21 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
710 return dosi; 715 return dosi;
711 } 716 }
712 717
713 - public int platformFinishReceiveGoods(long parentCode){ 718 + public int platformFinishReceiveGoods(int uid, long parentCode){
  719 + AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_RECEIVE,
  720 + expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
  721 + int rows = triggerStatusChange(parentCode,targetStatus,expectedStatus);
  722 +
  723 + if(rows>0){
  724 + AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
  725 + inBoxFacade.sellerDepositOrderNotice(uid, parentCode, targetOrderStatus);
  726 +
  727 + }
  728 + return rows;
  729 + }
  730 +
  731 +
  732 + public int platformFinishAppraiseGoods(long parentCode){
714 AppraiseOrderStatus targetStatus = AppraiseOrderStatus.FINISH, 733 AppraiseOrderStatus targetStatus = AppraiseOrderStatus.FINISH,
715 expectedStatus = AppraiseOrderStatus.PLATFORM_RECEIVE; 734 expectedStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
716 return triggerStatusChange(parentCode,targetStatus,expectedStatus); 735 return triggerStatusChange(parentCode,targetStatus,expectedStatus);
@@ -719,14 +738,20 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -719,14 +738,20 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
719 738
720 public int detectAppraiseFinish(SellerDepositOrderStatusConsistencyAsyncEvent event ){ 739 public int detectAppraiseFinish(SellerDepositOrderStatusConsistencyAsyncEvent event ){
721 logger.info("detectAppraiseFinish event {}", event); 740 logger.info("detectAppraiseFinish event {}", event);
  741 +
722 long orderCode = event.getOrderCode(); 742 long orderCode = event.getOrderCode();
723 - long parentOrderCode = findoutParentOrderCode(orderCode); 743 + AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
  744 + long parentOrderCode = findoutParentOrderCode(appraiseOrder);
724 int cnt =appraiseOrderMapper.selectSubOrderCntIncludeStatus(parentOrderCode,Arrays.asList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode())); 745 int cnt =appraiseOrderMapper.selectSubOrderCntIncludeStatus(parentOrderCode,Arrays.asList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode()));
725 logger.info("detectAppraiseFinish event {},parentOrderCode {} PLATFORM_RECEIVE count {}", event, parentOrderCode, cnt); 746 logger.info("detectAppraiseFinish event {},parentOrderCode {} PLATFORM_RECEIVE count {}", event, parentOrderCode, cnt);
726 if (cnt == 0){ 747 if (cnt == 0){
727 - int prows = platformFinishReceiveGoods(parentOrderCode); 748 + int prows = platformFinishAppraiseGoods(parentOrderCode);
728 logger.info("detectAppraiseFinish platformFinishReceiveGoods, orderCode {},parentOrderCode {} parent count {}", 749 logger.info("detectAppraiseFinish platformFinishReceiveGoods, orderCode {},parentOrderCode {} parent count {}",
729 orderCode, parentOrderCode, prows); 750 orderCode, parentOrderCode, prows);
  751 + if (prows>0){
  752 + AppraiseOrderStatus targetStatus = AppraiseOrderStatus.FINISH;
  753 + inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), parentOrderCode, targetStatus);
  754 + }
730 return prows; 755 return prows;
731 } 756 }
732 return 0; 757 return 0;