| | |
| | | public List<Long> getScopeOfAuthorityUserId() { |
| | | List<Long> userIds = new ArrayList<>(); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | SysUser user = this.getById(userId); |
| | | SysUser user = this.baseMapper.selectUserById(userId); |
| | | String dataScope = user.getDataScope(); |
| | | //没有配置默认查询自己 |
| | | if(!SecurityUtils.isAdmin(userId) && StringUtils.isEmpty(dataScope)){ |
| | |
| | | } |
| | | //管理员或者全部权限 |
| | | if(SecurityUtils.isAdmin(userId) || (StringUtils.isNotEmpty(dataScope) && "1".equals(dataScope))){ |
| | | List<SysUser> list = this.list(new QueryWrapper<SysUser>().eq("user_type", "00").eq("status", 0).eq("del_flag", 0)); |
| | | userIds.addAll(list.stream().map(SysUser::getUserId).collect(Collectors.toList())); |
| | | return null; |
| | | } |
| | | //部分权限 |
| | | if(StringUtils.isNotEmpty(dataScope) && "3".equals(dataScope)){ |
| | | List<SysUser> list = this.list(new QueryWrapper<SysUser>().eq("user_type", "00").eq("status", 0) |
| | | .eq("del_flag", 0).eq("dept_id", user.getDeptId())); |
| | | SysUser user1 = new SysUser(); |
| | | user1.setUserType("00"); |
| | | user1.setStatus("0"); |
| | | user1.setDeptId(user.getDeptId()); |
| | | List<SysUser> list = this.baseMapper.selectUserList(user1); |
| | | userIds.addAll(list.stream().map(SysUser::getUserId).collect(Collectors.toList())); |
| | | } |
| | | //个人权限 |