...
|
...
|
@@ -10,6 +10,7 @@ import java.util.Set; |
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
...
|
...
|
@@ -600,7 +601,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
|
|
|
public List<ExpressInfoResp> queryExpressList(String orderCode, String expressType) {
|
|
|
LOGGER.info("queryExpressList orderCode is {}, expressTypeStr is {}", orderCode, expressType);
|
|
|
List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndType(orderCode, convertExpressType(expressType));
|
|
|
List<ExpressInfo> list = getExpressInfoListByStage(orderCode, expressType);
|
|
|
if(CollectionUtils.isEmpty(list)) {
|
|
|
return Lists.newArrayList();
|
|
|
}
|
...
|
...
|
@@ -621,6 +622,40 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
|
|
|
return respList;
|
|
|
}
|
|
|
|
|
|
private List<ExpressInfo> getExpressInfoListByStage(String orderCode, String expressType){
|
|
|
LOGGER.info("getExpressInfoListByStage orderCode is {}, expressTypeStr is {}", orderCode, expressType);
|
|
|
List<String> orderCodeList = Lists.newArrayList();
|
|
|
orderCodeList.add(orderCode);
|
|
|
List<ExpressRecord> records = expressRecordMapper.selectByOrderCodeListAndType(orderCodeList,convertExpressType(expressType));
|
|
|
if(CollectionUtils.isEmpty(records)) {
|
|
|
LOGGER.info("getExpressInfoListByStage records is empty , orderCode is {}, expressTypeStr is {}", orderCode, expressType);
|
|
|
return Lists.newArrayList();
|
|
|
}
|
|
|
|
|
|
ExpressRecord record = records.get(0);
|
|
|
LOGGER.info("getExpressInfoListByStage begin , orderCode = {} ,expressType = {}, expressRecord = {} ",orderCode,expressType,record);
|
|
|
String waybillCode = record.getWaybillCode();
|
|
|
Integer logisticsType = record.getLogisticsType();
|
|
|
|
|
|
//原来的情况,根据订单号直接查询物流,如果存在物流信息,则直接返回,否则有可能是多单一号
|
|
|
List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndType(orderCode, convertExpressType(expressType));
|
|
|
|
|
|
//有可能存在一个订单号,多个物流的情况,比如原来的物流填错了,修改了新的物流,只保留新的物流号的信息
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
list = list.stream().filter(info -> StringUtils.equals(waybillCode,info.getWaybillCode())).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(list)) {
|
|
|
LOGGER.info("getExpressInfoListByStage success have data in express info orderCode = {} ,expressType = {} ",orderCode,expressType);
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
LOGGER.info("getExpressInfoListByStage orderCode is {}, expressTypeStr is {},records size is {} ,records is {}", orderCode, expressType , records.size(),JSON.toJSONString(records));
|
|
|
|
|
|
List<ExpressInfo> expressInfoList = expressInfoMapper.selectExpressInfoListByWaybillCodeAndLogisticsType(waybillCode,logisticsType);
|
|
|
return expressInfoList;
|
|
|
}
|
|
|
|
|
|
public List<OrderOperateRecordResp> queryOperateRecordList(BuyerOrderReq req){
|
|
|
if(null == req.getOrderCode()) {
|
...
|
...
|
|