From a8e4132c3e2e9c3b3fcb0360901b35571b6464ea Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期五, 28 八月 2026 10:13:01 +0800
Subject: [PATCH] feat: 综合业务模块功能补充与实体拓展

---
 src/main/java/com/ruoyi/projectManagement/service/impl/InfoServiceImpl.java |   63 +++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ruoyi/projectManagement/service/impl/InfoServiceImpl.java b/src/main/java/com/ruoyi/projectManagement/service/impl/InfoServiceImpl.java
index 85d1e88..d1f1897 100644
--- a/src/main/java/com/ruoyi/projectManagement/service/impl/InfoServiceImpl.java
+++ b/src/main/java/com/ruoyi/projectManagement/service/impl/InfoServiceImpl.java
@@ -18,8 +18,18 @@
 import com.ruoyi.projectManagement.vo.ListInfoVo;
 import com.ruoyi.projectManagement.vo.SaveInfoVo;
 import com.ruoyi.projectManagement.vo.SearchInfoVo;
+import com.ruoyi.projectManagement.vo.AttachmentGroupVo;
 import com.ruoyi.sales.pojo.SalesLedgerProduct;
+import com.ruoyi.sales.pojo.SalesLedger;
+import com.baomidou.mybatisplus.extension.toolkit.Db;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.basic.dto.StorageAttachmentDTO;
+import com.ruoyi.basic.dto.StorageBlobVO;
+import com.ruoyi.basic.enums.RecordTypeEnum;
+import com.ruoyi.basic.service.StorageAttachmentService;
 import com.ruoyi.sales.service.ISalesLedgerService;
+import com.ruoyi.sales.pojo.SalesLawsuit;
+import com.ruoyi.sales.service.ISalesLawsuitService;
 import lombok.RequiredArgsConstructor;
 import lombok.SneakyThrows;
 import org.springframework.stereotype.Service;
@@ -43,6 +53,8 @@
     private final ContractInfoHandleService contractInfoHandleService;
     private final ShippingAddressHandleService shippingAddressHandleService;
     private final ISalesLedgerService salesLedgerService;
+    private final StorageAttachmentService storageAttachmentService;
+    private final ISalesLawsuitService salesLawsuitService;
 
 
     @Transactional(rollbackFor = Exception.class)
@@ -128,4 +140,55 @@
         return vo;
     }
 
+    @Override
+    public List<AttachmentGroupVo> getProjectAttachments(Long id) {
+        List<AttachmentGroupVo> result = new java.util.ArrayList<>();
+        
+        // 椤圭洰绠$悊闄勪欢
+        StorageAttachmentDTO infoDto = new StorageAttachmentDTO();
+        infoDto.setRecordType(RecordTypeEnum.INFO.getType());
+        infoDto.setRecordId(id);
+        List<StorageBlobVO> infoFiles = storageAttachmentService.list(infoDto);
+        if (infoFiles != null && !infoFiles.isEmpty()) {
+            result.add(new AttachmentGroupVo("椤圭洰绠$悊", infoFiles));
+        }
+
+        // 閿�鍞彴璐﹂檮浠�
+        List<SalesLedger> ledgers = salesLedgerService.list(Wrappers.<SalesLedger>lambdaQuery().eq(SalesLedger::getProjectId, id));
+        if (ledgers != null && !ledgers.isEmpty()) {
+            List<StorageBlobVO> ledgerFiles = new java.util.ArrayList<>();
+            for (SalesLedger ledger : ledgers) {
+                StorageAttachmentDTO dto = new StorageAttachmentDTO();
+                dto.setRecordType(RecordTypeEnum.SALES_LEDGER.getType());
+                dto.setRecordId(ledger.getId());
+                List<StorageBlobVO> files = storageAttachmentService.list(dto);
+                if (files != null && !files.isEmpty()) {
+                    ledgerFiles.addAll(files);
+                }
+            }
+            if (!ledgerFiles.isEmpty()) {
+                result.add(new AttachmentGroupVo("閿�鍞彴璐�", ledgerFiles));
+            }
+        }
+
+        // 璇夎绠$悊闄勪欢
+        List<SalesLawsuit> lawsuits = salesLawsuitService.list(Wrappers.<SalesLawsuit>lambdaQuery().eq(SalesLawsuit::getProjectId, id));
+        if (lawsuits != null && !lawsuits.isEmpty()) {
+            List<StorageBlobVO> lawsuitFiles = new java.util.ArrayList<>();
+            for (SalesLawsuit lawsuit : lawsuits) {
+                StorageAttachmentDTO dto = new StorageAttachmentDTO();
+                dto.setRecordType(RecordTypeEnum.SALES_LAWSUIT.getType());
+                dto.setRecordId(lawsuit.getId());
+                List<StorageBlobVO> files = storageAttachmentService.list(dto);
+                if (files != null && !files.isEmpty()) {
+                    lawsuitFiles.addAll(files);
+                }
+            }
+            if (!lawsuitFiles.isEmpty()) {
+                result.add(new AttachmentGroupVo("璇夎绠$悊", lawsuitFiles));
+            }
+        }
+
+        return result;
+    }
 }

--
Gitblit v1.9.3