|
|
|
@ -28,17 +28,22 @@ public class SchoolCountSummary {
|
|
|
|
|
LocalMysqlConnectUtil.Init();
|
|
|
|
|
|
|
|
|
|
// 读取配置文件
|
|
|
|
|
String configPath = "D:/dsWork/YunNanDsBase/src/main/java/com/dsideal/base/Tools/Excel/Data/SchoolCount.json";
|
|
|
|
|
String configPath = "D:/dsWork/YunNanDsBase/src/main/java/com/dsideal/base/Tools/JkyNewData/Data/SchoolCount.json";
|
|
|
|
|
String excelPath = "D:/dsWork/2025年收集的人口与教育数据库(20250328)/2015-2020年的数据/基础教育";
|
|
|
|
|
JSONObject config = JSON.parseObject(new FileReader(configPath));
|
|
|
|
|
|
|
|
|
|
String filePath = "D:/dsWork/2025年收集的人口与教育数据库(20250328)/2015-2020年的数据/基础教育/2019.xlsx";
|
|
|
|
|
// 遍历年份
|
|
|
|
|
for (String year : config.keySet()) {
|
|
|
|
|
JSONObject yearConfig = config.getJSONObject(year);
|
|
|
|
|
String filePath = String.format(excelPath + "/%s.xlsx", year);
|
|
|
|
|
|
|
|
|
|
// 创建一个Map来存储所有处理结果
|
|
|
|
|
Map<String, Map<String, Map<String, Integer>>> allResults = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
// 循环处理每种学校类型
|
|
|
|
|
for (String schoolType : config.keySet()) {
|
|
|
|
|
for (String schoolType : yearConfig.keySet()) {
|
|
|
|
|
// 获取当前学校类型的配置
|
|
|
|
|
JSONObject typeConfig = config.getJSONObject(schoolType);
|
|
|
|
|
JSONObject typeConfig = yearConfig.getJSONObject(schoolType);
|
|
|
|
|
Map<String, ColumnConfig> columnConfigs = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
// 转换配置为ColumnConfig对象
|
|
|
|
@ -57,7 +62,8 @@ public class SchoolCountSummary {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 保存统计结果到数据库
|
|
|
|
|
saveToDatabase(allResults, 2019);
|
|
|
|
|
saveToDatabase(allResults, Integer.parseInt(year));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|