|
|
|
@ -50,6 +50,7 @@ public class A1 {
|
|
|
|
|
//找到parentPath下一级目录中所有文件
|
|
|
|
|
List<File> files = FileUtil.loopFiles(parentPath, file -> true);
|
|
|
|
|
int rowIndex = 0;
|
|
|
|
|
String[] excludeCityList = {"~$", "磨憨-磨丁", "经开区", "阳宗海"};
|
|
|
|
|
//处理这个目录
|
|
|
|
|
if (files != null) {
|
|
|
|
|
for (File file : files) {
|
|
|
|
@ -57,6 +58,16 @@ public class A1 {
|
|
|
|
|
if (file.isDirectory()) continue;
|
|
|
|
|
if (!file.getName().endsWith(".xlsx") && !file.getName().endsWith(".xls"))
|
|
|
|
|
continue;
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
for (String s : excludeCityList) {
|
|
|
|
|
if (file.getName().contains(s)) {
|
|
|
|
|
flag = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag) continue;
|
|
|
|
|
//只关心发展规模数据的表格
|
|
|
|
|
if (!file.getName().contains("发展规模数据")) continue;
|
|
|
|
|
|
|
|
|
|
//县区名称
|
|
|
|
|
String areaName = ru.getCityOrAreaName(file.getName());
|
|
|
|
@ -87,6 +98,7 @@ public class A1 {
|
|
|
|
|
//入园总数
|
|
|
|
|
for (List<String> stringList : dataList) {
|
|
|
|
|
//年份
|
|
|
|
|
if (stringList.isEmpty() || StrKit.isBlank(stringList.get(0))) break;
|
|
|
|
|
int year = Integer.parseInt(stringList.get(0));
|
|
|
|
|
//3预测总招生数
|
|
|
|
|
int zss = Integer.parseInt(stringList.get(3).split("\\.")[0]);
|
|
|
|
@ -95,54 +107,54 @@ public class A1 {
|
|
|
|
|
"总入园数", "", String.valueOf(zss), "", areaName, cityName), dataStyle);
|
|
|
|
|
}
|
|
|
|
|
//2022入园基数
|
|
|
|
|
for (List<String> ignored : dataList) {
|
|
|
|
|
//年份
|
|
|
|
|
int year = 2022;
|
|
|
|
|
//3预测总招生数
|
|
|
|
|
int zss = Integer.parseInt(dataList.getFirst().get(3).split("\\.")[0]);
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
ExcelKit.putData(outRow, Arrays.asList(String.valueOf(year),
|
|
|
|
|
"2022年基数", "", String.valueOf(zss), "", areaName, cityName), dataStyle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//城区
|
|
|
|
|
for (List<String> stringList : dataList) {
|
|
|
|
|
//年份
|
|
|
|
|
int year = Integer.parseInt(stringList.get(0));
|
|
|
|
|
//4修正城区招生A
|
|
|
|
|
int v = Integer.parseInt(stringList.get(4).split("\\.")[0]);
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
ExcelKit.putData(outRow, Arrays.asList(String.valueOf(year),
|
|
|
|
|
"", "城区", "", String.valueOf(v), areaName, cityName), dataStyle);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//镇区
|
|
|
|
|
for (List<String> stringList : dataList) {
|
|
|
|
|
//年份
|
|
|
|
|
int year = Integer.parseInt(stringList.get(0));
|
|
|
|
|
|
|
|
|
|
int v = Integer.parseInt(stringList.get(5).split("\\.")[0]);
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
ExcelKit.putData(outRow, Arrays.asList(String.valueOf(year),
|
|
|
|
|
"", "镇区", "", String.valueOf(v), areaName, cityName), dataStyle);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//乡村
|
|
|
|
|
for (List<String> stringList : dataList) {
|
|
|
|
|
//年份
|
|
|
|
|
int year = Integer.parseInt(stringList.get(0));
|
|
|
|
|
int v = Integer.parseInt(stringList.get(5).split("\\.")[0]);
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
ExcelKit.putData(outRow, Arrays.asList(String.valueOf(year),
|
|
|
|
|
"", "乡村", "", String.valueOf(v), areaName, cityName), dataStyle);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// for (List<String> ignored : dataList) {
|
|
|
|
|
// //年份
|
|
|
|
|
// int year = 2022;
|
|
|
|
|
// //3预测总招生数
|
|
|
|
|
// int zss = Integer.parseInt(dataList.getFirst().get(3).split("\\.")[0]);
|
|
|
|
|
// Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
// ExcelKit.putData(outRow, Arrays.asList(String.valueOf(year),
|
|
|
|
|
// "2022年基数", "", String.valueOf(zss), "", areaName, cityName), dataStyle);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// //城区
|
|
|
|
|
// for (List<String> stringList : dataList) {
|
|
|
|
|
// //年份
|
|
|
|
|
// int year = Integer.parseInt(stringList.get(0));
|
|
|
|
|
// //4修正城区招生A
|
|
|
|
|
// int v = Integer.parseInt(stringList.get(4).split("\\.")[0]);
|
|
|
|
|
// Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
// ExcelKit.putData(outRow, Arrays.asList(String.valueOf(year),
|
|
|
|
|
// "", "城区", "", String.valueOf(v), areaName, cityName), dataStyle);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// //镇区
|
|
|
|
|
// for (List<String> stringList : dataList) {
|
|
|
|
|
// //年份
|
|
|
|
|
// int year = Integer.parseInt(stringList.get(0));
|
|
|
|
|
//
|
|
|
|
|
// int v = Integer.parseInt(stringList.get(5).split("\\.")[0]);
|
|
|
|
|
// Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
// ExcelKit.putData(outRow, Arrays.asList(String.valueOf(year),
|
|
|
|
|
// "", "镇区", "", String.valueOf(v), areaName, cityName), dataStyle);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// //乡村
|
|
|
|
|
// for (List<String> stringList : dataList) {
|
|
|
|
|
// //年份
|
|
|
|
|
// int year = Integer.parseInt(stringList.get(0));
|
|
|
|
|
// int v = Integer.parseInt(stringList.get(5).split("\\.")[0]);
|
|
|
|
|
// Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
// ExcelKit.putData(outRow, Arrays.asList(String.valueOf(year),
|
|
|
|
|
// "", "乡村", "", String.valueOf(v), areaName, cityName), dataStyle);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//保存文件
|
|
|
|
|
ExcelKit.saveExcel(excelPath, outWorkbook);
|
|
|
|
|
System.out.println("市州所有文件处理完成!");
|
|
|
|
|
System.out.println("县区所有文件处理完成!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|