From 2e71bdbcdf853bb35e68016b84f0254f7366bfeb Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期五, 24 四月 2026 11:14:28 +0800
Subject: [PATCH] 文件工具类变更

---
 src/main/java/com/ruoyi/basic/utils/FileUtil.java |   77 +++++++++++++++++++-------------------
 1 files changed, 39 insertions(+), 38 deletions(-)

diff --git a/src/main/java/com/ruoyi/basic/utils/FileUtil.java b/src/main/java/com/ruoyi/basic/utils/FileUtil.java
index 19ac77c..b97f1d1 100644
--- a/src/main/java/com/ruoyi/basic/utils/FileUtil.java
+++ b/src/main/java/com/ruoyi/basic/utils/FileUtil.java
@@ -2,7 +2,8 @@
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.ruoyi.basic.dto.StorageAttachmentDTO;
+import com.ruoyi.basic.dto.StorageAttachmentVO;
+import com.ruoyi.basic.dto.StorageBlobDTO;
 import com.ruoyi.basic.dto.StorageBlobVO;
 import com.ruoyi.basic.enums.ApplicationTypeEnum;
 import com.ruoyi.basic.enums.RecordTypeEnum;
@@ -48,10 +49,10 @@
      * @param application     鏂囦欢鐢ㄩ��
      * @param recordType      鍏宠仈璁板綍绫诲瀷
      * @param recordId        鍏宠仈璁板綍id
-     * @param storageBlobVOS 鏂囦欢淇℃伅
+     * @param storageBlobDTOS 鏂囦欢淇℃伅
      */
