md
This commit is contained in:
parent
147212ecc1
commit
0b5024f5f3
@ -393,41 +393,47 @@ public class EmisBaseService {
|
||||
*/
|
||||
public EmisDestination calcDestSiteByBase(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)){
|
||||
areaId = regionList.get(0).getAreaId();
|
||||
country = regionList.get(0).getCountryCode();
|
||||
|
||||
// 根据大区获取目的网点
|
||||
EmisDestination queryEmisDestination = new EmisDestination();
|
||||
queryEmisDestination.setCountryAreaId(areaId);
|
||||
// 根据城市获取目的地
|
||||
EmisRegion regionCity= getRegionByCode(city);
|
||||
if(regionCity!=null){
|
||||
areaId=regionCity.getAreaId();
|
||||
}
|
||||
|
||||
// 根据城市获取目的地
|
||||
if(areaId==null){
|
||||
EmisRegion regionProvice= getRegionByCode(province);
|
||||
if(regionProvice!=null){
|
||||
areaId=regionProvice.getAreaId();
|
||||
}
|
||||
}
|
||||
|
||||
return getDestByCountryOrAreaId(country,areaId);
|
||||
|
||||
}
|
||||
|
||||
public EmisDestination getDestByCountryOrAreaId(String countryCode,Long areaId){
|
||||
// 根据大区获取目的网点
|
||||
EmisDestination queryEmisDestination = new EmisDestination();
|
||||
queryEmisDestination.setCountryAreaId(areaId);
|
||||
queryEmisDestination.setStatus(1);
|
||||
List<EmisDestination> destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
|
||||
if(!CollectionUtil.isEmpty(destinationList)){
|
||||
return destinationList.get(0);
|
||||
}
|
||||
else{
|
||||
// 根据国家查询
|
||||
queryEmisDestination = new EmisDestination();
|
||||
queryEmisDestination.setCountry(countryCode);
|
||||
queryEmisDestination.setStatus(1);
|
||||
List<EmisDestination> destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
|
||||
destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
|
||||
if(!CollectionUtil.isEmpty(destinationList)){
|
||||
return destinationList.get(0);
|
||||
}
|
||||
else{
|
||||
// 根据国家查询
|
||||
queryEmisDestination = new EmisDestination();
|
||||
queryEmisDestination.setCountry(country);
|
||||
queryEmisDestination.setStatus(1);
|
||||
destinationList=emisDestinationMapper.selectEmisDestinationList(queryEmisDestination);
|
||||
if(!CollectionUtil.isEmpty(destinationList)){
|
||||
return destinationList.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user