This commit is contained in:
luke 2025-06-12 17:43:27 +08:00
parent 78f4c659ad
commit 089da5da2a

View File

@ -86,7 +86,7 @@ public class UserAppServiceImpl implements UserAppService {
// userId ---> role详情 // userId ---> role详情
Map<Long, List<RoleDO>> userRolesMap = allUserIds.stream().collect(Collectors.toMap(userId -> userId, userId -> { Map<Long, List<RoleDO>> userRolesMap = allUserIds.stream().collect(Collectors.toMap(userId -> userId, userId -> {
List<Long> roleIds = Optional.ofNullable(userRolesRelationMap.get(userId)).orElse(Lists.newArrayList()).stream() List<Long> roleIds = Optional.ofNullable(userRolesRelationMap.get(userId)).orElse(Lists.newArrayList()).stream()
.map(UserRoleDO::getId).collect(Collectors.toList()); .map(UserRoleDO::getRoleId).collect(Collectors.toList());
return roleIds.stream().map(roleId -> roleMap.get(roleId)).collect(Collectors.toList()); return roleIds.stream().map(roleId -> roleMap.get(roleId)).collect(Collectors.toList());
})); }));
return Optional.ofNullable(allUsers).orElse(Lists.newArrayList()).stream() return Optional.ofNullable(allUsers).orElse(Lists.newArrayList()).stream()