| | |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.getPoliceTreeList()); |
| | | } |
| | | } |
| | | if (region.getDeptNature()==2){ |
| | | region.setCityCode("361100"); |
| | | } |
| | | // 非公安 |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.getTreeList(region,regionChildCodesList,isAdministrator)); |
| | | } |
| | |
| | | list.addAll(policeList); |
| | | } |
| | | // 查询综治区域集合 |
| | | List<Region> regionChildList = baseMapper.getRegionChildList(regionCode); |
| | | List<Region> regionChildList = baseMapper.getRegionChildList(regionCode,null,null); |
| | | list.addAll(regionChildList); |
| | | // 返回 |
| | | return list; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取综治下级区域 |
| | | * @param regionCode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Region> getGridRegionChild(String regionCode, String communityCode, String roleName) { |
| | | // 创建区域对象 |
| | | List<Region> list = new ArrayList<>(); |
| | | if (!Strings.isBlank(roleName) && roleName.equals("wgy")){ |
| | | // 查询综治区域集合 |
| | | List<Region> regionChildList = baseMapper.getGridRegionChildList(regionCode); |
| | | list.addAll(regionChildList); |
| | | }else if (!Strings.isBlank(roleName) && roleName.equals("mj")){ |
| | | // 查询公安相关的区域数据 |
| | | List<Region> regionList = baseMapper.getPoliceList(communityCode); |
| | | if (regionList.size()>0) { |
| | | List<Region> policeList = treeRegionList(regionList,regionCode, list); |
| | | list.addAll(policeList); |
| | | } |
| | | }else { |
| | | // 查询综治区域集合 |
| | | List<Region> regionChildList = baseMapper.getRegionChildList(regionCode, communityCode, roleName); |
| | | list.addAll(regionChildList); |
| | | } |
| | | // 返回 |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取某个父节点下面的所有子节点 |
| | | * @param regionList |
| | | * @param parentCode |
| | |
| | | //递归遍历下一级 |
| | | treeRegionList(regionList,region.getCode(),list); |
| | | } |
| | | if(region.getCode().equals(parentCode)){ |
| | | // 本身也加入 |
| | | list.add(region); |
| | | } |
| | | } |
| | | return list; |
| | | } |