From 5216e2ea24d8532a0bc0074738966d530e023db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Mon, 25 Sep 2023 14:47:27 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=96=87=E6=A1=A3=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarFileSplitInfoController.java | 20 ++++++++++--------- .../split/service/impl/FileSpiltService.java | 18 ++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/split/controller/SarFileSplitInfoController.java b/laws-modules/src/main/java/com/jero/modules/split/controller/SarFileSplitInfoController.java index 7475b37d..84d5a861 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/controller/SarFileSplitInfoController.java +++ b/laws-modules/src/main/java/com/jero/modules/split/controller/SarFileSplitInfoController.java @@ -136,15 +136,17 @@ public class SarFileSplitInfoController extends JeroController add(@RequestBody SarFileSplitInfoEO sarFileSplitInfoEO) { - String id = sarFileSplitInfoEO.getId(); - if (StringUtils.isBlank(id)){ - throw new JeroBootException("请选择文本!"); - } - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(SarFileSplitInfoEO::getFileId, id); - wrapper.last("limit 1"); - SarFileSplitInfoEO splitInfoEO = sarFileSplitInfoService.getOne(wrapper); - sarFileSplitInfoService.add(splitInfoEO); +// String id = sarFileSplitInfoEO.getId(); +// if (StringUtils.isBlank(id)){ +// throw new JeroBootException("请选择文本!"); +// } +// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); +// wrapper.eq(SarFileSplitInfoEO::getFileId, id); +// wrapper.last("limit 1"); +// SarFileSplitInfoEO splitInfoEO = sarFileSplitInfoService.getOne(wrapper); + sarFileSplitInfoEO.setStartNumber(0); + sarFileSplitInfoEO.setStopNumber(0); + sarFileSplitInfoService.add(sarFileSplitInfoEO); return Result.OK("添加成功!"); } diff --git a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java index f2ab7ea3..d87500f5 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java +++ b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java @@ -128,13 +128,13 @@ public class FileSpiltService { // } //获取文件地址 String connectId = sarFileSplitInfoEO.getConnectId(); - String fileName = sarFileSplitInfoEO.getFileName(); - if (StringUtils.isEmpty(connectId) || StringUtils.isEmpty(fileName)) { - throw new JeroBootException("当前文件未找到,请重新选择!"); - } + String fileId = sarFileSplitInfoEO.getFileId(); +// if (StringUtils.isEmpty(connectId) || StringUtils.isEmpty(fileName)) { +// throw new JeroBootException("当前文件未找到,请重新选择!"); +// } LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); - queryWrapper.eq(OSSFile::getConnectId, connectId); - queryWrapper.eq(OSSFile::getFileName, fileName); +// queryWrapper.eq(OSSFile::getConnectId, connectId); + queryWrapper.eq(OSSFile::getId, fileId); queryWrapper.orderByDesc(OSSFile::getCreateTime); List ossFileList = iossFileService.list(queryWrapper); if (CollectionUtils.isEmpty(ossFileList)) { @@ -147,9 +147,9 @@ public class FileSpiltService { throw new JeroBootException("当前文件未找到,请重新选择!"); } - //try (InputStream is = MinioUtil.download(readFilePath);InputStream is1 = MinioUtil.download(readFilePath)) { - readFilePath = "E:\\Data\\Downloads\\wordtest\\GB7258标准修订test - 表格测试 - 副本.docx"; - try (InputStream is = new FileInputStream(readFilePath);InputStream is1 = new FileInputStream(readFilePath)) {//需要将文件路更改为word文档所在路径。 + try (InputStream is = MinioUtil.download(readFilePath);InputStream is1 = MinioUtil.download(readFilePath)) { +// readFilePath = "E:\\Data\\Downloads\\wordtest\\GB7258标准修订test - 表格测试 - 副本.docx"; +// try (InputStream is = new FileInputStream(readFilePath);InputStream is1 = new FileInputStream(readFilePath)) {//需要将文件路更改为word文档所在路径。 ZipSecureFile.setMinInflateRatio(-1.0d); XWPFDocument doc = new XWPFDocument(is);