md
This commit is contained in:
parent
fdbc10dcb9
commit
272a8b4c65
@ -90,7 +90,7 @@ public class EmisDestinationController extends BaseController
|
||||
{
|
||||
// lineCode,
|
||||
if(StringUtils.isAnyEmpty(province)){
|
||||
return AjaxResult.error("参数错误,线路和省份不能为空!");
|
||||
return AjaxResult.error("参数错误,省份不能为空!");
|
||||
}
|
||||
|
||||
EmisDestination dest = emisDestinationService.calcDestSite(country,lineCode,province,city,county,address);
|
||||
|
||||
@ -73,39 +73,21 @@ public class EmisDestinationServiceImpl implements IEmisDestinationService
|
||||
@Override
|
||||
public EmisDestination calcDestSite(String country,String lineCode, String province, String city, String county, String address) {
|
||||
|
||||
// 如果省份不存在,则取目的国的地一个字段
|
||||
// 目前只根据目的省份获取目的地
|
||||
|
||||
// 获取 areaId
|
||||
Long areaId = null;
|
||||
EmisRegion queryEmisRegion = new EmisRegion();
|
||||
queryEmisRegion.setRegionCode(province);
|
||||
List<EmisRegion> regionList= emisRegionMapper.selectEmisRegionList(queryEmisRegion);
|
||||
if(CollectionUtil.isEmpty(regionList)){
|
||||
if(!CollectionUtil.isEmpty(regionList)){
|
||||
areaId = regionList.get(0).getAreaId();
|
||||
country = regionList.get(0).getCountryCode();
|
||||
|
||||
// 如果身份按国家获取第一个区域
|
||||
queryEmisRegion = new EmisRegion();
|
||||
// 按省份获取区域
|
||||
queryEmisRegion.setRegionType(1);
|
||||
queryEmisRegion.setCountryCode(country);
|
||||
regionList= emisRegionMapper.selectEmisRegionList(queryEmisRegion);
|
||||
if(!CollectionUtil.isEmpty(regionList)){
|
||||
for (EmisRegion emisRegion:regionList) {
|
||||
if(emisRegion.getAreaId()!=null){
|
||||
areaId = emisRegion.getAreaId();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
EmisDestination queryEmisDestination=null;
|
||||
List<EmisDestination> destinationList=null;
|
||||
if(areaId != null && areaId> 0 ){
|
||||
// 查询目的地,优先根据区域查询,如果查询不到则按线路查询
|
||||
queryEmisDestination = new EmisDestination();
|
||||
// queryEmisDestination.setLineCode(lineCode);
|
||||
// 根据大区获取目的网点
|
||||
EmisDestination queryEmisDestination = new EmisDestination();
|
||||
queryEmisDestination.setCountryAreaId(areaId);
|
||||
destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
|
||||
List<EmisDestination> destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
|
||||
if(!CollectionUtil.isEmpty(destinationList)){
|
||||
return destinationList.get(0);
|
||||
}
|
||||
@ -119,16 +101,9 @@ public class EmisDestinationServiceImpl implements IEmisDestinationService
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
// 根据国家查询
|
||||
queryEmisDestination = new EmisDestination();
|
||||
queryEmisDestination.setCountry(country);
|
||||
destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
|
||||
if(!CollectionUtil.isEmpty(destinationList)){
|
||||
return destinationList.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user