From c3b0503f8e2ecf955d0e8e4ca9294e6cd5199c0b Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期四, 27 八月 2026 11:02:30 +0800
Subject: [PATCH] HRM: 员工台账岗位支持多选并同步系统用户岗位
---
yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmOvertimeApplicationServiceImpl.java | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmOvertimeApplicationServiceImpl.java b/yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmOvertimeApplicationServiceImpl.java
index aa9449d..a044fba 100644
--- a/yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmOvertimeApplicationServiceImpl.java
+++ b/yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmOvertimeApplicationServiceImpl.java
@@ -2,6 +2,8 @@
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
@@ -255,9 +257,17 @@
resp.setEmployeeName(employee.getName()); resp.setEmployeeNo(employee.getEmployeeNo());
resp.setDeptId(employee.getDeptId());
DeptRespDTO dept = employee.getDeptId() == null ? null : deptApi.getDept(employee.getDeptId());
- PostRespDTO post = employee.getPostId() == null ? null
- : postApi.getPostMap(Collections.singleton(employee.getPostId())).get(employee.getPostId());
resp.setDeptName(dept == null ? null : dept.getName());
- resp.setPostName(post == null ? null : post.getName());
+ // 宀椾綅澶氶�夛細瑙f瀽 postIds JSON锛屾嫾鎺ュ矖浣嶅悕绉�
+ if (StrUtil.isNotBlank(employee.getPostIds())) {
+ List<Long> postIds = JSONUtil.toList(employee.getPostIds(), Long.class);
+ if (CollUtil.isNotEmpty(postIds)) {
+ Map<Long, PostRespDTO> postMap = postApi.getPostMap(postIds);
+ resp.setPostName(postIds.stream()
+ .filter(postMap::containsKey)
+ .map(id -> postMap.get(id).getName())
+ .collect(Collectors.joining(",")));
+ }
+ }
}
}
--
Gitblit v1.9.3