update 文档拆分表格

This commit is contained in:
lijiarao
2023-11-08 16:58:34 +08:00
parent 56722244b3
commit 0eb1d3e6ff
@@ -120,23 +120,23 @@ public class FileSpiltService {
// } else {
// nowStart.add(String.valueOf(sarFileSplitInfoEO.getStartNumber()));
// }
//获取文件地址
//String fileId = sarFileSplitInfoEO.getFileId();
//LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper();
//queryWrapper.eq(OSSFile::getId, fileId);
//queryWrapper.orderByDesc(OSSFile::getCreateTime);
//List<OSSFile> 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<OSSFile> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(OSSFile::getId, fileId);
queryWrapper.orderByDesc(OSSFile::getCreateTime);
List<OSSFile> 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);