| | |
| | | |
| | | /** |
| | | * 根据角色获取功能集合数据 |
| | | * @param type 1:查区域 2:查场所 3:查房屋 |
| | | * @param type 1:查社区 2:查房屋和场所(居民角色) |
| | | * @param roleName |
| | | * @return |
| | | */ |
| | |
| | | // 查询区域数据,当前只有西市街道数据 |
| | | return townList; |
| | | } |
| | | // 如果是场所负责人 |
| | | if (type==2){ |
| | | // 查询场所集合信息 |
| | | list = placeService.selectPlaceNodeList(AuthUtil.getUserId()); |
| | | // 返回 |
| | | return list; |
| | | } |
| | | // 如果是居民 |
| | | if (type==3){ |
| | | if (type==2){ |
| | | return getInhabitantInfo(list); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取居民角色对应的房屋,场所信息 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | private Object getInhabitantInfo(List<TreeNode> list) { |
| | | // 查询房屋集合信息 |
| | | list = householdService.selectHouseNodeList(AuthUtil.getUserId()); |
| | | List<TreeNode> houseNodeList = householdService.selectHouseNodeList(AuthUtil.getUserId()); |
| | | // 查询场所集合信息 |
| | | List<TreeNode> placeNodeList = placeService.selectPlaceNodeList(AuthUtil.getUserId()); |
| | | if (houseNodeList.size()>0 && placeNodeList.size()>0){ |
| | | // 合并 |
| | | TreeNode houseNode = new TreeNode(); |
| | | houseNode.setName("房屋"); |
| | | houseNode.setId("1"); |
| | | houseNode.setHasChildren(true); |
| | | houseNode.setChildren(houseNodeList); |
| | | |
| | | TreeNode placeNode = new TreeNode(); |
| | | placeNode.setName("场所"); |
| | | placeNode.setId("2"); |
| | | placeNode.setHasChildren(true); |
| | | placeNode.setChildren(placeNodeList); |
| | | |
| | | list.add(houseNode); |
| | | list.add(placeNode); |
| | | // 返回 |
| | | return list; |
| | | } |
| | | if (houseNodeList.size()>0){ |
| | | list = houseNodeList; |
| | | } |
| | | if (placeNodeList.size()>0){ |
| | | list = placeNodeList; |
| | | } |
| | | // 返回 |
| | | return list; |
| | | } |
| | | |