mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-10 07:02:47 +08:00
refactor(system/user): 分页列表调整排除用户 ID 列表参数为 roleId,改为后端根据 roleId 查询
This commit is contained in:
@@ -74,8 +74,9 @@ public class UserQuery implements Serializable {
|
||||
private List<Long> userIds;
|
||||
|
||||
/**
|
||||
* 不包含的用户 ID 列表
|
||||
* 角色 ID
|
||||
* <p>用于在角色授权用户时,过滤掉已经分配给该角色的用户</p>
|
||||
*/
|
||||
@Schema(description = "不包含的用户 ID 列表", example = "[1,2]")
|
||||
private List<Long> excludeUserIds;
|
||||
@Schema(description = "角色 ID", example = "1")
|
||||
private Long roleId;
|
||||
}
|
||||
|
@@ -488,7 +488,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
|
||||
List<Date> createTimeList = query.getCreateTime();
|
||||
Long deptId = query.getDeptId();
|
||||
List<Long> userIdList = query.getUserIds();
|
||||
List<Long> excludeUserIdList = query.getExcludeUserIds();
|
||||
// 获取排除用户 ID 列表
|
||||
List<Long> excludeUserIdList = null;
|
||||
if (null != query.getRoleId()) {
|
||||
excludeUserIdList = userRoleService.listUserIdByRoleId(query.getRoleId());
|
||||
}
|
||||
return new QueryWrapper<UserDO>().and(StrUtil.isNotBlank(description), q -> q.like("t1.username", description)
|
||||
.or()
|
||||
.like("t1.nickname", description)
|
||||
|
Reference in New Issue
Block a user