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