From 6c50871947c1c150781b2c7212912521b27e3959 Mon Sep 17 00:00:00 2001 From: huguanghan Date: Mon, 13 Jan 2025 17:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=87=E4=BB=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/service/impl/ExportTdDataServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/das/src/main/java/com/das/modules/data/service/impl/ExportTdDataServiceImpl.java b/das/src/main/java/com/das/modules/data/service/impl/ExportTdDataServiceImpl.java index 4bd1aecc..a9d9754b 100644 --- a/das/src/main/java/com/das/modules/data/service/impl/ExportTdDataServiceImpl.java +++ b/das/src/main/java/com/das/modules/data/service/impl/ExportTdDataServiceImpl.java @@ -1,5 +1,6 @@ package com.das.modules.data.service.impl; +import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ZipUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.das.modules.data.service.TDEngineService; @@ -9,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import org.springframework.util.StopWatch; import java.io.BufferedWriter; @@ -72,11 +74,11 @@ public class ExportTdDataServiceImpl { }catch (Exception e){ log.error("导出风机数据zip失败{}",e); } -// finally { -// if (!CollectionUtils.isEmpty(fileList)){ -// FileUtil.del(new File(fileList.get(0).getParent())); -// } -// } + finally { + if (!CollectionUtils.isEmpty(fileList)){ + FileUtil.del(new File(fileList.get(0).getParent())); + } + } }