mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-11 16:57:12 +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;
|
private List<Long> userIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不包含的用户 ID 列表
|
* 角色 ID
|
||||||
|
* <p>用于在角色授权用户时,过滤掉已经分配给该角色的用户</p>
|
||||||
*/
|
*/
|
||||||
@Schema(description = "不包含的用户 ID 列表", example = "[1,2]")
|
@Schema(description = "角色 ID", example = "1")
|
||||||
private List<Long> excludeUserIds;
|
private Long roleId;
|
||||||
}
|
}
|
||||||
|
@@ -488,7 +488,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
|
|||||||
List<Date> createTimeList = query.getCreateTime();
|
List<Date> createTimeList = query.getCreateTime();
|
||||||
Long deptId = query.getDeptId();
|
Long deptId = query.getDeptId();
|
||||||
List<Long> userIdList = query.getUserIds();
|
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)
|
return new QueryWrapper<UserDO>().and(StrUtil.isNotBlank(description), q -> q.like("t1.username", description)
|
||||||
.or()
|
.or()
|
||||||
.like("t1.nickname", description)
|
.like("t1.nickname", description)
|
||||||
|
Reference in New Issue
Block a user