main
黄海 8 months ago
parent f7ae8cc146
commit 567edf35d5

@ -62,8 +62,8 @@ public class C1 {
//1号模板数据在图表5和28中
int firstChartNumber = 5, secondChartNumber = 28;
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber, 1, 10);
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber-1, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber-1, 1, 10);
//遍历source1
for (List<String> r : source1) {

@ -69,9 +69,9 @@ public class C10 {
//数据在图表2,图3
int firstChartNumber = 2, secondChartNumber = 3;
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber, 6, 10);//从2017年开始
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber - 1, 6, 10);//从2017年开始
List<List<String>> source3 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber, 2, 10);
List<List<String>> source3 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber - 1, 2, 10);
;//从2023年开始
//遍历source1
@ -95,7 +95,7 @@ public class C10 {
for (List<String> r : source3) {
// 导出数据
//上级行政区划,行政区划,年份,城镇人口变化,城镇人口预测,乡村人口变化,乡村人口预测
int year = Integer.parseInt(r.getFirst());
int year = Integer.parseInt(r.getFirst().substring(0,4));
//城镇
double cvalue = 0;
if (!StrKit.isBlank(r.get(1))) cvalue = Double.parseDouble(r.get(1));
@ -105,7 +105,7 @@ public class C10 {
if (year >= 2023) {
Row outRow = outSheet.createRow(++rowIndex);
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList("云南省", cityName, r.getFirst(), "", String.format("%.2f", cvalue), "", String.format("%.2f", xvalue))), dataStyle);
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList("云南省", cityName, String.valueOf(year), "", String.format("%.2f", cvalue), "", String.format("%.2f", xvalue))), dataStyle);
}
}
}

@ -70,7 +70,7 @@ public class C11 {
int firstChartNumber = 36, secondChartNumber = 37;
//占地面积37
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber, 1, 10);
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber-1, 1, 10);
//年份,学前,小学,初中,高中
// 0 1 2 3 4
//所有相关2022基数的列都使用2022的数据
@ -83,7 +83,7 @@ public class C11 {
String gxjzg = firRow.get(4);//高中教职工2022基数
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber-1, 1, 10);
//年份,学前,小学,初中,高中
// 0 1 2 3 4
List<String> secRow = source2.getFirst();

@ -68,8 +68,8 @@ public class C2 {
//1号模板数据在图表6和29中
int firstChartNumber = 6, secondChartNumber = 29;
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber, 1, 10);
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber - 1, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber - 1, 1, 10);
String c2 = "总在园数";
//遍历source1

@ -95,8 +95,8 @@ public class C3 {
int firstChartNumber = listNode.get(q).getFirst(), secondChartNumber = listNode.get(q).getSecond();
String stageName=listNode.get(q).getStageName();
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber, 1, 10);
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber-1, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber-1, 1, 10);
String c2 = "总招生数";
//遍历source1

@ -93,8 +93,8 @@ public class C4 {
int firstChartNumber = listNode.get(q).getFirst(), secondChartNumber = listNode.get(q).getSecond();
String stageName=listNode.get(q).getStageName();
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber, 1, 10);
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber-1, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber-1, 1, 10);
String c2 = "总在校生";
//遍历source1

@ -67,8 +67,8 @@ public class C5 {
//读取文件
//1号模板数据在图表11和34中
int firstChartNumber = 11, secondChartNumber = 34;
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber, 1, 10);
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber-1, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber-1, 1, 10);
String c2 = "总招生数";
//遍历source1

@ -67,8 +67,8 @@ public class C6 {
//读取文件
//1号模板数据在图表12和35中
int firstChartNumber = 12, secondChartNumber = 35;
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber, 1, 10);
List<List<String>> source1 = ExcelKit.getChartData(file.getAbsolutePath(), firstChartNumber-1, 1, 10);
List<List<String>> source2 = ExcelKit.getChartData(file.getAbsolutePath(), secondChartNumber-1, 1, 10);
String c2 = "总在校生数";
//遍历source1

@ -71,7 +71,7 @@ public class C9 {
//chartNumber:第几个图表
//skipRowCount:跳过的行数,2017年开始,第一行是表头第二行开始是2022所以填写了跳过6行
//expectLimit:期望的数据行数,首先用POI进行解析如果获取的行数大于预期行数就是正确的否则就需要二次调用python进行读取
List<List<String>> source = ExcelKit.getChartData(file.getAbsolutePath(), chartNumber, 6, 20);
List<List<String>> source = ExcelKit.getChartData(file.getAbsolutePath(), chartNumber - 1, 6, 20);
//遍历source
for (List<String> r : source) {

Loading…
Cancel
Save