|
|
|
@ -0,0 +1,93 @@
|
|
|
|
|
package com.YunXiao;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
|
|
import cn.hutool.core.io.file.FileWriter;
|
|
|
|
|
import com.YunXiao.Dict.Const;
|
|
|
|
|
import com.YunXiao.Model.BaseModel;
|
|
|
|
|
import com.YunXiao.Model.ResourceModel;
|
|
|
|
|
import com.YunXiao.Util.SyncUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.aspose.words.DocumentBuilder;
|
|
|
|
|
import com.jfinal.kit.PropKit;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
import org.apache.commons.mail.EmailAttachment;
|
|
|
|
|
import org.apache.commons.mail.EmailException;
|
|
|
|
|
import org.apache.commons.mail.HtmlEmail;
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileReader;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.time.Instant;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.ZoneId;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.ExecutionException;
|
|
|
|
|
|
|
|
|
|
import static com.YunXiao.Util.SyncUtil.resourceHandleTool;
|
|
|
|
|
|
|
|
|
|
public class Study {
|
|
|
|
|
//Model层的实例,在此层,不允许调用Dao层,只能对接Model层
|
|
|
|
|
public static BaseModel bm;
|
|
|
|
|
//结果
|
|
|
|
|
public static Map<String, Integer> res = new HashMap<>();
|
|
|
|
|
public static List<JSONObject> jBureauList;
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
|
//初始化
|
|
|
|
|
SyncUtil.init();
|
|
|
|
|
// //获取所有机构和学校
|
|
|
|
|
// String org_id = Const.CcOrgId;
|
|
|
|
|
// JSONArray ja = getChildList(org_id, -1).getJSONArray("result");
|
|
|
|
|
// List<JSONObject> jList = new ArrayList<>();
|
|
|
|
|
// for (int i = 0; i < ja.size(); i++) {
|
|
|
|
|
// jList.add(ja.getJSONObject(i));
|
|
|
|
|
// }
|
|
|
|
|
// List<JSONObject> j2List = batchBureauList(jList);
|
|
|
|
|
// for (JSONObject jo : j2List) {
|
|
|
|
|
// System.out.println(jo.getString("area_code"));
|
|
|
|
|
// System.out.println(jo.getString("org_id"));
|
|
|
|
|
// System.out.println(jo.getString("org_name"));
|
|
|
|
|
// System.out.println(jo.getString("org_category_title"));
|
|
|
|
|
// System.out.println();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//初始化
|
|
|
|
|
bm = new BaseModel();
|
|
|
|
|
|
|
|
|
|
//删除天喻的所有临时表
|
|
|
|
|
SyncUtil.delAllTable();
|
|
|
|
|
|
|
|
|
|
//获取所有机构+学校
|
|
|
|
|
jBureauList = bm.getBureauList();
|
|
|
|
|
|
|
|
|
|
//可以采用定时获取的办法,防止每次使用时调用太慢
|
|
|
|
|
List<JSONObject> list = bm.batchBureauList(jBureauList);
|
|
|
|
|
|
|
|
|
|
System.out.println(list);
|
|
|
|
|
//2、获取指定机构(学校)下的部门信息
|
|
|
|
|
// batchOrgList();
|
|
|
|
|
//
|
|
|
|
|
// //3、获取指定机构(学校)下的教师信息
|
|
|
|
|
// getTeacherList();
|
|
|
|
|
//
|
|
|
|
|
// //4、获取指定机构(学校)下的班级
|
|
|
|
|
// getClasstList();
|
|
|
|
|
//
|
|
|
|
|
// //5、获取指定机构(学校)下的学生信息
|
|
|
|
|
// getStudentList();
|
|
|
|
|
//
|
|
|
|
|
// //处理年级数据
|
|
|
|
|
// handleGrade();
|
|
|
|
|
|
|
|
|
|
// 关闭连接
|
|
|
|
|
if (SyncUtil.conn != null && !SyncUtil.conn.isClosed()) SyncUtil.conn.close();
|
|
|
|
|
}
|
|
|
|
|
}
|