Authored by tanling

付费鉴定and付费寄存

@@ -582,14 +582,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -582,14 +582,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
582 throwServiceExceptionIf(appraiseOrder.getStatus() != AppraiseOrderStatus.SELLER_SEND_OUT.getCode() 582 throwServiceExceptionIf(appraiseOrder.getStatus() != AppraiseOrderStatus.SELLER_SEND_OUT.getCode()
583 && appraiseOrder.getStatus() != AppraiseOrderStatus.WAITING_RECEIVE.getCode(), "不展示物流信息"); 583 && appraiseOrder.getStatus() != AppraiseOrderStatus.WAITING_RECEIVE.getCode(), "不展示物流信息");
584 584
585 - List<Integer> expressTypeList = Lists.newArrayList();  
586 - // 用户发货  
587 - if(appraiseOrder.getStatus() == AppraiseOrderStatus.SELLER_SEND_OUT.getCode()){  
588 - expressTypeList = Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());  
589 - }else if(appraiseOrder.getStatus() == AppraiseOrderStatus.WAITING_RECEIVE.getCode()){  
590 - expressTypeList = Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),  
591 - EnumExpressType.EXPRESS_TYPE_3.getCode(),  
592 - EnumExpressType.EXPRESS_TYPE_REBACK.getCode()); 585 + List<Integer> expressTypeList = getAppraiseExpressType(appraiseOrder);
  586 + if (CollectionUtils.isEmpty(expressTypeList)) {
  587 + LOGGER.info("{}, appraise expressTypeList is empty", orderCode);
  588 + return expressInfoRespBo;
593 } 589 }
594 590
595 // 物流单号信息 591 // 物流单号信息
@@ -615,10 +611,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -615,10 +611,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
615 // 子订单 611 // 子订单
616 if (isSubOrder){ 612 if (isSubOrder){
617 613
618 - // 寄回物流  
619 - List<Integer> expressTypeList = Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),  
620 - EnumExpressType.EXPRESS_TYPE_3.getCode(),  
621 - EnumExpressType.EXPRESS_TYPE_REBACK.getCode()); 614 + List<Integer> expressTypeList = getAppraiseExpressType(appraiseOrder);
  615 + if (CollectionUtils.isEmpty(expressTypeList)) {
  616 + LOGGER.info("{}, appraise expressTypeList is empty", orderCode);
  617 + return expressInfoRespBo;
  618 + }
622 619
623 // 物流单号信息 620 // 物流单号信息
624 constructWayBillInfo(orderCode, expressTypeList, expressInfoRespBo); 621 constructWayBillInfo(orderCode, expressTypeList, expressInfoRespBo);
@@ -635,7 +632,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -635,7 +632,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
635 // 父订单 632 // 父订单
636 else{ 633 else{
637 634
638 - List<Integer> expressTypeList = getAppraiseExpressType(appraiseOrder.getStatus()); 635 + List<Integer> expressTypeList = getAppraiseExpressType(appraiseOrder);
639 if (CollectionUtils.isEmpty(expressTypeList)) { 636 if (CollectionUtils.isEmpty(expressTypeList)) {
640 LOGGER.info("{}, appraise expressTypeList is empty", orderCode); 637 LOGGER.info("{}, appraise expressTypeList is empty", orderCode);
641 return expressInfoRespBo; 638 return expressInfoRespBo;
@@ -766,20 +763,45 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -766,20 +763,45 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
766 * @param status 763 * @param status
767 * @return 764 * @return
768 */ 765 */
769 - private List<Integer> getAppraiseExpressType(Integer status) {  
770 - if (AppraiseOrderStatus.SELLER_SEND_OUT.getCode() == status) {  
771 - return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());  
772 - }  
773 - // 这些状态需要展示 平台鉴定  
774 - else if (AppraiseOrderStatus.PLATFORM_RECEIVE.getCode() == status  
775 - || AppraiseOrderStatus.PLATFORM_CHECKING.getCode() == status  
776 - || AppraiseOrderStatus.JUDGE_PASS.getCode() == status  
777 - || AppraiseOrderStatus.WAITING_RECEIVE.getCode() == status  
778 - || AppraiseOrderStatus.CHECKING_FAKE.getCode() == status  
779 - || AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode() == status  
780 - || AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode() == status) {  
781 - return Arrays.asList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(), EnumExpressType.EXPRESS_TYPE_1.getCode()); 766 + private List<Integer> getAppraiseExpressType(AppraiseOrder appraiseOrder) {
  767 +
  768 + Integer attribute = appraiseOrder.getAttributes();
  769 + Integer status = appraiseOrder.getStatus();
  770 +
  771 + if (attribute == AppraiseOrderAttributes.PAID_APPRAISE.getCode()){
  772 + // 用户发货
  773 + if(status == AppraiseOrderStatus.SELLER_SEND_OUT.getCode()){
  774 + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());
  775 + }else if(status == AppraiseOrderStatus.WAITING_RECEIVE.getCode()){
  776 + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),
  777 + EnumExpressType.EXPRESS_TYPE_3.getCode(),
  778 + EnumExpressType.EXPRESS_TYPE_REBACK.getCode());
  779 + }
  780 + } else if(attribute == AppraiseOrderAttributes.PAID_DEPOSIT.getCode()){
  781 +
  782 + boolean isSubOrder = Objects.nonNull(appraiseOrder.getParentOrderCode()) ? true : false;
  783 + if (isSubOrder){
  784 +
  785 + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),
  786 + EnumExpressType.EXPRESS_TYPE_3.getCode(),
  787 + EnumExpressType.EXPRESS_TYPE_REBACK.getCode());
  788 +
  789 + }else{
  790 + if (AppraiseOrderStatus.SELLER_SEND_OUT.getCode() == status) {
  791 + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());
  792 + }
  793 + // 这些状态需要展示 平台鉴定
  794 + else if (AppraiseOrderStatus.PLATFORM_RECEIVE.getCode() == status
  795 + || AppraiseOrderStatus.JUDGE_PASS.getCode() == status
  796 + || AppraiseOrderStatus.WAITING_RECEIVE.getCode() == status
  797 + || AppraiseOrderStatus.CHECKING_FAKE.getCode() == status
  798 + || AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode() == status
  799 + || AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode() == status) {
  800 + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(), EnumExpressType.EXPRESS_TYPE_1.getCode());
  801 + }
  802 + }
782 } 803 }
  804 +
783 return null; 805 return null;
784 806
785 } 807 }