Browse Source

行政地区编码查询

dev_shibei_match
zxc 5 years ago
parent
commit
bb94ed8733
  1. 30
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

30
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -142,7 +142,9 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
* @date 2021/1/8 上午8:57
*/
public List<AreaCodeDictResultDTO> disposeTree(){
// 查询所有省市区
List<AreaCodeDTO> areaCodeDTOS = baseDao.selectAllArea();
// 查询所有街道、社区
List<AreaCodeChildDTO> areaCodeChildDTOS = childDao.selectAllChild();
List<AreaCodeDictResultDTO> result = new ArrayList<>();
List<AreaCodeDictResultDTO> fourResult = new ArrayList<>();
@ -224,7 +226,15 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
/**
* @Description 根据节点获取组织区域树遍历传参只能是 区级别
* @Description 根据节点获取组织区域树遍历传参只能是 区级别 暂时这样循环太多了
*
*
* 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样
* ==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==
* 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样
*
*
*
* @Param tree
* @Param rootAreaCode
* @author zxc
@ -253,6 +263,24 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
result.add(threeChild);
return result;
}
// 街道获取
if (!CollectionUtils.isEmpty(threeChild.getChildren())){
for (AreaCodeDictResultDTO fourChild : threeChild.getChildren()) {
if (rootAreaCode.equals(fourChild.getCode())){
result.add(fourChild);
return result;
}
// 社区获取
if (!CollectionUtils.isEmpty(fourChild.getChildren())){
for (AreaCodeDictResultDTO fiveChild : fourChild.getChildren()) {
if (rootAreaCode.equals(fiveChild.getCode())){
result.add(fiveChild);
return result;
}
}
}
}
}
}
}
}

Loading…
Cancel
Save