md
This commit is contained in:
parent
cbe647d008
commit
d773863b89
@ -103,6 +103,31 @@ public class EmisDestinationController extends EmisBaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取寄件网点
|
||||||
|
* @param province
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getSendSite")
|
||||||
|
@JacksonFilter(include= {
|
||||||
|
"id","destCode","destName","destNameEn",
|
||||||
|
"lineCode","lineName","countryName","country","siteCode","siteName",
|
||||||
|
},value= EmisDestination.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
|
||||||
|
public AjaxResult getSendSite(String country,String lineCode,String province,String city,String county,String address)
|
||||||
|
{
|
||||||
|
if(StringUtils.isAnyEmpty(province)){
|
||||||
|
return AjaxResult.error("参数错误,省份不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
EmisDestination dest = emisDestinationService.calcDestSite(country,lineCode,province,city,county,address);
|
||||||
|
if(dest==null){
|
||||||
|
return AjaxResult.error("联系客户,收件地不在服务范围!");
|
||||||
|
}else{
|
||||||
|
return AjaxResult.success("获取成功",dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出目的地列表
|
* 导出目的地列表
|
||||||
|
|||||||
@ -171,12 +171,13 @@ public class EmisBaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private EmisSettleSubBillFeeitemMapper emisSettleSubBillFeeitemMapper;
|
private EmisSettleSubBillFeeitemMapper emisSettleSubBillFeeitemMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmisCountryAreaMapper emisCountryAreaMapper;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
RedissonService redissonService;
|
RedissonService redissonService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断获取主单号
|
* 判断获取主单号
|
||||||
* @param billCode
|
* @param billCode
|
||||||
@ -436,6 +437,63 @@ public class EmisBaseService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算寄件网点
|
||||||
|
* @param country
|
||||||
|
* @param lineCode
|
||||||
|
* @param province
|
||||||
|
* @param city
|
||||||
|
* @param county
|
||||||
|
* @param address
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public EmisDestination calcSendSiteByBase(String country,String lineCode, String province, String city, String county, String address) {
|
||||||
|
|
||||||
|
EmisDestination destination=null;
|
||||||
|
// 获取 areaId
|
||||||
|
Long sendAreaId = null;
|
||||||
|
|
||||||
|
// 根据区获取
|
||||||
|
if(!StringUtils.isEmpty(county)) {
|
||||||
|
EmisRegion regionCounty = getRegionByCode(county);
|
||||||
|
if (regionCounty != null) {
|
||||||
|
sendAreaId = regionCounty.getSendAreaId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 根据城市获取
|
||||||
|
if( (sendAreaId==null || sendAreaId==0) && !StringUtils.isEmpty(city)) {
|
||||||
|
EmisRegion regionCity = getRegionByCode(city);
|
||||||
|
if (regionCity != null) {
|
||||||
|
sendAreaId = regionCity.getSendAreaId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据省获取
|
||||||
|
if((sendAreaId==null || sendAreaId==0) && !StringUtils.isEmpty(province)){
|
||||||
|
EmisRegion regionProvice= getRegionByCode(province);
|
||||||
|
if(regionProvice!=null){
|
||||||
|
sendAreaId=regionProvice.getSendAreaId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据大区获取服务网点
|
||||||
|
if(sendAreaId!=null && sendAreaId>0) {
|
||||||
|
EmisCountryArea emisCountryArea =emisCountryAreaMapper.selectEmisCountryAreaById(sendAreaId);
|
||||||
|
if(emisCountryArea!=null){
|
||||||
|
destination = new EmisDestination();
|
||||||
|
destination.setSiteCode(emisCountryArea.getSiteCode());
|
||||||
|
destination.setSiteName(emisCountryArea.getSiteName());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return destination;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据国家或片区ID 获取目的地
|
* 根据国家或片区ID 获取目的地
|
||||||
* @param countryCode
|
* @param countryCode
|
||||||
|
|||||||
@ -47,6 +47,20 @@ public interface IEmisDestinationService
|
|||||||
*/
|
*/
|
||||||
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);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据发件信息获取寄件网点
|
||||||
|
*
|
||||||
|
* @param country
|
||||||
|
* @param lineCode
|
||||||
|
* @param province
|
||||||
|
* @param city
|
||||||
|
* @param county
|
||||||
|
* @param address
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public EmisDestination calcSendSite(String country,String lineCode,String province,String city,String county,String address);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增目的地
|
* 新增目的地
|
||||||
*
|
*
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import com.xdadan.erp.common.core.domain.entity.SysTenant;
|
|||||||
import com.xdadan.erp.emis.domain.EmisRegion;
|
import com.xdadan.erp.emis.domain.EmisRegion;
|
||||||
import com.xdadan.erp.emis.mapper.EmisRegionMapper;
|
import com.xdadan.erp.emis.mapper.EmisRegionMapper;
|
||||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.xdadan.erp.emis.domain.EmisDestination;
|
import com.xdadan.erp.emis.domain.EmisDestination;
|
||||||
@ -76,6 +77,24 @@ public class EmisDestinationServiceImpl extends EmisBaseService implements IEmis
|
|||||||
return calcDestSiteByBase(country,lineCode,province,city,county,address);
|
return calcDestSiteByBase(country,lineCode,province,city,county,address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算寄件网点
|
||||||
|
* @param lineCode
|
||||||
|
* @param province
|
||||||
|
* @param city
|
||||||
|
* @param county
|
||||||
|
* @param address
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EmisDestination calcSendSite(String country,String lineCode, String province, String city, String county, String address) {
|
||||||
|
return calcSendSiteByBase(country,lineCode,province,city,county,address);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增目的地
|
* 新增目的地
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user