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 |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 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 be91a86..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.*;
@@ -48,7 +50,7 @@
 /**
  * 璋冨矖鐢宠 Service 瀹炵幇绫�
  *
- * @author 鑺嬮亾婧愮爜
+ * @author 瓒呯骇绠$悊鍛�
  */
 @Service
 @Validated
@@ -108,7 +110,7 @@
     }
 
     private Long getCurrentUserId() {
-        return 1L;
+        return SecurityFrameworkUtils.getLoginUserId();
     }
 
     private String generateUniqueNo() {
@@ -134,11 +136,7 @@
         }
         HrmTransferApplicationDO updateObj = BeanUtils.toBean(updateReqVO, HrmTransferApplicationDO.class);
         transferApplicationMapper.updateById(updateObj);
-        if (updateReqVO.getBlobIds() != null) {
-            storageAttachmentApi.deleteAttachmentsByRecord("hrm_transfer_application", updateReqVO.getId());
-            storageAttachmentApi.bindAttachments("file", "hrm_transfer_application",
-                    updateReqVO.getId(), updateReqVO.getBlobIds());
-        }
+        storageAttachmentApi.updateAttachments("file", "hrm_transfer_application", updateReqVO.getId(), updateReqVO.getBlobIds());
     }
 
     @Override
@@ -186,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());
@@ -198,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