refactor(系统设置): 组织用户组查询成员列表排除已删除的用户

This commit is contained in:
song-cc-rock 2023-08-29 10:51:03 +08:00 committed by fit2-zhao
parent a49eca779d
commit c4e14dc24e
3 changed files with 9 additions and 7 deletions

View File

@ -98,13 +98,13 @@ public class OrganizationUserRoleService extends BaseUserRoleService {
User user = userMap.get(k);
if (user != null) {
BeanUtils.copyBean(userExtend, user);
v.forEach(roleItem -> {
if (StringUtils.equals(roleItem, roleId)) {
userExtend.setCheckRoleFlag(true);
}
});
userExtends.add(userExtend);
}
v.forEach(roleItem -> {
if (StringUtils.equals(roleItem, roleId)) {
userExtend.setCheckRoleFlag(true);
}
});
userExtends.add(userExtend);
});
}
return userExtends;

View File

@ -86,7 +86,7 @@ public class OrganizationUserRoleControllerTests extends BaseTest {
OrganizationUserRoleEditRequest request = new OrganizationUserRoleEditRequest();
request.setName("default-org-role-5");
request.setScopeId("default-organization-2");
MvcResult addResult = this.responsePost(ORGANIZATION_USER_ROLE_ADD, request);
this.requestPost(ORGANIZATION_USER_ROLE_ADD, request);
// 验证是否添加成功
String organizationId = "default-organization-2";
MvcResult mvcResult = this.responseGet(ORGANIZATION_USER_ROLE_LIST + "/" + organizationId);

View File

@ -13,5 +13,7 @@ INSERT INTO user_role_permission (id, role_id, permission_id) VALUE
(uuid(), 'default-org-role-id-3', 'ORGANIZATION_USER_ROLE:READ');
INSERT INTO user_role_relation (id, user_id, role_id, source_id, create_time, create_user) VALUE
(UUID(), 'default-admin-user', 'default-org-role-id-3', 'default-organization-2', UNIX_TIMESTAMP() * 1000, 'admin');
INSERT INTO user_role_relation (id, user_id, role_id, source_id, create_time, create_user) VALUE
(UUID(), 'default-admin-user', 'default-org-role-id-4', 'default-organization-2', UNIX_TIMESTAMP() * 1000, 'admin');
INSERT INTO user_role_relation (id, user_id, role_id, source_id, create_time, create_user) VALUE
(UUID(), 'default-admin-user-x', 'default-org-role-id-4', 'default-organization-2', UNIX_TIMESTAMP() * 1000, 'admin');