main
黄海 8 months ago
parent 7da66f6186
commit 25f4887245

@ -356,7 +356,7 @@ public class DsKit {
*/ */
public static List<List<String>> getChartData(String docPath, int chartNumber, int skipRowCount) throws IOException, DocumentException, InterruptedException, InvalidFormatException { public static List<List<String>> getChartData(String docPath, int chartNumber, int skipRowCount) throws IOException, DocumentException, InterruptedException, InvalidFormatException {
DsKit.unCompress(docPath); DsKit.unCompress(docPath);
List<List<String>> data = readChartByXml(docPath, chartNumber); List<List<String>> data = readChart(docPath, chartNumber);
//需要跳过前skipRowCount行先要判断一下是不是够跳的不够跳的直接输出错误 //需要跳过前skipRowCount行先要判断一下是不是够跳的不够跳的直接输出错误
if (data.size() < skipRowCount) { if (data.size() < skipRowCount) {
return null; return null;
@ -522,7 +522,7 @@ public class DsKit {
* *
* @param chartNumber * @param chartNumber
*/ */
public static List<List<String>> readChartByXml(String sourceDoc, int chartNumber) throws DocumentException, IOException { public static List<List<String>> readChart(String sourceDoc, int chartNumber) throws DocumentException, IOException {
//将word文件解压缩 //将word文件解压缩
unCompress(sourceDoc); unCompress(sourceDoc);
List<List<String>> matrix = new ArrayList<>(); List<List<String>> matrix = new ArrayList<>();
@ -531,7 +531,7 @@ public class DsKit {
System.out.println(sourceDoc + " 没有找到第" + chartNumber + "个图表"); System.out.println(sourceDoc + " 没有找到第" + chartNumber + "个图表");
return matrix; return matrix;
} }
return readChartByXml(xml); return readChart(xml);
} }
/** /**
@ -562,7 +562,7 @@ public class DsKit {
* @return * @return
* @throws DocumentException * @throws DocumentException
*/ */
public static List<List<String>> readChartByXml(String xmlPath) throws DocumentException { public static List<List<String>> readChart(String xmlPath) throws DocumentException {
//图表类型 //图表类型
String[] CHART_TYPES = {"lineChart", "barChart"};//折线,柱状 String[] CHART_TYPES = {"lineChart", "barChart"};//折线,柱状

Loading…
Cancel
Save