From f83950d292a8933390b3b4b516f90f21a9946c68 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 27 八月 2026 11:41:47 +0800
Subject: [PATCH] fix 修复逻辑缺陷
---
yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmTransferApplicationServiceImpl.java | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmTransferApplicationServiceImpl.java b/yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmTransferApplicationServiceImpl.java
index c3272ee..7505b7b 100644
--- a/yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmTransferApplicationServiceImpl.java
+++ b/yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/approval/HrmTransferApplicationServiceImpl.java
@@ -41,6 +41,8 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
+
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
import static cn.iocoder.yudao.module.hrm.enums.ErrorCodeConstants.*;
@@ -108,7 +110,7 @@
}
private Long getCurrentUserId() {
- return 1L;
+ return SecurityFrameworkUtils.getLoginUserId();
}
private String generateUniqueNo() {
@@ -182,8 +184,8 @@
}
private void fillDeptNames(HrmTransferApplicationRespVO respVO, HrmTransferApplicationDO application) {
- Set<Long> deptIds = Set.of(application.getCurrentDeptId(), application.getTargetDeptId())
- .stream().filter(Objects::nonNull).collect(Collectors.toSet());
+ Set<Long> deptIds = Stream.of(application.getCurrentDeptId(), application.getTargetDeptId())
+ .filter(Objects::nonNull).collect(Collectors.toSet());
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(deptIds);
if (application.getCurrentDeptId() != null && deptMap.containsKey(application.getCurrentDeptId())) {
respVO.setCurrentDeptName(deptMap.get(application.getCurrentDeptId()).getName());
@@ -194,8 +196,8 @@
}
private void fillPostNames(HrmTransferApplicationRespVO respVO, HrmTransferApplicationDO application) {
- Set<Long> postIds = Set.of(application.getCurrentPostId(), application.getTargetPostId())
- .stream().filter(Objects::nonNull).collect(Collectors.toSet());
+ Set<Long> postIds = Stream.of(application.getCurrentPostId(), application.getTargetPostId())
+ .filter(Objects::nonNull).collect(Collectors.toSet());
Map<Long, PostRespDTO> postMap = postApi.getPostMap(postIds);
if (application.getCurrentPostId() != null && postMap.containsKey(application.getCurrentPostId())) {
respVO.setCurrentPostName(postMap.get(application.getCurrentPostId()).getName());
--
Gitblit v1.9.3