|
|
@ -36,10 +36,7 @@ import com.epmet.dao.AreaCodeChildDao; |
|
|
|
import com.epmet.dao.AreaCodeDao; |
|
|
|
import com.epmet.dto.AreaCodeChildDTO; |
|
|
|
import com.epmet.dto.AreaCodeDTO; |
|
|
|
import com.epmet.dto.form.AddAreaCodeDictFormDTO; |
|
|
|
import com.epmet.dto.form.AddAreaCodeFormDTO; |
|
|
|
import com.epmet.dto.form.AreaCodeDictFormDTO; |
|
|
|
import com.epmet.dto.form.AreaCodeFormDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.AreaCodeDictResultDTO; |
|
|
|
import com.epmet.dto.result.AreaCodeResultDTO; |
|
|
|
import com.epmet.entity.AreaCodeEntity; |
|
|
@ -72,6 +69,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
private AreaCodeChildDao childDao; |
|
|
|
@Autowired |
|
|
|
private AreaCodeChildService areaCodeChildService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<AreaCodeDTO> page(Map<String, Object> params) { |
|
|
|
IPage<AreaCodeEntity> page = baseDao.selectPage( |
|
|
@ -240,14 +238,11 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 根据节点获取组织区域树【遍历】,传参只能是 省,市,区级别 【暂时这样,循环太多了】 |
|
|
|
* |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样 |
|
|
|
* ==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样== |
|
|
|
* 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样 |
|
|
|
* |
|
|
|
* |
|
|
|
* |
|
|
|
* @Param tree |
|
|
|
* @Param rootAreaCode |
|
|
|
* @author zxc |
|
|
@ -734,6 +729,48 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public AreaCodeResultDTO getAreaCodeDetail(AreaCodeDetailFormDTO formDTO) { |
|
|
|
AreaCodeResultDTO result = new AreaCodeResultDTO(); |
|
|
|
switch (formDTO.getLevel()) { |
|
|
|
case AreaCodeConstant.PROVINCE: |
|
|
|
AreaCodeDTO province = baseDao.selectByProvinceCode(formDTO.getAreaCode()); |
|
|
|
if (province != null) { |
|
|
|
result.setAreaName(province.getProvinceName()); |
|
|
|
result.setAreaCode(province.getProvinceCode()); |
|
|
|
result.setParentCode(NumConstant.ZERO_STR); |
|
|
|
result.setLevel(AreaCodeConstant.PROVINCE); |
|
|
|
} |
|
|
|
break; |
|
|
|
case AreaCodeConstant.CITY: |
|
|
|
AreaCodeDTO city = baseDao.selectByCityCode(formDTO.getAreaCode()); |
|
|
|
if (city != null) { |
|
|
|
result.setAreaName(city.getCityName()); |
|
|
|
result.setAreaCode(city.getCityName()); |
|
|
|
result.setParentCode(city.getProvinceCode()); |
|
|
|
result.setLevel(AreaCodeConstant.CITY); |
|
|
|
} |
|
|
|
break; |
|
|
|
case AreaCodeConstant.DISTRICT: |
|
|
|
AreaCodeDTO county = baseDao.selectByCountyCode(formDTO.getAreaCode()); |
|
|
|
if (county != null) { |
|
|
|
result.setAreaName(county.getCountyName()); |
|
|
|
result.setAreaCode(county.getCountyCode()); |
|
|
|
result.setParentCode(county.getCityCode()); |
|
|
|
result.setLevel(AreaCodeConstant.DISTRICT); |
|
|
|
} |
|
|
|
break; |
|
|
|
case AreaCodeConstant.STREET: |
|
|
|
result = baseDao.selectByStreetCode(formDTO.getAreaCode()); |
|
|
|
break; |
|
|
|
case AreaCodeConstant.COMMUNITY: |
|
|
|
result = baseDao.selectByCommunityCode(formDTO.getAreaCode()); |
|
|
|
break; |
|
|
|
default: |
|
|
|
log.warn("Level错误:" + formDTO.getLevel()); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private String addDistrictAreaCode(String cityCode, String countyName) { |
|
|
|
AreaCodeDTO city = baseDao.selectByCityCode(cityCode); |
|
|
|