From 274a231c904060b0618f425471b93ca7f7fcca1d Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Fri, 28 Apr 2023 18:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=99=E6=96=87=E4=BB=B6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sale/admin/thread/DlAllDataService.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java index 5cc71e7..8bc00fe 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java @@ -268,12 +268,15 @@ public class DlAllDataService { } if (StrUtil.isNotBlank(bean.getTaskId())) { // 将数据写入文件 - try { - this.writeFile(bean.getFilePath(), bean.getFileContent()); - } catch (IOException e) { - log.error("从UDI自助平台拉取基础数据 文件[{}]写入异常----{}",bean.getFilePath(), e.getMessage()); - throw new RuntimeException(e); - } +// try { + + FileUtils.makeDirectory(filePath + "sync/"); + String fileName = filePath + "sync/" + exportType.getRemark() + "-" + bean.getTaskId() + ".udi"; + FileUtils.SaveFileAs(bean.getFileContent(), fileName); +// } catch (IOException e) { +// log.error("从UDI自助平台拉取基础数据 文件[{}]写入异常----{}",bean.getFilePath(), e.getMessage()); +// throw new RuntimeException(e); +// } BasicExportStatusEntity exportStatusEntity = BasicExportStatusEntity.builder() .id(bean.getTaskId()) @@ -295,7 +298,7 @@ public class DlAllDataService { } private void writeFile(String filePath, String content) throws IOException { - String folder = filePath.substring(filePath.lastIndexOf('/')); + String folder = filePath.substring(0,filePath.lastIndexOf('/')-1); File file = new File(folder); if (!file.exists()) { file.mkdirs();