feat:查询用户详细信息(带部门角色岗位)

This commit is contained in:
2026-01-16 16:17:59 +08:00
parent 5257bf4c18
commit cb672abe03
13 changed files with 205 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import java.time.LocalDateTime;
@Data
public class ReportTemplateResp {
private Long id;
@Schema(description = "报告模版唯一ID")
private String uuid;

View File

@@ -0,0 +1,44 @@
package com.sdm.common.entity.resp.system;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@Data
public class CIDDeptResp implements Serializable {
private static final long serialVersionUID = -5457958807109903023L;
@Schema(description="部门ID")
private Long deptId;
@Schema(description="部门编码")
private String deptCode;
@Schema(description="部门名称")
private String deptName;
@Schema(description="负责人user_id")
private Long leaderId;
@Schema(description="排序")
private Integer sortOrder;
@Schema(description="父级部门ID")
private Long parentId;
@Schema(description="创建人")
private Long createBy;
@Schema(description="创建时间")
private Long createTime;
@Schema(description="修改人")
private Long updateBy;
@Schema(description="更新时间")
private Long updateTime;
@Schema(description="所属租户ID")
private Long tenantId;
}

View File

@@ -0,0 +1,47 @@
package com.sdm.common.entity.resp.system;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serializable;
@Data
public class CIDPostResp implements Serializable {
private static final long serialVersionUID = -7325581156410130798L;
/**
* 岗位ID
*/
@Schema(description="岗位ID")
@NotNull(message = "岗位Id不能为空")
private Long postId;
/**
* 岗位编码
*/
@Schema(description="岗位编码")
@NotBlank(message = "岗位编码不能为空!")
private String postCode;
/**
* 岗位名称
*/
@Schema(description="岗位名称")
@NotBlank(message = "岗位名称不能为空!")
private String postName;
/**
* 岗位排序
*/
@Schema(description="岗位排序")
@NotNull(message = "岗位排序不能为空!")
private Integer sortOrder;
/**
* 岗位描述
*/
@Schema(description="岗位描述")
private String description;
}

View File

@@ -0,0 +1,72 @@
package com.sdm.common.entity.resp.system;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
public class CIDStaffResp implements Serializable {
private static final long serialVersionUID = -7327814323528614516L;
@Schema(description = "员工ID")
private Long staffId;
/**
* 员工编号,系统生成
*/
@Schema(description = "员工编号,系统生成")
private String staffCode;
/**
* 公司邮箱地址,每个公司的邮箱不一样
*/
@Schema(description = "公司邮箱地址,每个公司的邮箱不一样")
private String email;
/**
* 1-是管理员0-非管理员
*/
@Schema(description = "1-是管理员0-非管理员")
private String isAdmin;
/**
* 所属用户ID
*/
@Schema(description = "所属用户ID")
private Long userId;
/**
* 所属租户ID
*/
@Schema(description = "所属租户ID")
private Long tenantId;
/**
* 登录默认员工账号0-默认1-非默认
*/
@Schema(description = "登录默认员工账号0-默认1-非默认")
private String loginDefault;
/**
* 锁定标记0未锁定1已锁定
*/
@Schema(description = "锁定标记0未锁定1已锁定")
private String status;
@Schema(description = "用户信息")
private CIDUserResp userInfo;
@Schema(description="关联岗位集合")
private List<CIDDeptResp> deptList = new ArrayList<>();
@Schema(description="关联部门集合")
private List<CIDPostResp> postList = new ArrayList<>();
@Schema(description="关联role集合")
private List<CIDRoleResp> roleList = new ArrayList<>();
}

View File

@@ -250,5 +250,10 @@ public class SysUserController implements ISysUserFeignClient {
return rolePermissionService.getUserPermissions(Long.valueOf(userId));
}
@Operation(summary = "根据用户ids查询用户列表")
@PostMapping("/listUserDetailByIds")
public SdmResponse<List<CIDStaffResp>> listUserDetailByIds(@Parameter(description = "用户查询请求参数") @RequestBody UserQueryReq req) {
return ISysUserService.listUserDetailByIds(req);
}
}

View File

@@ -53,4 +53,6 @@ public interface ISysUserService extends IService<SysUser> {
SdmResponse<List<Long>> getUserByRoleCode(String roleCode, Long tenantId);
SdmResponse<List<CIDStaffResp>> listUserDetailByIds(UserQueryReq req);
}

View File