-    public void saveStorageAttachment(ApplicationTypeEnum application, RecordTypeEnum recordType, Long recordId, List<StorageBlobVO> storageBlobVOS) {
-        if (CollectionUtils.isEmpty(storageBlobVOS)) {
+    public void saveStorageAttachment(ApplicationTypeEnum application, RecordTypeEnum recordType, Long recordId, List<StorageBlobDTO> storageBlobDTOS) {
+        if (CollectionUtils.isEmpty(storageBlobDTOS)) {
             throw new RuntimeException("鏂囦欢淇℃伅涓嶈兘涓虹┖");
         }
         if (application == null) {
@@ -66,12 +67,12 @@
         // 鍒犻櫎鏃ч檮浠朵俊鎭�
         deleteStorageAttachmentsByApplicationAndRecordTypeAndRecordId(application, recordType, recordId);
         List<StorageAttachment> storageAttachments = new ArrayList<>();
-        for (StorageBlobVO storageBlobVO : storageBlobVOS) {
+        for (StorageBlobDTO storageBlobDTO : storageBlobDTOS) {
             StorageAttachment storageAttachment = new StorageAttachment();
             storageAttachment.setApplication(application.getType());
             storageAttachment.setRecordType(recordType.getType());
             storageAttachment.setRecordId(recordId);
-            storageAttachment.setStorageBlobId(storageBlobVO.getId());
+            storageAttachment.setStorageBlobId(storageBlobDTO.getId());
             storageAttachment.setDeleted(0L);
         }
         storageAttachmentMapper.insert(storageAttachments);
@@ -238,24 +239,24 @@
      *
      * @param storageAttachmentIds 鏂囦欢id
      */
-    public List<StorageAttachmentDTO> getStorageAttachmentDTOsByStorageAttachmentIds(List<Long> storageAttachmentIds) {
+    public List<StorageAttachmentVO> getStorageAttachmentVOSByStorageAttachmentIds(List<Long> storageAttachmentIds) {
         List<StorageAttachment> storageAttachments = getStorageAttachmentsByStorageAttachmentIds(storageAttachmentIds);
         if (CollectionUtils.isEmpty(storageAttachments)) {
             return new ArrayList<>();
         }
-        List<StorageAttachmentDTO> storageAttachmentDTOS = new ArrayList<>();
+        List<StorageAttachmentVO> storageAttachmentVOS = new ArrayList<>();
         for (StorageAttachment storageAttachment : storageAttachments) {
-            StorageAttachmentDTO storageAttachmentDTO = new StorageAttachmentDTO();
-            BeanUtils.copyProperties(storageAttachment, storageAttachmentDTO);
+            StorageAttachmentVO storageAttachmentVO = new StorageAttachmentVO();
+            BeanUtils.copyProperties(storageAttachment, storageAttachmentVO);
             List<StorageBlobVO> storageBlobVOS = getStorageBlobDTOsByStorageAttachmentIds(Collections.singletonList(storageAttachment.getId()));
             if (CollectionUtils.isEmpty(storageBlobVOS)) {
-                storageAttachmentDTO.setStorageBlobVOS(new ArrayList<>());
+                storageAttachmentVO.setStorageBlobVOS(new ArrayList<>());
             } else {
-                storageAttachmentDTO.setStorageBlobVOS(storageBlobVOS);
+                storageAttachmentVO.setStorageBlobVOS(storageBlobVOS);
             }
-            storageAttachmentDTOS.add(storageAttachmentDTO);
+            storageAttachmentVOS.add(storageAttachmentVO);
         }
-        return storageAttachmentDTOS;
+        return storageAttachmentVOS;
     }
 
     /**
@@ -264,24 +265,24 @@
      * @param storageAttachmentIds 鏂囦欢id
      * @param expired              杩囨湡鏃堕棿
      */
-    public List<StorageAttachmentDTO> getStorageAttachmentDTOsByStorageAttachmentIds(List<Long> storageAttachmentIds, BigDecimal expired) {
+    public List<StorageAttachmentVO> getStorageAttachmentVOSByStorageAttachmentIds(List<Long> storageAttachmentIds, BigDecimal expired) {
         List<StorageAttachment> storageAttachments = getStorageAttachmentsByStorageAttachmentIds(storageAttachmentIds);
         if (CollectionUtils.isEmpty(storageAttachments)) {
             return new ArrayList<>();
         }
-        List<StorageAttachmentDTO> storageAttachmentDTOS = new ArrayList<>();
+        List<StorageAttachmentVO> storageAttachmentVOS = new ArrayList<>();
         for (StorageAttachment storageAttachment : storageAttachments) {
-            StorageAttachmentDTO storageAttachmentDTO = new StorageAttachmentDTO();
-            BeanUtils.copyProperties(storageAttachment, storageAttachmentDTO);
+            StorageAttachmentVO storageAttachmentVO = new StorageAttachmentVO();
+            BeanUtils.copyProperties(storageAttachment, storageAttachmentVO);
             List<StorageBlobVO> storageBlobVOS = getStorageBlobDTOsByStorageAttachmentIds(Collections.singletonList(storageAttachment.getId()), expired);
             if (CollectionUtils.isEmpty(storageBlobVOS)) {
-                storageAttachmentDTO.setStorageBlobVOS(new ArrayList<>());
+                storageAttachmentVO.setStorageBlobVOS(new ArrayList<>());
             } else {
-                storageAttachmentDTO.setStorageBlobVOS(storageBlobVOS);
+                storageAttachmentVO.setStorageBlobVOS(storageBlobVOS);
             }
-            storageAttachmentDTOS.add(storageAttachmentDTO);
+            storageAttachmentVOS.add(storageAttachmentVO);
         }
-        return storageAttachmentDTOS;
+        return storageAttachmentVOS;
     }
 
     /**
@@ -291,24 +292,24 @@
      * @param recordType  璁板綍绫诲瀷
      * @param recordId    璁板綍id
      */
-    public List<StorageAttachmentDTO> getStorageAttachmentDTOsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum application, RecordTypeEnum recordType, Long recordId) {
+    public List<StorageAttachmentVO> getStorageAttachmentVOSByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum application, RecordTypeEnum recordType, Long recordId) {
         List<StorageAttachment> storageAttachments = getStorageAttachmentsByApplicationAndRecordTypeAndRecordId(application, recordType, recordId);
         if (CollectionUtils.isEmpty(storageAttachments)) {
             return new ArrayList<>();
         }
-        List<StorageAttachmentDTO> storageAttachmentDTOS = new ArrayList<>();
+        List<StorageAttachmentVO> storageAttachmentVOS = new ArrayList<>();
         for (StorageAttachment storageAttachment : storageAttachments) {
-            StorageAttachmentDTO storageAttachmentDTO = new StorageAttachmentDTO();
-            BeanUtils.copyProperties(storageAttachment, storageAttachmentDTO);
+            StorageAttachmentVO storageAttachmentVO = new StorageAttachmentVO();
+            BeanUtils.copyProperties(storageAttachment, storageAttachmentVO);
             List<StorageBlobVO> storageBlobVOS = getStorageBlobDTOsByStorageAttachmentIds(Collections.singletonList(storageAttachment.getId()));
             if (CollectionUtils.isEmpty(storageBlobVOS)) {
-                storageAttachmentDTO.setStorageBlobVOS(new ArrayList<>());
+                storageAttachmentVO.setStorageBlobVOS(new ArrayList<>());
             } else {
-                storageAttachmentDTO.setStorageBlobVOS(storageBlobVOS);
+                storageAttachmentVO.setStorageBlobVOS(storageBlobVOS);
             }
-            storageAttachmentDTOS.add(storageAttachmentDTO);
+            storageAttachmentVOS.add(storageAttachmentVO);
         }
-        return storageAttachmentDTOS;
+        return storageAttachmentVOS;
     }
 
     /**
@@ -319,24 +320,24 @@
      * @param recordId    璁板綍id
      * @param expired     杩囨湡鏃堕棿
      */
-    public List<StorageAttachmentDTO> getStorageAttachmentDTOsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum application, RecordTypeEnum recordType, Long recordId, BigDecimal expired) {
+    public List<StorageAttachmentVO> getStorageAttachmentVOSByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum application, RecordTypeEnum recordType, Long recordId, BigDecimal expired) {
         List<StorageAttachment> storageAttachments = getStorageAttachmentsByApplicationAndRecordTypeAndRecordId(application, recordType, recordId);
         if (CollectionUtils.isEmpty(storageAttachments)) {
             return new ArrayList<>();
         }
-        List<StorageAttachmentDTO> storageAttachmentDTOS = new ArrayList<>();
+        List<StorageAttachmentVO> storageAttachmentVOS = new ArrayList<>();
         for (StorageAttachment storageAttachment : storageAttachments) {
-            StorageAttachmentDTO storageAttachmentDTO = new StorageAttachmentDTO();
-            BeanUtils.copyProperties(storageAttachment, storageAttachmentDTO);
+            StorageAttachmentVO storageAttachmentVO = new StorageAttachmentVO();
+            BeanUtils.copyProperties(storageAttachment, storageAttachmentVO);
             List<StorageBlobVO> storageBlobVOS = getStorageBlobDTOsByStorageAttachmentIds(Collections.singletonList(storageAttachment.getId()), expired);
             if (CollectionUtils.isEmpty(storageBlobVOS)) {
-                storageAttachmentDTO.setStorageBlobVOS(new ArrayList<>());
+                storageAttachmentVO.setStorageBlobVOS(new ArrayList<>());
             } else {
-                storageAttachmentDTO.setStorageBlobVOS(storageBlobVOS);
+                storageAttachmentVO.setStorageBlobVOS(storageBlobVOS);
             }
-            storageAttachmentDTOS.add(storageAttachmentDTO);
+            storageAttachmentVOS.add(storageAttachmentVO);
         }
-        return storageAttachmentDTOS;
+        return storageAttachmentVOS;
     }
 
     /**

--
Gitblit v1.9.3