fix:分页查询用户列表(包括部门角色)

This commit is contained in:
2026-04-13 10:11:10 +08:00
parent 5edb860190
commit 4c734fd803
3 changed files with 31 additions and 0 deletions

View File

@@ -137,6 +137,20 @@ public class SpdmUserController {
return ResponseR.ok();
}
@Operation(summary = "分页查询用户列表(包括部门角色)")
@PostMapping(value = "/listUserDetailPage")
public ResponseR listUserDetailPage(@RequestBody UserParamDto paramDto) {
R<Page<StaffPageResultDto>> sysStaffPageR = remoteTenantServiceFeign.listStaffForPage(
StaffPageQueryDto.builder()
.tenantId(paramDto.getTenantId())
.deptId(paramDto.getDeptId())
.current(paramDto.getCurrent()).size(paramDto.getSize())
.build(),
paramDto.getTenantId());
Page<StaffPageResultDto> staffPage = sysStaffPageR.getData();
return ResponseR.ok(PageResult.of(staffPage.getTotal(), staffPage.getCurrent(), staffPage.getSize(), staffPage.getRecords()));
}
@Operation(summary = "查询用户详细信息")
@PostMapping(value = "/queryUserDetail")
public ResponseR queryUserDetail(@RequestBody UserParamDto userParamDto) {

View File

@@ -3,6 +3,7 @@ package com.honeycombis.honeycom.spdm.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.util.List;
@@ -19,11 +20,20 @@ public class UserParamDto {
@Schema(description = "手机号")
private String phoneNo;
@Schema(description = "部门id")
private String deptId;
@Schema(description = "租户id")
private String tenantId;
@Schema(description = "用户唯一标识")
private List<Long> userIds;
@Schema(description = "当前页码")
private Integer current;
@Schema(description = "每页显示数量")
private Integer size;
}

View File

@@ -492,6 +492,13 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaffEnt
if (ObjectUtil.isNotEmpty(sysStaffQueryDTO.getUserId())) {
queryWrapper.eq(SysStaffEntity::getUserId, sysStaffQueryDTO.getUserId());
}
if (!Objects.isNull(sysStaffQueryDTO.getDeptId())) {
List<Long> deptTreeStaffIds = this.getDeptTreeStaffIds(sysStaffQueryDTO.getDeptId());
if (CollectionUtils.isEmpty(deptTreeStaffIds)) {
return new Page<>();
}
queryWrapper.in(SysStaffEntity::getStaffId, deptTreeStaffIds);
}
if (StringUtils.isNotBlank(sysStaffQueryDTO.getNickname())) {
R<List<Long>> userIdListByNickNameLike = honeycomUserServiceFeign.getUserIdListByNickNameLike(sysStaffQueryDTO.getNickname(), SecurityConstants.FROM_IN);;
if (CollectionUtils.isNotEmpty(userIdListByNickNameLike.getData())) {