From 277b5047d00a3e9094bafd5ecb078976fbf6a92d Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期四, 08 一月 2026 18:59:04 +0800
Subject: [PATCH] 华玺砂浆转移-采购代码、发货和发货审核、报修和报修审核、采购模板,查询采购模板接口、财务管理的存货核算数据接口、财务管理的固定资产核算获取台账接口、采购审批,接口、客户分类字段、采购台账字段,实现采购异常记录的添加接口、黑名单,添加资质管理字段,可上传资质文件-至军泰伟业
---
src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 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 d43adf0..6f39755 100644
--- a/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
+++ b/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
@@ -85,6 +85,7 @@
*
* @param businessId 涓氬姟ID锛堥攢鍞彴璐D锛�
* @param tempFileIds 涓存椂鏂囦欢ID鍒楄〃
+ * @param fileType 鏂囦欢绫诲瀷(鏉ヨ嚜FileNameType)
* @throws IOException 鏂囦欢鎿嶄綔寮傚父
*/
public void migrateTempFilesToFormal(Long businessId, List<String> tempFileIds, Integer fileType) throws IOException {
@@ -122,12 +123,15 @@
try {
// 鎵ц鏂囦欢杩佺Щ锛堜娇鐢ㄥ師瀛愭搷浣滅‘淇濆畨鍏ㄦ�э級
- Files.move(
- Paths.get(tempFile.getTempPath()),
- formalFilePath,
- StandardCopyOption.REPLACE_EXISTING,
- StandardCopyOption.ATOMIC_MOVE
- );
+// Files.move(
+// Paths.get(tempFile.getTempPath()),
+// formalFilePath,
+// StandardCopyOption.REPLACE_EXISTING,
+// StandardCopyOption.ATOMIC_MOVE
+// );
+ // 鍘熷瓙绉诲姩澶辫触锛屼娇鐢ㄥ鍒�+鍒犻櫎
+ Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING);
+ Files.deleteIfExists(Paths.get(tempFile.getTempPath()));
log.info("鏂囦欢杩佺Щ鎴愬姛: {} -> {}", tempFile.getTempPath(), formalFilePath);
// 鏇存柊鏂囦欢璁板綍锛堝叧鑱斿埌涓氬姟ID锛�
@@ -151,7 +155,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