@@ -35,4 +35,7 @@ public class UserPageReqVO extends PageParam {
|
||||
@Schema(description = "部门编号,同时筛选子部门", example = "1024")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "角色编号", example = "1024")
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
|
@@ -25,13 +25,14 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
return selectOne(AdminUserDO::getMobile, mobile);
|
||||
}
|
||||
|
||||
default PageResult<AdminUserDO> selectPage(UserPageReqVO reqVO, Collection<Long> deptIds) {
|
||||
default PageResult<AdminUserDO> selectPage(UserPageReqVO reqVO, Collection<Long> deptIds, Collection<Long> userIds) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AdminUserDO>()
|
||||
.likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername())
|
||||
.likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile())
|
||||
.eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime())
|
||||
.inIfPresent(AdminUserDO::getDeptId, deptIds)
|
||||
.inIfPresent(AdminUserDO::getId, userIds)
|
||||
.orderByDesc(AdminUserDO::getId));
|
||||
}
|
||||
|
||||
|
@@ -46,8 +46,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.LogRecordConstants.*;
|
||||
|
||||
@@ -272,7 +271,12 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
|
||||
@Override
|
||||
public PageResult<AdminUserDO> getUserPage(UserPageReqVO reqVO) {
|
||||
return userMapper.selectPage(reqVO, getDeptCondition(reqVO.getDeptId()));
|
||||
// 如果有角色编号,查询角色对应的用户编号
|
||||
Set<Long> userIds = reqVO.getRoleId() != null ?
|
||||
permissionService.getUserRoleIdListByRoleId(singleton(reqVO.getRoleId())) : null;
|
||||
|
||||
// 分页查询
|
||||
return userMapper.selectPage(reqVO, getDeptCondition(reqVO.getDeptId()), userIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user