| | |
| | | @Override |
| | | public List<DeptVO> tree(String tenantId) { |
| | | Long parentId = null; |
| | | Long id = null; |
| | | // 判断数据权限控制,非超管角色只可看到本级及以下数据 |
| | | // if (!AuthUtil.isAdministrator()) { |
| | | // Long deptId = Func.firstLong(AuthUtil.getDeptId()); |
| | |
| | | // 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")) { |
| | | // 获取当前用户的机构 |
| | | id = Func.firstLong(AuthUtil.getDeptId()); |
| | | } |
| | | |
| | | return ForestNodeMerger.merge(baseMapper.tree(tenantId, parentId)); |
| | | return ForestNodeMerger.merge(baseMapper.tree(tenantId, parentId, id)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<DeptVO> deptVOS = baseMapper.getGridDeptAndParentList(); |
| | | //遍历处理 |
| | | for (DeptVO deptVO : deptVOS) { |
| | | GridEntity gridEntity = SpringUtils.getBean(IGridService.class).getGridByNames(deptVO.getDeptName(),deptVO.getParentName()); |
| | | if (null!=gridEntity){ |
| | | GridEntity gridEntity = SpringUtils.getBean(IGridService.class).getGridByNames(deptVO.getDeptName(), deptVO.getParentName()); |
| | | if (null != gridEntity) { |
| | | deptVO.setRegionCode(gridEntity.getGridCode()); |
| | | // 更新 |
| | | updateById(deptVO); |