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);