| | |
| | | List<TreeStringNode> list = new ArrayList<>(); |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // 如果是网格管理员,系统管理员,民警,无诈场所采集 |
| | | if (roleName.equals("admin") || |
| | | roleName.equals("wzcj") || |
| | | roleName.equals("wgy") || |
| | | roleName.equals("mj")) |
| | | { |
| | | houseParam.setRoleName(roleName); |
| | | if ((roleName.equals("wgy") || roleName.equals("wzcj")) |
| | | && !userId.equals("1726859808689696770")) { |
| | | // 查询对应的网格code |
| | | if (!Strings.isBlank(roleName)) { |
| | | // 如果是网格管理员,系统管理员,民警,无诈场所采集 |
| | | if (roleName.equals("admin") || |
| | | roleName.equals("wzcj") || |
| | | roleName.equals("wgy") || |
| | | roleName.equals("mj")) { |
| | | houseParam.setRoleName(roleName); |
| | | if ((roleName.equals("wgy") || roleName.equals("wzcj")) |
| | | && !userId.equals("1726859808689696770")) { |
| | | // 查询对应的网格code |
| | | // stringList = gridService.getGridListByUserId(AuthUtil.getUserId()); |
| | | stringList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,roleName); |
| | | } |
| | | if (roleName.equals("mj")) { |
| | | // 查询对应的社区编号 |
| | | communityList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(),null,roleName); |
| | | } |
| | | // 查询街道 |
| | | List<TreeStringNode> townList = baseMapper.getRegionListByGroupTwon(houseParam, stringList, communityList); |
| | | // 查询社区 |
| | | List<TreeStringNode> neiList = baseMapper.getRegionListByGroupNei(houseParam, stringList, communityList); |
| | | // 遍历 |
| | | for (TreeStringNode treeNode : townList) { |
| | | stringList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(), null, roleName); |
| | | } |
| | | if (roleName.equals("mj")) { |
| | | // 查询对应的社区编号 |
| | | communityList = SysCache.getGridRegionChildCodesByDeptId(AuthUtil.getDeptId(), null, roleName); |
| | | } |
| | | // 查询街道 |
| | | List<TreeStringNode> townList = baseMapper.getRegionListByGroupTwon(houseParam, stringList, communityList); |
| | | // 查询社区 |
| | | List<TreeStringNode> neiList = baseMapper.getRegionListByGroupNei(houseParam, stringList, communityList); |
| | | // 遍历 |
| | | for (TreeStringNode node : neiList) { |
| | | if (treeNode.getId().equals(node.getParentId())) { |
| | | node.setHasChildren(false); |
| | | treeNode.getChildren().add(node); |
| | | for (TreeStringNode treeNode : townList) { |
| | | // 遍历 |
| | | for (TreeStringNode node : neiList) { |
| | | if (treeNode.getId().equals(node.getParentId())) { |
| | | node.setHasChildren(false); |
| | | treeNode.getChildren().add(node); |
| | | } |
| | | } |
| | | } |
| | | // 查询区域数据 |
| | | return townList; |
| | | } |
| | | // 查询区域数据 |
| | | return townList; |
| | | } |
| | | // 如果是居民 |
| | | if (roleName.equals("inhabitant")) { |
| | | return getInhabitantInfo(list); |
| | | // 如果是居民 |
| | | if (roleName.equals("inhabitant")) { |
| | | return getInhabitantInfo(list); |
| | | } |
| | | } |
| | | return list; |
| | | } |