feat(REQ-3714): 获取角色后使用身份id做一次过滤

This commit is contained in:
zhanghonghao 2025-03-20 15:19:28 +08:00
parent 818247a5cd
commit 664d5694d2

View File

@ -261,8 +261,11 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
roleUserParam.setNeedRole(true);
roleUserParam.setPageSize(1000);
Set<Long> identityIds = nodeUsers.stream().map(NodeUserDTO::getIdentityId).collect(Collectors.toSet());
List<RoleUserResp> saasRoleUserInfo = roleUserGateway.pageAll(roleUserParam);
saasRoleUserInfo = saasRoleUserInfo.stream().filter(e -> Objects.nonNull(e.getRole())).collect(Collectors.toList());
saasRoleUserInfo = saasRoleUserInfo.stream().filter(e -> Objects.nonNull(e.getRole()))
.filter(e -> identityIds.contains(e.getIdentityId())).collect(Collectors.toList());
saasRoleUserInfo.forEach(e -> {
// 班组长不用校验因为班组长也会有管理员角色
if (teamLeadPersonSet.contains(e.getPersonId())) {