Merge pull request #3749 from dataease/pr@dev@perf_user_grid

perf: 查询用户列表过滤废弃角色
This commit is contained in:
xuwei-fit2cloud 2022-11-15 13:01:35 +08:00 committed by GitHub
commit f86d0c729c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ public class SysUserService {
List<SysUserGridResponse> lists = extSysUserMapper.query(gridExample);
lists.forEach(item -> {
List<SysUserRole> roles = item.getRoles();
List<Long> roleIds = roles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
List<Long> roleIds = roles.stream().filter(ObjectUtils::isNotEmpty).map(SysUserRole::getRoleId).collect(Collectors.toList());
item.setRoleIds(roleIds);
});
return lists;