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.last("limit 1");
regionList=emisRegionMapper.selectList(queryWrapper);
if(CollectionUtil.isEmpty(regionList)){
return null;
if(!CollectionUtil.isEmpty(regionList)){
areaId = regionList.get(0).getAreaId();
}
}
areaId = regionList.get(0).getAreaId();
if(areaId == null){
return null;
}
// 查询目的地,优先根据区域查询,如果查询不到则按线路查询
EmisDestination queryEmisDestination = new EmisDestination();
queryEmisDestination.setLineCode(lineCode);
queryEmisDestination.setCountryAreaId(areaId);
List<EmisDestination> destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
if(CollectionUtil.isEmpty(destinationList)){
// 目的地区域位配置,按线路查询
queryEmisDestination.setCountryAreaId(null);
EmisDestination queryEmisDestination=null;
List<EmisDestination> destinationList=null;
if(areaId != null && areaId> 0 ){
// 查询目的地,优先根据区域查询,如果查询不到则按线路查询
queryEmisDestination = new EmisDestination();
queryEmisDestination.setLineCode(lineCode);
queryEmisDestination.setCountryAreaId(areaId);
destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
if(CollectionUtil.isEmpty(destinationList)){
return null;
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);
}
}
}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;
}
/**