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