|
|
|
@ -332,7 +332,7 @@ public class YunXiao {
|
|
|
|
|
JSONObject jsonSource = jsonArrSource.getJSONObject(m);
|
|
|
|
|
|
|
|
|
|
// 解析日期时间字符串
|
|
|
|
|
String publishTimeStr= jsonSource.getString("publishTime");
|
|
|
|
|
String publishTimeStr = jsonSource.getString("publishTime");
|
|
|
|
|
LocalDateTime dateTime = LocalDateTime.parse(publishTimeStr,
|
|
|
|
|
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
LocalDate date = dateTime.toLocalDate();
|
|
|
|
@ -414,7 +414,7 @@ public class YunXiao {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static Set<String> getLessonAlreadyMatch() {
|
|
|
|
|
String sql = "select * from t_crawler_lesson_school";
|
|
|
|
|
String sql = "select * from t_crawler_lesson_school where match_type>0";
|
|
|
|
|
List<Record> list = Db.find(sql);
|
|
|
|
|
Set<String> set = new HashSet<>();
|
|
|
|
|
for (Record record : list) {
|
|
|
|
@ -493,6 +493,9 @@ public class YunXiao {
|
|
|
|
|
for (String table : tables) {
|
|
|
|
|
Db.update("truncate table " + table);
|
|
|
|
|
}
|
|
|
|
|
String sql = "delete from t_crawler_lesson_school where match_type=0;";
|
|
|
|
|
Db.update(sql);
|
|
|
|
|
|
|
|
|
|
// 保存数据
|
|
|
|
|
print("开始保存数据...");
|
|
|
|
|
Db.batchSave("t_crawler_subject", subjectList, batchSize);
|
|
|
|
@ -506,6 +509,10 @@ public class YunXiao {
|
|
|
|
|
List<Record> writeList = new ArrayList<>();
|
|
|
|
|
for (Record record : lessonList) {
|
|
|
|
|
String original_school_name = record.getStr("teacher_school_name");//原始学校名称
|
|
|
|
|
|
|
|
|
|
if (original_school_name.equals("东北师范大学东安实验学校")) {
|
|
|
|
|
System.out.println("Here!");
|
|
|
|
|
}
|
|
|
|
|
String teacher_name = record.getStr("teacher_name");
|
|
|
|
|
String organization_name = "";
|
|
|
|
|
String organization_no = "";
|
|
|
|
@ -513,6 +520,7 @@ public class YunXiao {
|
|
|
|
|
int match_type;
|
|
|
|
|
String lesson_id = record.getStr("lesson_id");
|
|
|
|
|
if (lessonAlreadyMatch.contains(lesson_id)) continue;//如果记录过此课程的学校关系,本次就不再记录了
|
|
|
|
|
|
|
|
|
|
if (bzSchoolNameList.containsKey(original_school_name)) {
|
|
|
|
|
//100%命中的名称
|
|
|
|
|
Kv kv = bzSchoolNameList.get(original_school_name);
|
|
|
|
@ -520,8 +528,8 @@ public class YunXiao {
|
|
|
|
|
organization_no = kv.getStr("organization_no");
|
|
|
|
|
gather_regionc = kv.getStr("gather_regionc");
|
|
|
|
|
match_type = 1;
|
|
|
|
|
} else if (handMatchSchoolList.containsKey(record.getStr("school_name"))) {//手动映射过的名称
|
|
|
|
|
Kv kv = handMatchSchoolList.get(record.getStr("school_name"));
|
|
|
|
|
} else if (handMatchSchoolList.containsKey(original_school_name)) {//手动映射过的名称
|
|
|
|
|
Kv kv = handMatchSchoolList.get(original_school_name);
|
|
|
|
|
organization_name = kv.getStr("organization_name");
|
|
|
|
|
organization_no = kv.getStr("organization_no");
|
|
|
|
|
gather_regionc = kv.getStr("gather_regionc");
|
|
|
|
|