main
HuangHai 4 months ago
parent c6e219c4c0
commit c908478377

@ -1,5 +1,6 @@
{
"2019": {
"skipRows": 7,
"基教小学": {
"schoolName": {
"index": 1,

@ -19,6 +19,9 @@ import java.util.List;
import java.util.Map;
public class SchoolCountSummary {
// 配置文件
public static final String configPath = "D:/dsWork/YunNanDsBase/src/main/java/com/dsideal/base/Tools/JkyNewData/Data/SchoolCount.json";
public static final String excelPath = "D:/dsWork/2025年收集的人口与教育数据库20250328/2015-2020年的数据/基础教育";
public static void main(String[] args) throws FileNotFoundException {
// 一、关闭日志输出
@ -27,13 +30,12 @@ public class SchoolCountSummary {
// 二、初始化数据库连接
LocalMysqlConnectUtil.Init();
// 读取配置文件
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));
// 遍历年份
for (String year : config.keySet()) {
//表头的行数
int skipRows = config.getJSONObject(year).getIntValue("skipRows");
JSONObject yearConfig = config.getJSONObject(year);
String filePath = String.format(excelPath + "/%s.xlsx", year);
@ -57,7 +59,7 @@ public class SchoolCountSummary {
}
// 处理当前学校类型的数据
allResults.put(schoolType, processSheet(filePath, schoolType, 7, columnConfigs));
allResults.put(schoolType, processSheet(filePath, schoolType, skipRows, columnConfigs));
}
// 保存统计结果到数据库

Loading…
Cancel
Save