|
@@ -130,7 +130,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
@@ -130,7 +130,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
130
|
private UserProxyService userProxyService;
|
130
|
private UserProxyService userProxyService;
|
131
|
|
131
|
|
132
|
@Autowired
|
132
|
@Autowired
|
133
|
- private AppraiseOrderService appraiseOrderService;
|
133
|
+ AppraiseOrderMapper appraiseOrderMapper;
|
134
|
|
134
|
|
135
|
@Autowired
|
135
|
@Autowired
|
136
|
private OrderCodeGenerator orderCodeGenerator;
|
136
|
private OrderCodeGenerator orderCodeGenerator;
|
|
@@ -544,6 +544,131 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
@@ -544,6 +544,131 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
544
|
return result;
|
544
|
return result;
|
545
|
}
|
545
|
}
|
546
|
|
546
|
|
|
|
547
|
+
|
|
|
548
|
+ /**
|
|
|
549
|
+ * 根据订单号以及物流类型返回 物流信息
|
|
|
550
|
+ * @param orderCode
|
|
|
551
|
+ * @param expressTypeList
|
|
|
552
|
+ * @return
|
|
|
553
|
+ */
|
|
|
554
|
+ private List<ExpressInfoDetail> getExpressInfoDetailListByOrderCodeExpressType(long orderCode, List<Integer> expressTypeList){
|
|
|
555
|
+
|
|
|
556
|
+ // 物流信息列表
|
|
|
557
|
+ List<ExpressInfo> list = Lists.newArrayList();
|
|
|
558
|
+ expressTypeList.stream().forEach(expressType -> list.addAll(getExpressInfoList(orderCode, expressType)));
|
|
|
559
|
+
|
|
|
560
|
+ return list.stream().map(expressInfo -> covertToExpressInfoDetail(expressInfo)).collect(Collectors.toList());
|
|
|
561
|
+
|
|
|
562
|
+ }
|
|
|
563
|
+
|
|
|
564
|
+
|
|
|
565
|
+ /**
|
|
|
566
|
+ * 付费鉴定 and 付费寄存 物流信息
|
|
|
567
|
+ * @param orderCode
|
|
|
568
|
+ * @return
|
|
|
569
|
+ */
|
|
|
570
|
+ public ExpressInfoRespBo queryAppraiseExpressDetailInfo(Long orderCode) {
|
|
|
571
|
+
|
|
|
572
|
+ ExpressInfoRespBo expressInfoRespBo = new ExpressInfoRespBo();
|
|
|
573
|
+
|
|
|
574
|
+ AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
|
|
|
575
|
+ throwServiceExceptionIf(Objects.isNull(appraiseOrder), "订单不存在");
|
|
|
576
|
+
|
|
|
577
|
+
|
|
|
578
|
+ // 付费寄存 无点亮信息,只根据状态展示对应的物流信息
|
|
|
579
|
+ if (appraiseOrder.getAttributes() == AppraiseOrderAttributes.PAID_APPRAISE.getCode()){
|
|
|
580
|
+
|
|
|
581
|
+ // 用户发货, 待用户收货 只有这两个状态展示物流
|
|
|
582
|
+ throwServiceExceptionIf(appraiseOrder.getStatus() != AppraiseOrderStatus.SELLER_SEND_OUT.getCode()
|
|
|
583
|
+ && appraiseOrder.getStatus() != AppraiseOrderStatus.WAITING_RECEIVE.getCode(), "不展示物流信息");
|
|
|
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());
|
|
|
593
|
+ }
|
|
|
594
|
+
|
|
|
595
|
+ // 物流单号信息
|
|
|
596
|
+ constructWayBillInfo(orderCode, expressTypeList, expressInfoRespBo);
|
|
|
597
|
+
|
|
|
598
|
+ // 根据订单号and物流类型 返回物流信息
|
|
|
599
|
+ List<ExpressInfoDetail> expressInfoDetailList = getExpressInfoDetailListByOrderCodeExpressType(orderCode, expressTypeList);
|
|
|
600
|
+
|
|
|
601
|
+ expressInfoRespBo.setExpressInfoDetailTitle("");
|
|
|
602
|
+ expressInfoRespBo.setExpressInfoDetailList(expressInfoDetailList);
|
|
|
603
|
+
|
|
|
604
|
+ return expressInfoRespBo;
|
|
|
605
|
+
|
|
|
606
|
+ }else if(appraiseOrder.getAttributes() == AppraiseOrderAttributes.PAID_DEPOSIT.getCode()){
|
|
|
607
|
+
|
|
|
608
|
+ // 子订单的场合,点亮信息 + 物流信息(不区分阶段)
|
|
|
609
|
+ // 父订单的场合,点亮信息 + 物流信息(区分阶段)
|
|
|
610
|
+ boolean isSubOrder = Objects.nonNull(appraiseOrder.getParentOrderCode()) ? true : false;
|
|
|
611
|
+
|
|
|
612
|
+ // 点亮信息设置
|
|
|
613
|
+ expressInfoRespBo.setStage(new AppraiseExpressStageBuilder(appraiseOrder).build());
|
|
|
614
|
+
|
|
|
615
|
+ // 子订单
|
|
|
616
|
+ if (isSubOrder){
|
|
|
617
|
+
|
|
|
618
|
+ // 寄回物流
|
|
|
619
|
+ List<Integer> expressTypeList = Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),
|
|
|
620
|
+ EnumExpressType.EXPRESS_TYPE_3.getCode(),
|
|
|
621
|
+ EnumExpressType.EXPRESS_TYPE_REBACK.getCode());
|
|
|
622
|
+
|
|
|
623
|
+ // 物流单号信息
|
|
|
624
|
+ constructWayBillInfo(orderCode, expressTypeList, expressInfoRespBo);
|
|
|
625
|
+
|
|
|
626
|
+ // 根据订单号and物流类型 返回物流信息
|
|
|
627
|
+ List<ExpressInfoDetail> expressInfoDetailList = getExpressInfoDetailListByOrderCodeExpressType(orderCode, expressTypeList);
|
|
|
628
|
+
|
|
|
629
|
+ expressInfoRespBo.setExpressInfoDetailTitle("");
|
|
|
630
|
+ expressInfoRespBo.setExpressInfoDetailList(expressInfoDetailList);
|
|
|
631
|
+
|
|
|
632
|
+ return expressInfoRespBo;
|
|
|
633
|
+
|
|
|
634
|
+ }
|
|
|
635
|
+ // 父订单
|
|
|
636
|
+ else{
|
|
|
637
|
+
|
|
|
638
|
+ List<Integer> expressTypeList = getAppraiseExpressType(appraiseOrder.getStatus());
|
|
|
639
|
+ if (CollectionUtils.isEmpty(expressTypeList)) {
|
|
|
640
|
+ LOGGER.info("{}, appraise expressTypeList is empty", orderCode);
|
|
|
641
|
+ return expressInfoRespBo;
|
|
|
642
|
+ }
|
|
|
643
|
+
|
|
|
644
|
+ // 物流单号信息
|
|
|
645
|
+ constructWayBillInfo(orderCode, expressTypeList, expressInfoRespBo);
|
|
|
646
|
+
|
|
|
647
|
+ // 其中是否包含了 鉴定中心内部调拨信息
|
|
|
648
|
+ if (expressTypeList.contains(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode())){
|
|
|
649
|
+
|
|
|
650
|
+ // 根据订单号and物流类型 返回物流信息
|
|
|
651
|
+ List<ExpressInfoDetail> expressInfoDetailList = getExpressInfoDetailListByOrderCodeExpressType(orderCode, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode()));
|
|
|
652
|
+
|
|
|
653
|
+ expressInfoRespBo.setJudgeExpressInfoDetailList(expressInfoDetailList);
|
|
|
654
|
+ expressInfoRespBo.setJudgeExpressInfoDetailTitle("平台鉴定");
|
|
|
655
|
+ }
|
|
|
656
|
+
|
|
|
657
|
+ // 根据订单号and物流类型 返回物流信息
|
|
|
658
|
+ List<ExpressInfoDetail> expressInfoDetailList = getExpressInfoDetailListByOrderCodeExpressType(orderCode, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
|
|
|
659
|
+
|
|
|
660
|
+ expressInfoRespBo.setSupplementExpressInfoDetailTitle("卖家发往平台");
|
|
|
661
|
+ expressInfoRespBo.setSupplementExpressInfoDetailList(expressInfoDetailList);
|
|
|
662
|
+
|
|
|
663
|
+ return expressInfoRespBo;
|
|
|
664
|
+
|
|
|
665
|
+ }
|
|
|
666
|
+ }
|
|
|
667
|
+
|
|
|
668
|
+ LOGGER.info("{}, result is {}", orderCode, JSON.toJSONString(expressInfoRespBo));
|
|
|
669
|
+ return expressInfoRespBo;
|
|
|
670
|
+ }
|
|
|
671
|
+
|
547
|
private void constructSupplementExpress(TabType actor, Long orderCode, Integer expressType, ExpressInfoRespBo expressInfoRespBo) {
|
672
|
private void constructSupplementExpress(TabType actor, Long orderCode, Integer expressType, ExpressInfoRespBo expressInfoRespBo) {
|
548
|
if (EnumExpressType.EXPRESS_TYPE_2.getCode().intValue() == expressType.intValue()
|
673
|
if (EnumExpressType.EXPRESS_TYPE_2.getCode().intValue() == expressType.intValue()
|
549
|
|| EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().intValue() == expressType.intValue()) {
|
674
|
|| EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().intValue() == expressType.intValue()) {
|
|
@@ -635,6 +760,30 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
@@ -635,6 +760,30 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
635
|
|
760
|
|
636
|
}
|
761
|
}
|
637
|
|
762
|
|
|
|
763
|
+
|
|
|
764
|
+ /**
|
|
|
765
|
+ * 根据状态获取物流类型
|
|
|
766
|
+ * @param status
|
|
|
767
|
+ * @return
|
|
|
768
|
+ */
|
|
|
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());
|
|
|
782
|
+ }
|
|
|
783
|
+ return null;
|
|
|
784
|
+
|
|
|
785
|
+ }
|
|
|
786
|
+
|
638
|
/* private Integer getCurrentExpressType4ExpressRecordAndSeller(Integer status){
|
787
|
/* private Integer getCurrentExpressType4ExpressRecordAndSeller(Integer status){
|
639
|
|
788
|
|
640
|
Integer type ;
|
789
|
Integer type ;
|
|
@@ -840,6 +989,25 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
@@ -840,6 +989,25 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
840
|
return "订单跟踪";
|
989
|
return "订单跟踪";
|
841
|
}
|
990
|
}
|
842
|
|
991
|
|
|
|
992
|
+ /**
|
|
|
993
|
+ * 响应结果类型转换
|
|
|
994
|
+ * @param expressInfo
|
|
|
995
|
+ * @return
|
|
|
996
|
+ */
|
|
|
997
|
+ private ExpressInfoDetail covertToExpressInfoDetail(ExpressInfo expressInfo){
|
|
|
998
|
+ ExpressInfoDetail expressInfoDetail = new ExpressInfoDetail();
|
|
|
999
|
+
|
|
|
1000
|
+ // 运单接收地
|
|
|
1001
|
+ expressInfoDetail.setAcceptAddress(expressInfo.getAcceptAddress());
|
|
|
1002
|
+ // 运单信息
|
|
|
1003
|
+ expressInfoDetail.setAcceptRemark(expressInfo.getAcceptRemark());
|
|
|
1004
|
+ expressInfoDetail.setCreateTimeStr(DateUtil.formatDate(expressInfo.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
|
|
|
1005
|
+
|
|
|
1006
|
+ expressInfoDetail.setState(expressInfo.getState());
|
|
|
1007
|
+ expressInfoDetail.setExpressType(expressInfo.getExpressType().intValue());
|
|
|
1008
|
+
|
|
|
1009
|
+ return expressInfoDetail;
|
|
|
1010
|
+ }
|
843
|
|
1011
|
|
844
|
private void constructExpressInfo(TabType actor, List<ExpressInfo> expressInfoList, List<ExpressInfoDetail> detailList) {
|
1012
|
private void constructExpressInfo(TabType actor, List<ExpressInfo> expressInfoList, List<ExpressInfoDetail> detailList) {
|
845
|
if (CollectionUtils.isNotEmpty(expressInfoList)) {
|
1013
|
if (CollectionUtils.isNotEmpty(expressInfoList)) {
|