|
|
|
@ -411,31 +411,7 @@ public class YunXiao {
|
|
|
|
|
return set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
// 初始化数据库连接
|
|
|
|
|
PropKit.use("application.properties");
|
|
|
|
|
HikariCpPlugin hp = new HikariCpPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"),
|
|
|
|
|
PropKit.get("password").trim(), PropKit.get("driverClassName"));
|
|
|
|
|
hp.start();
|
|
|
|
|
ActiveRecordPlugin arp = new ActiveRecordPlugin(hp);
|
|
|
|
|
arp.setContainerFactory(new CaseInsensitiveContainerFactory(true));
|
|
|
|
|
arp.setDialect(new PostgreSqlDialect());
|
|
|
|
|
|
|
|
|
|
String basePath = Start.class.getClassLoader().getResource(".").getPath();
|
|
|
|
|
File sqlDir = new File(basePath + "/Sql");
|
|
|
|
|
File[] sqlFiles = sqlDir.listFiles();
|
|
|
|
|
File[] var10 = sqlFiles != null ? sqlFiles : new File[0];
|
|
|
|
|
int var11 = var10.length;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < var11; ++i) {
|
|
|
|
|
File sqlFile = var10[i];
|
|
|
|
|
if (sqlFile.getName().indexOf(".sql") > 0) {
|
|
|
|
|
arp.addSqlTemplate("/Sql/" + sqlFile.getName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
arp.start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void Start() {
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
|
|
map.put("1", "学前");
|
|
|
|
|
map.put("2", "小学");
|
|
|
|
@ -518,7 +494,7 @@ public class YunXiao {
|
|
|
|
|
List<Record> writeList = new ArrayList<>();
|
|
|
|
|
for (Record record : lessonList) {
|
|
|
|
|
String original_school_name = record.getStr("teacher_school_name");//原始学校名称
|
|
|
|
|
String teacher_name= record.getStr("teacher_name");
|
|
|
|
|
String teacher_name = record.getStr("teacher_name");
|
|
|
|
|
String organization_name = "";
|
|
|
|
|
String organization_no = "";
|
|
|
|
|
String gather_regionc = "";
|
|
|
|
@ -566,4 +542,31 @@ public class YunXiao {
|
|
|
|
|
long endTime = System.currentTimeMillis();
|
|
|
|
|
print("爬取数据耗时:" + (endTime - startTime) / 1000 + "秒");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
// 初始化数据库连接
|
|
|
|
|
PropKit.use("application.properties");
|
|
|
|
|
HikariCpPlugin hp = new HikariCpPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"),
|
|
|
|
|
PropKit.get("password").trim(), PropKit.get("driverClassName"));
|
|
|
|
|
hp.start();
|
|
|
|
|
ActiveRecordPlugin arp = new ActiveRecordPlugin(hp);
|
|
|
|
|
arp.setContainerFactory(new CaseInsensitiveContainerFactory(true));
|
|
|
|
|
arp.setDialect(new PostgreSqlDialect());
|
|
|
|
|
|
|
|
|
|
String basePath = Start.class.getClassLoader().getResource(".").getPath();
|
|
|
|
|
File sqlDir = new File(basePath + "/Sql");
|
|
|
|
|
File[] sqlFiles = sqlDir.listFiles();
|
|
|
|
|
File[] var10 = sqlFiles != null ? sqlFiles : new File[0];
|
|
|
|
|
int var11 = var10.length;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < var11; ++i) {
|
|
|
|
|
File sqlFile = var10[i];
|
|
|
|
|
if (sqlFile.getName().indexOf(".sql") > 0) {
|
|
|
|
|
arp.addSqlTemplate("/Sql/" + sqlFile.getName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
arp.start();
|
|
|
|
|
//爬虫开始
|
|
|
|
|
Start();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|