From 34320634733b77a773af6836a2e3082092068ec9 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期六, 25 四月 2026 15:09:50 +0800
Subject: [PATCH] 增加永久文件接口

---
 src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpFileServiceImpl.java |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpFileServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpFileServiceImpl.java
index 54b4af0..cb915c4 100644
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpFileServiceImpl.java
+++ b/src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpFileServiceImpl.java
@@ -1,18 +1,15 @@
 package com.ruoyi.basic.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.stream.CollectorUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
 import com.ruoyi.basic.mapper.CustomerFollowUpFileMapper;
 import com.ruoyi.basic.pojo.CustomerFollowUpFile;
 import com.ruoyi.basic.service.CustomerFollowUpFileService;
-import com.ruoyi.basic.service.CustomerFollowUpService;
 import com.ruoyi.common.vo.SimpleFileVo;
 import lombok.RequiredArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
@@ -33,10 +30,7 @@
 @RequiredArgsConstructor
 public class CustomerFollowUpFileServiceImpl extends ServiceImpl<CustomerFollowUpFileMapper, CustomerFollowUpFile> implements CustomerFollowUpFileService {
 
-    @Autowired
-    @Lazy
-    private CustomerFollowUpService customerFollowUpService;
-
+    private final CustomerFollowUpFileMapper customerFollowUpFileMapper;
 
     @Override
     public <T> void fillAttachment(List<T> list, Function<T, String> getAttachmentIds, BiConsumer<T, List<SimpleFileVo>> setAttachmentList) {
@@ -53,7 +47,7 @@
         List<CustomerFollowUpFile> followUpFilesByIds = new ArrayList<>();
         Lists.partition(Lists.newArrayList(ids), 999).forEach(it -> {
             followUpFilesByIds.addAll(
-                    customerFollowUpService.getFollowUpFilesByIds(it)
+                    getFollowUpFilesByIds(it)
             );
         });
         if (CollUtil.isEmpty(followUpFilesByIds)) {
@@ -75,4 +69,15 @@
             }
         });
     }
+
+    private List<CustomerFollowUpFile> getFollowUpFilesByIds(Collection<Long> fileIds) {
+        if (fileIds == null || fileIds.isEmpty()) {
+            return new ArrayList<>(0);
+        }
+
+        LambdaQueryWrapper<CustomerFollowUpFile> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.in(CustomerFollowUpFile::getId, fileIds)
+                .select(CustomerFollowUpFile::getId, CustomerFollowUpFile::getFileUrl, CustomerFollowUpFile::getFileName);
+        return customerFollowUpFileMapper.selectList(queryWrapper);
+    }
 }

--
Gitblit v1.9.3