From 7c2f76acacf3bbba6f2fa62b54a04c2a3e49767e Mon Sep 17 00:00:00 2001 From: lilin Date: Sat, 24 May 2025 13:01:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/NodesServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/java/src/main/java/com/yfd/platform/modules/specialDocument/service/impl/NodesServiceImpl.java b/java/src/main/java/com/yfd/platform/modules/specialDocument/service/impl/NodesServiceImpl.java index 043bec6..80f8f07 100644 --- a/java/src/main/java/com/yfd/platform/modules/specialDocument/service/impl/NodesServiceImpl.java +++ b/java/src/main/java/com/yfd/platform/modules/specialDocument/service/impl/NodesServiceImpl.java @@ -968,6 +968,9 @@ public class NodesServiceImpl extends ServiceImpl implements // 4. 构建解压目标路径 例如 D:\yun\temporary\111 Path destRoot = Paths.get(storageSourceConfig.getValue(), decompressionPath, zipName); + LOGGER.info("要解压文件路径:{}", zipFilePath); + LOGGER.info("解压以后文件路径:{}", destRoot); + //todo 如果项目不存在 直接拷贝到目标路径下 拷贝完成以后 然后新增一个项目结构 然后走一遍扫描 @@ -980,13 +983,17 @@ public class NodesServiceImpl extends ServiceImpl implements unzipToTemp(zipFilePath, String.valueOf(destRoot)); // 执行上传并且插入数据库 this.documentUploadById(id, sourceFolderPath, targetFolderPath, storageSourceConfig.getValue()); - //开始执行更新表数据 名称是去掉后缀以后的 uploadProject(zipName); + LOGGER.info("开始更新表数据:{}", zipName); //获取文件路径 String path = storageSourceConfig.getValue() + decompressionPath; // 替换为实际路径 - File target = new File(path); + File targetZip = new File(String.valueOf(zipFilePath)); + File target = new File(String.valueOf(destRoot)); + //删除临时文件ZIP + deleteDirectory(targetZip); + //删除临时文件 deleteDirectory(target); } catch (IOException e) { throw new RuntimeException(e);