|
|
|
@ -2,6 +2,7 @@ package com.dsideal.base.Tools.FillData.ExcelKit;
|
|
|
|
|
|
|
|
|
|
import com.dsideal.base.DataEase.Model.ExcelReader;
|
|
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
|
|
|
import org.apache.poi.openxml4j.util.ZipSecureFile;
|
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
@ -542,7 +543,10 @@ public class ExcelKit {
|
|
|
|
|
*
|
|
|
|
|
* @throws IOException
|
|
|
|
|
*/
|
|
|
|
|
public static void UnCompress(String wordPath) throws IOException {
|
|
|
|
|
private static void UnCompress(String wordPath) throws IOException {
|
|
|
|
|
if (new File(DocxUnzipDirectory).exists()) {
|
|
|
|
|
FileUtils.deleteDirectory(new File(DocxUnzipDirectory));
|
|
|
|
|
}
|
|
|
|
|
File file = new File(wordPath);//取得word文件
|
|
|
|
|
FileInputStream inputStream = new FileInputStream(file);
|
|
|
|
|
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
|
|
|
|
@ -578,7 +582,10 @@ public class ExcelKit {
|
|
|
|
|
*
|
|
|
|
|
* @param chartNumber
|
|
|
|
|
*/
|
|
|
|
|
public static List<List<String>> readChart(int chartNumber) throws DocumentException {
|
|
|
|
|
public static List<List<String>> readChart(String sourceDoc, int chartNumber) throws DocumentException, IOException {
|
|
|
|
|
//将word文件解压缩
|
|
|
|
|
UnCompress(sourceDoc);
|
|
|
|
|
|
|
|
|
|
List<List<String>> matrix = new ArrayList<>();
|
|
|
|
|
String xml = DocxUnzipDirectory + "word\\charts\\chart" + chartNumber + ".xml";
|
|
|
|
|
if (!(new File(xml).exists())) {
|
|
|
|
|