|
|
|
@ -49,7 +49,8 @@ public class C9 {
|
|
|
|
|
workbook.close();
|
|
|
|
|
|
|
|
|
|
//如果达到目标预期的数量,就直接返回poi获取的数据列表
|
|
|
|
|
if (data.size() < expectLimit) {
|
|
|
|
|
int totalRow = data.size() + skipRowCount;
|
|
|
|
|
if (totalRow < expectLimit) {
|
|
|
|
|
System.out.println("数据不足,重新获取数据,现正在使用python_docx进行二次获取数据...");
|
|
|
|
|
//否则调用python+com进行再次获取数据列表,这次获取的可能才是对的
|
|
|
|
|
//写入交互文本文件
|
|
|
|
@ -98,20 +99,12 @@ public class C9 {
|
|
|
|
|
//判断是否为docx文件
|
|
|
|
|
if (fileName.endsWith(".docx") && !fileName.startsWith("~")) {
|
|
|
|
|
System.out.println("正在处理" + cityName + "市州文件...");
|
|
|
|
|
//读取文件
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//数据在图表1
|
|
|
|
|
int firstChartNumber = 1;
|
|
|
|
|
List<List<String>> source1 = getChartData(file.getAbsolutePath(), firstChartNumber, 6,20);//2017年开始
|
|
|
|
|
|
|
|
|
|
if (cityName.contains("丽江")) {
|
|
|
|
|
System.out.println("丽江");
|
|
|
|
|
System.out.println(source1);
|
|
|
|
|
}
|
|
|
|
|
int chartNumber = 1;
|
|
|
|
|
List<List<String>> source = getChartData(file.getAbsolutePath(), chartNumber, 6, 20);//2017年开始
|
|
|
|
|
|
|
|
|
|
//遍历source1
|
|
|
|
|
for (List<String> r : source1) {
|
|
|
|
|
for (List<String> r : source) {
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
// 导出数据
|
|
|
|
|
//上级行政区划,行政区划,年份,总人口变化,总人口预测
|
|
|
|
|