This commit is contained in:
linfso 2024-04-28 10:15:18 +08:00
parent 0ad94654c0
commit 6c366d94c0

View File

@ -89,31 +89,44 @@ public class EmisDestinationServiceImpl implements IEmisDestinationService
queryWrapper.isNotNull("area_id"); queryWrapper.isNotNull("area_id");
queryWrapper.last("limit 1"); queryWrapper.last("limit 1");
regionList=emisRegionMapper.selectList(queryWrapper); regionList=emisRegionMapper.selectList(queryWrapper);
if(!CollectionUtil.isEmpty(regionList)){
if(CollectionUtil.isEmpty(regionList)){ areaId = regionList.get(0).getAreaId();
return null;
} }
} }
areaId = regionList.get(0).getAreaId();
if(areaId == null){
return null;
}
// 查询目的地,优先根据区域查询,如果查询不到则按线路查询 EmisDestination queryEmisDestination=null;
EmisDestination queryEmisDestination = new EmisDestination(); List<EmisDestination> destinationList=null;
queryEmisDestination.setLineCode(lineCode); if(areaId != null && areaId> 0 ){
queryEmisDestination.setCountryAreaId(areaId); // 查询目的地,优先根据区域查询,如果查询不到则按线路查询
List<EmisDestination> destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination); queryEmisDestination = new EmisDestination();
if(CollectionUtil.isEmpty(destinationList)){ queryEmisDestination.setLineCode(lineCode);
// 目的地区域位配置,按线路查询 queryEmisDestination.setCountryAreaId(areaId);
queryEmisDestination.setCountryAreaId(null);
destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination); destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
if(CollectionUtil.isEmpty(destinationList)){ if(!CollectionUtil.isEmpty(destinationList)){
return null; return destinationList.get(0);
}
else{
// 根据国家查询
queryEmisDestination = new EmisDestination();
queryEmisDestination.setCountry(country);
destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
if(!CollectionUtil.isEmpty(destinationList)){
return destinationList.get(0);
}
}
}else{
// 根据国家查询
queryEmisDestination = new EmisDestination();
queryEmisDestination.setCountry(country);
destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
if(!CollectionUtil.isEmpty(destinationList)){
return destinationList.get(0);
} }
} }
return destinationList.get(0); return null;
} }
/** /**