| | |
| | | Page<SysUser> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<SysUser> list = baseMapper.findList(page, params); |
| | | long total = page.getTotal(); |
| | | if (total > 0) { |
| | | if (total > 0&&list.size()>0) { |
| | | List<Long> userIds = list.stream().map(SysUser::getId).collect(Collectors.toList()); |
| | | |
| | | if (userIds.size()>0) { |
| | | List<SysRole> sysRoles = roleUserService.findRolesByUserIds(userIds); |
| | | |
| | | // Map<String, Object> map = new HashMap<String, Object>(); |
| | | // List<SysOrganization> sysOrganizationList=organizationService.fin(); |
| | | list.forEach(u -> u.setRoles(sysRoles.stream().filter(r -> !ObjectUtils.notEqual(u.getId(), r.getUserId())) |
| | | .collect(Collectors.toList()))); |
| | | } |
| | | } |
| | | return PageResult.<SysUser>builder().data(list).code(0).count(total).build(); |
| | | } |
| | | |