From 0eb1d3e6ffe5e157a637e94bbc0b410fadb86949 Mon Sep 17 00:00:00 2001 From: lijiarao Date: Wed, 8 Nov 2023 16:58:34 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=96=87=E6=A1=A3=E6=8B=86=E5=88=86?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../split/service/impl/FileSpiltService.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) 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 e11da775..0fbd9b88 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 @@ -120,23 +120,23 @@ public class FileSpiltService { // } else { // nowStart.add(String.valueOf(sarFileSplitInfoEO.getStartNumber())); // } - //获取文件地址 - //String fileId = sarFileSplitInfoEO.getFileId(); - //LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); - //queryWrapper.eq(OSSFile::getId, fileId); - //queryWrapper.orderByDesc(OSSFile::getCreateTime); - //List ossFileList = iossFileService.list(queryWrapper); - //if (CollectionUtils.isEmpty(ossFileList)) { - // throw new JeroBootException("当前文件未找到,请重新选择!"); - //} - //OSSFile ossFile = ossFileList.get(0); - //String readFilePath = ossFile.getUrl(); - //if (StringUtils.isEmpty(readFilePath) || !MinioUtil.doesObjectExist(readFilePath)) { - // throw new JeroBootException("当前文件未找到,请重新选择!"); - //} - //try (InputStream is = MinioUtil.download(readFilePath);InputStream is1 = MinioUtil.download(readFilePath)) { - String readFilePath = "E:\\Data\\Downloads\\wordtest\\GB7258标准修订test - 表格测试 - 副本.docx"; - try (InputStream is = new FileInputStream(readFilePath); InputStream is1 = new FileInputStream(readFilePath)) {//需要将文件路更改为word文档所在路径。 +// 获取文件地址 + String fileId = sarFileSplitInfoEO.getFileId(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(OSSFile::getId, fileId); + queryWrapper.orderByDesc(OSSFile::getCreateTime); + List ossFileList = iossFileService.list(queryWrapper); + if (CollectionUtils.isEmpty(ossFileList)) { + throw new JeroBootException("当前文件未找到,请重新选择!"); + } + OSSFile ossFile = ossFileList.get(0); + String readFilePath = ossFile.getUrl(); + if (StringUtils.isEmpty(readFilePath) || !MinioUtil.doesObjectExist(readFilePath)) { + throw new JeroBootException("当前文件未找到,请重新选择!"); + } + try (InputStream is = MinioUtil.download(readFilePath);InputStream is1 = MinioUtil.download(readFilePath)) { + //String 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);