| | |
| | | |
| | | @Override |
| | | public List<DeptVO> tree(String tenantId) { |
| | | Long id = 0L; |
| | | Long id = null; |
| | | // 判断数据权限控制,非超管角色只可看到本级及以下数据 |
| | | if (!AuthUtil.isAdmin()) { |
| | | id = Func.firstLong(AuthUtil.getDeptId()); |
| | | } |
| | | List<DeptVO> tree = baseMapper.tree(tenantId, id); |
| | | if (AuthUtil.isAdmin()) { |
| | | for (DeptVO deptVO : tree) { |
| | | deptVO.setDisabled(false); |
| | | } |
| | | } |
| | | return ForestNodeMerger.merge(tree); |
| | | } |
| | | |
| | |
| | | // 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) { |