Authored by qinchao

物流查看兼容:多订单一个物流号

... ... @@ -352,13 +352,6 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
* @return
*/
private List<ExpressInfo> getExpressInfoListByStage(Long orderCode, Integer expressType){
List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndExpressType(orderCode,expressType);
if(CollectionUtils.isNotEmpty(list)){
LOGGER.info("getExpressInfoListByStage success have data in express info ,orderCode = {} ,expressType = {} ",orderCode,expressType);
return list;
}
LOGGER.info("getExpressInfoListByStage begin query express record ,orderCode = {} ,expressType = {} ",orderCode,expressType);
ExpressRecord expressRecord = expressRecordMapper.selectByOrderCodeAndExpressType(orderCode,expressType);
if(expressRecord==null){
LOGGER.info("getExpressInfoListByStage out because of empty record ,orderCode = {} ,expressType = {} ",orderCode,expressType);
... ... @@ -366,6 +359,19 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
}
String waybillCode = expressRecord.getWaybillCode();
Integer logisticsType = expressRecord.getLogisticsType();
List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndExpressType(orderCode,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 begin , orderCode = {} ,expressType = {}, expressRecord = {} ",orderCode,expressType,expressRecord);
List<ExpressInfo> expressInfoList = expressInfoMapper.selectExpressInfoListByWaybillCodeAndLogisticsType(waybillCode,logisticsType);
return expressInfoList;
... ...