fix: 用户信息中增加deptType字段,前端可正确判断用户部门类型
This commit is contained in:
parent
ac7a114deb
commit
ca751f7342
@ -1057,6 +1057,19 @@ public class UserService {
|
||||
log.warn("获取用户部门列表失败: userId={}, error={}", user.getId(), e.getMessage());
|
||||
}
|
||||
|
||||
// 获取部门类型
|
||||
String deptType = null;
|
||||
if (user.getDeptId() != null) {
|
||||
try {
|
||||
Department dept = departmentMapper.selectById(user.getDeptId());
|
||||
if (dept != null) {
|
||||
deptType = dept.getDeptType();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("获取部门类型失败: deptId={}, error={}", user.getDeptId(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
UserInfoVO userInfoVO = UserInfoVO.builder()
|
||||
.id(user.getId())
|
||||
.username(user.getUsername())
|
||||
@ -1066,6 +1079,7 @@ public class UserService {
|
||||
.avatar(user.getAvatar())
|
||||
.deptId(user.getDeptId())
|
||||
.deptName(user.getDeptName())
|
||||
.deptType(deptType)
|
||||
.departments(departments)
|
||||
.roleIds(user.getRoleIds())
|
||||
.roles(roleCodes)
|
||||
|
||||
@ -51,6 +51,11 @@ public class UserInfoVO {
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 部门类型:demand-需求部门,receiving-接单部门
|
||||
*/
|
||||
private String deptType;
|
||||
|
||||
/**
|
||||
* 用户的所有部门列表(多部门支持)
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user