| | |
| | | |
| | | @Override |
| | | public List<DeptVO> tree(String tenantId) { |
| | | Long parentId = null; |
| | | Long id = null; |
| | | // 判断数据权限控制,非超管角色只可看到本级及以下数据 |
| | | // if (!AuthUtil.isAdministrator()) { |
| | | // Long deptId = Func.firstLong(AuthUtil.getDeptId()); |
| | | // Dept dept = SysCache.getDept(deptId); |
| | | // if (dept.getParentId() != 0) { |
| | | // parentId = dept.getParentId(); |
| | | // } |
| | | // List<DeptVO> merge = ForestNodeMerger.merge(baseMapper.tree(tenantId, parentId)); |
| | | // List<DeptVO> copy = BeanUtil.copy(merge, DeptVO.class); |
| | | // copy = copy.stream().filter(item -> AuthUtil.getDeptId().contains(item.getId().toString())).collect(Collectors.toList()); |
| | | // return copy; |
| | | // } |
| | | String userRole = AuthUtil.getUserRole(); |
| | | // 判断物业公司 |
| | | if (userRole.contains("wygly") || userRole.contains("wyxmjl")) { |
| | | // 获取当前用户的机构 |
| | | if (!AuthUtil.isAdmin()) { |
| | | id = Func.firstLong(AuthUtil.getDeptId()); |
| | | } |
| | | |
| | | return ForestNodeMerger.merge(baseMapper.tree(tenantId, parentId, id)); |
| | | List<DeptVO> tree = baseMapper.tree(tenantId, id); |
| | | return ForestNodeMerger.merge(tree); |
| | | } |
| | | |
| | | @Override |
| | |
| | | // parentId = dept.getParentId(); |
| | | // } |
| | | // } |
| | | if (Func.toLong(parentId) == 0L && !AuthUtil.isAdministrator()) { |
| | | if (Func.toLong(parentId) == 0L && !AuthUtil.isAdmin()) { |
| | | Long deptId = Func.firstLong(AuthUtil.getDeptId()); |
| | | Dept dept = SysCache.getDept(deptId); |
| | | if (dept.getParentId() != 0) { |