From 7e8edd4b59fb22146b90d01ca38f75148f3fd774 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 20 四月 2026 17:57:18 +0800
Subject: [PATCH] feat(bom): 添加BOM管理功能模块,工序 管理,基础 - 新增CustomerPrivatePoolMapper.xml实现客户私池映射 - 添加SysLoginController支持登录验证和用户信息获取 - 创建TechnologyBomController提供BOM的增删改查接口 - 定义TechnologyBomDto数据传输对象 - 实现TechnologyBomMapper和相关XML映射文件 - 开发TechnologyBomService业务逻辑层 - 添加TechnologyBomStructure结构管理功能 - 集成Excel导入导出BOM数据功能 - 实现BOM结构树形展示和维护功能

---
 src/main/java/com/ruoyi/sales/service/impl/CommonFileServiceImpl.java |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/service/impl/CommonFileServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/CommonFileServiceImpl.java
index 76831bc..f3aac49 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/CommonFileServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/CommonFileServiceImpl.java
@@ -1,5 +1,6 @@
 package com.ruoyi.sales.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.other.mapper.TempFileMapper;
@@ -38,6 +39,21 @@
 
     @Value("${file.upload-dir}")
     private String uploadDir;
+
+    public List<CommonFile> getFileListByBusinessId(Long businessId,Integer type) {
+        return commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, businessId)
+                .eq(CommonFile::getType, type));
+    }
+
+    public void deleteByBusinessId(Long businessId,Integer type) {
+        commonFileMapper.delete(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, businessId)
+                .eq(CommonFile::getType, type));
+    }
+
+    public void deleteByBusinessIds(List<Long> businessId,Integer type) {
+        commonFileMapper.delete(new LambdaQueryWrapper<CommonFile>().in(CommonFile::getCommonId, businessId)
+                .eq(CommonFile::getType, type));
+    }
 
 
     @Override
@@ -123,12 +139,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锛�

--
Gitblit v1.9.3