|
@@ -10,6 +10,7 @@ import java.util.Set; |
|
@@ -10,6 +10,7 @@ import java.util.Set; |
10
|
import java.util.concurrent.TimeUnit;
|
10
|
import java.util.concurrent.TimeUnit;
|
11
|
import java.util.stream.Collectors;
|
11
|
import java.util.stream.Collectors;
|
12
|
|
12
|
|
|
|
13
|
+import com.alibaba.fastjson.JSON;
|
13
|
import org.apache.commons.collections.CollectionUtils;
|
14
|
import org.apache.commons.collections.CollectionUtils;
|
14
|
import org.apache.commons.lang3.StringUtils;
|
15
|
import org.apache.commons.lang3.StringUtils;
|
15
|
import org.elasticsearch.common.collect.Lists;
|
16
|
import org.elasticsearch.common.collect.Lists;
|
|
@@ -600,7 +601,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -600,7 +601,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
600
|
|
601
|
|
601
|
public List<ExpressInfoResp> queryExpressList(String orderCode, String expressType) {
|
602
|
public List<ExpressInfoResp> queryExpressList(String orderCode, String expressType) {
|
602
|
LOGGER.info("queryExpressList orderCode is {}, expressTypeStr is {}", orderCode, expressType);
|
603
|
LOGGER.info("queryExpressList orderCode is {}, expressTypeStr is {}", orderCode, expressType);
|
603
|
- List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndType(orderCode, convertExpressType(expressType));
|
604
|
+ List<ExpressInfo> list = getExpressInfoListByStage(orderCode, expressType);
|
604
|
if(CollectionUtils.isEmpty(list)) {
|
605
|
if(CollectionUtils.isEmpty(list)) {
|
605
|
return Lists.newArrayList();
|
606
|
return Lists.newArrayList();
|
606
|
}
|
607
|
}
|
|
@@ -621,6 +622,40 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -621,6 +622,40 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
621
|
|
622
|
|
622
|
return respList;
|
623
|
return respList;
|
623
|
}
|
624
|
}
|
|
|
625
|
+
|
|
|
626
|
+ private List<ExpressInfo> getExpressInfoListByStage(String orderCode, String expressType){
|
|
|
627
|
+ LOGGER.info("getExpressInfoListByStage orderCode is {}, expressTypeStr is {}", orderCode, expressType);
|
|
|
628
|
+ List<String> orderCodeList = Lists.newArrayList();
|
|
|
629
|
+ orderCodeList.add(orderCode);
|
|
|
630
|
+ List<ExpressRecord> records = expressRecordMapper.selectByOrderCodeListAndType(orderCodeList,convertExpressType(expressType));
|
|
|
631
|
+ if(CollectionUtils.isEmpty(records)) {
|
|
|
632
|
+ LOGGER.info("getExpressInfoListByStage records is empty , orderCode is {}, expressTypeStr is {}", orderCode, expressType);
|
|
|
633
|
+ return Lists.newArrayList();
|
|
|
634
|
+ }
|
|
|
635
|
+
|
|
|
636
|
+ ExpressRecord record = records.get(0);
|
|
|
637
|
+ LOGGER.info("getExpressInfoListByStage begin , orderCode = {} ,expressType = {}, expressRecord = {} ",orderCode,expressType,record);
|
|
|
638
|
+ String waybillCode = record.getWaybillCode();
|
|
|
639
|
+ Integer logisticsType = record.getLogisticsType();
|
|
|
640
|
+
|
|
|
641
|
+ //原来的情况,根据订单号直接查询物流,如果存在物流信息,则直接返回,否则有可能是多单一号
|
|
|
642
|
+ List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndType(orderCode, convertExpressType(expressType));
|
|
|
643
|
+
|
|
|
644
|
+ //有可能存在一个订单号,多个物流的情况,比如原来的物流填错了,修改了新的物流,只保留新的物流号的信息
|
|
|
645
|
+ if(CollectionUtils.isNotEmpty(list)){
|
|
|
646
|
+ list = list.stream().filter(info -> StringUtils.equals(waybillCode,info.getWaybillCode())).collect(Collectors.toList());
|
|
|
647
|
+ }
|
|
|
648
|
+
|
|
|
649
|
+ if(CollectionUtils.isNotEmpty(list)) {
|
|
|
650
|
+ LOGGER.info("getExpressInfoListByStage success have data in express info orderCode = {} ,expressType = {} ",orderCode,expressType);
|
|
|
651
|
+ return list;
|
|
|
652
|
+ }
|
|
|
653
|
+
|
|
|
654
|
+ LOGGER.info("getExpressInfoListByStage orderCode is {}, expressTypeStr is {},records size is {} ,records is {}", orderCode, expressType , records.size(),JSON.toJSONString(records));
|
|
|
655
|
+
|
|
|
656
|
+ List<ExpressInfo> expressInfoList = expressInfoMapper.selectExpressInfoListByWaybillCodeAndLogisticsType(waybillCode,logisticsType);
|
|
|
657
|
+ return expressInfoList;
|
|
|
658
|
+ }
|
624
|
|
659
|
|
625
|
public List<OrderOperateRecordResp> queryOperateRecordList(BuyerOrderReq req){
|
660
|
public List<OrderOperateRecordResp> queryOperateRecordList(BuyerOrderReq req){
|
626
|
if(null == req.getOrderCode()) {
|
661
|
if(null == req.getOrderCode()) {
|