From 2a71f6790ddf6be7f63e6b009fc8d325a2a1d13b Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 27 四月 2026 13:07:34 +0800
Subject: [PATCH] 添加相关接口附件信息

---
 src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java b/src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java
index 5c8b7c6..e05ce2e 100644
--- a/src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java
@@ -6,7 +6,10 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ruoyi.basic.dto.StorageBlobVO;
+import com.ruoyi.basic.enums.RecordTypeEnum;
 import com.ruoyi.basic.service.CustomerFollowUpFileService;
+import com.ruoyi.basic.utils.FileUtil;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.projectManagement.mapper.PlanMapper;
 import com.ruoyi.projectManagement.mapper.PlanNodeMapper;
@@ -40,6 +43,7 @@
     private final CustomerFollowUpFileService customerFollowUpFileService;
 
     private final PlanNodeMapper planNodeMapper;
+    private final FileUtil fileUtil;
 
     @Lazy
     @Autowired
@@ -49,9 +53,8 @@
     @Transactional(rollbackFor = Exception.class)
     public void savePlan(SavePlanVo savePlanVo) {
         Plan plan = BeanUtil.copyProperties(savePlanVo, Plan.class);
-        // 闄勪欢澶勭悊 , 鎷兼帴
-        String attachments = String.join(",", Optional.ofNullable(savePlanVo.getAttachmentIds()).orElse(Collections.emptyList()));
-        plan.setAttachment(attachments);
+        // 闄勪欢澶勭悊
+        fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("", RecordTypeEnum.PLAN, savePlanVo.getId(), savePlanVo.getStorageBlobDTOs());
         if (savePlanVo.getId() == null) {
             planMapper.insert(plan);
         } else {
@@ -136,12 +139,14 @@
         IPage<Plan> planIPage = planMapper.selectPlanPage(searchPlanVo);
         IPage<PlanVo> resultPage = planIPage.convert(plan -> BeanUtil.copyProperties(plan, PlanVo.class));
         // 鏂囦欢鑾峰彇
-        customerFollowUpFileService.fillAttachment(resultPage.getRecords(), PlanVo::getAttachment, PlanVo::setAttachmentList);
         Map<Long, List<PlanNodeVo>> collect = getPlanNodeByPlanIds(resultPage.getRecords().stream().map(PlanVo::getId).collect(Collectors.toList()))
                 .stream()
                 .map(it -> BeanUtil.copyProperties(it, PlanNodeVo.class))
                 .collect(Collectors.groupingBy(PlanNodeVo::getProjectManagementPlanId, Collectors.toList()));
-        resultPage.getRecords().forEach(planVo -> planVo.setPlanNodeList(collect.getOrDefault(planVo.getId(), Collections.emptyList())));
+        resultPage.getRecords().forEach(planVo -> {
+            planVo.setPlanNodeList(collect.getOrDefault(planVo.getId(), Collections.emptyList()));
+            planVo.setStorageBlobVOs(fileUtil.getStorageBlobVOsByRecordTypeAndRecordId(RecordTypeEnum.PLAN, planVo.getId()));
+        });
         return resultPage;
     }
 

--
Gitblit v1.9.3