@@ -44,6 +44,9 @@ public class CIDISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
@Value("${cid.user.listUserByIds}")
private String listUserByIds;
@Value("${cid.user.listUserDetailByIds}")
private String listUserDetailByIds;
@Value("${cid.user.queryUserRole}")
private String queryUserRole;
@@ -301,4 +304,24 @@ public class CIDISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
return SdmResponse.failed("根据角色编码查询用户失败: ");
}
}
@Override
public SdmResponse<List<CIDStaffResp>> listUserDetailByIds(UserQueryReq req) {
try {
log.info("[CIDISysUserServiceImpl] listUserDetailByIds send url:{}, param:{}", cidUrl + listUserDetailByIds, JSONUtil.toJsonStr(req));
String userJson = HttpUtil.post(cidUrl + listUserDetailByIds, JSONUtil.toJsonStr(req));
log.info("[CIDISysUserServiceImpl] listUserDetailByIds response:{}", userJson);
SdmResponse<List<CIDStaffResp>> result = JSON.parseObject(
userJson,
new TypeReference<SdmResponse<List<CIDStaffResp>>>() {}
);
if (result != null) {
return result;
}
return SdmResponse.failed("用户不存在");
} catch (Exception e) {
log.error("查询用户失败", e);
return SdmResponse.failed("查询用户失败: ");
}
}
}

View File

@@ -10,14 +10,11 @@ import com.sdm.common.entity.req.system.QueryGroupDetailReq;
import com.sdm.common.entity.req.system.UserListReq;
import com.sdm.common.entity.req.system.UserQueryReq;
import com.sdm.common.entity.resp.PageDataResp;
import com.sdm.common.entity.resp.system.CIDRoleResp;
import com.sdm.common.entity.resp.system.UserTokenResp;
import com.sdm.common.entity.resp.system.*;
import com.sdm.common.utils.PageUtils;
import com.sdm.system.dao.SysUserMapper;
import com.sdm.system.model.entity.*;
import com.sdm.system.model.req.user.*;
import com.sdm.common.entity.resp.system.CIDUserResp;
import com.sdm.common.entity.resp.system.SysUserGroupResp;
import com.sdm.system.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
@@ -312,4 +309,9 @@ public class LocalUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> im
return null;
}
@Override
public SdmResponse<List<CIDStaffResp>> listUserDetailByIds(UserQueryReq req) {
return null;
}
}

View File

@@ -145,6 +145,7 @@ cid:
listUser: /spdm-user/listUser
queryUserDetail: /spdm-user/queryUserDetail
listUserByIds: /spdm-user/listUserByIds
listUserDetailByIds: /spdm-user/listUserDetailByIds
queryUserRole: /spdm-user/queryUserRole
queryGroup: /spdm-user/queryGroup
queryGroupDetail: /spdm-user/queryGroupDetail

View File

@@ -145,6 +145,7 @@ cid:
listUser: /spdm-user/listUser
queryUserDetail: /spdm-user/queryUserDetail
listUserByIds: /spdm-user/listUserByIds
listUserDetailByIds: /spdm-user/listUserDetailByIds
queryUserRole: /spdm-user/queryUserRole
queryGroup: /spdm-user/queryGroup
queryGroupDetail: /spdm-user/queryGroupDetail

View File

@@ -145,6 +145,7 @@ cid:
listUser: /spdm-user/listUser
queryUserDetail: /spdm-user/queryUserDetail
listUserByIds: /spdm-user/listUserByIds
listUserDetailByIds: /spdm-user/listUserDetailByIds
queryUserRole: /spdm-user/queryUserRole
queryGroup: /spdm-user/queryGroup
queryGroupDetail: /spdm-user/queryGroupDetail

View File

@@ -145,6 +145,7 @@ cid:
listUser: /spdm-user/listUser
queryUserDetail: /spdm-user/queryUserDetail
listUserByIds: /spdm-user/listUserByIds
listUserDetailByIds: /spdm-user/listUserDetailByIds
queryUserRole: /spdm-user/queryUserRole
queryGroup: /spdm-user/queryGroup
queryGroupDetail: /spdm-user/queryGroupDetail

View File

@@ -145,6 +145,7 @@ cid:
listUser: /spdm-user/listUser
queryUserDetail: /spdm-user/queryUserDetail
listUserByIds: /spdm-user/listUserByIds
listUserDetailByIds: /spdm-user/listUserDetailByIds
queryUserRole: /spdm-user/queryUserRole
queryGroup: /spdm-user/queryGroup
queryGroupDetail: /spdm-user/queryGroupDetail