From 83bfb1d99f351371a720c270f20d1eaff0f9d9bc Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 28 一月 2026 14:49:23 +0800
Subject: [PATCH] fix: 旧库存进行判空处理

---
 src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java b/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
index 40098d5..b8e0e2a 100644
--- a/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
+++ b/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
@@ -26,6 +26,7 @@
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
 
@@ -76,8 +77,17 @@
         tempFileRecord.setExpireTime(LocalDateTime.now().plusHours(2)); // 2灏忔椂鍚庤繃鏈�
         tempFileRecord.setType(type);
         tempFileMapper.insert(tempFileRecord);
-
         return tempFileRecord;
+    }
+
+    @Override
+    public String uploadByCommon(MultipartFile file, Integer type, Long id) throws  IOException{
+        TempFile tempFile = uploadFile(file, type);
+        if (tempFile != null) {
+            migrateTempFilesToFormal(id, Collections.singletonList(tempFile.getTempId()), type);
+            return tempFile.getTempPath();
+        }
+        return null;
     }
 
     /**
@@ -155,7 +165,7 @@
         }
     }
 
-    @Scheduled(cron = "0 0 3 * * ?") // 姣忓ぉ鍑屾櫒3鐐规墽琛�
+//    @Scheduled(cron = "0 0 3 * * ?") // 姣忓ぉ鍑屾櫒3鐐规墽琛�
     public void cleanupExpiredTempFiles() {
         LambdaQueryWrapper<TempFile> wrapper = new LambdaQueryWrapper<>();
         wrapper.lt(TempFile::getExpireTime, LocalDateTime.now()); // expireTime < 褰撳墠鏃堕棿

--
Gitblit v1.9.3