Pārlūkot izejas kodu

课表数据同步逻辑调整

dzx 2 mēneši atpakaļ
vecāks
revīzija
f2c608feeb

+ 120 - 0
src/main/java/com/xjrsoft/module/activity/vo/ActivityInfoTodayVo.java

@@ -0,0 +1,120 @@
+package com.xjrsoft.module.activity.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 活动信息分页列表出参
+* @Author dzx
+* @Date: 2024-07-19
+* @Version 1.0
+*/
+@Data
+public class ActivityInfoTodayVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private String id;
+    /**
+    * 赛事名称
+    */
+    @ApiModelProperty("活动名称")
+    private String name;
+    /**
+    * 活动地点
+    */
+    @ApiModelProperty("活动地点")
+    private String place;
+    /**
+    * 活动开始时间
+    */
+    @ApiModelProperty("开始时间")
+    private String startDate;
+    /**
+    * 活动结束时间
+    */
+    @ApiModelProperty("结束时间")
+    private String endDate;
+    /**
+    * 活动类型(xjr_dictionary_detail[match_activity_type])
+    */
+    @ApiModelProperty("活动类型(xjr_dictionary_detail[match_activity_type])")
+    private String type;
+
+    @ApiModelProperty("活动类型-中文")
+    private String typeCn;
+    /**
+    * 组织部门(xjr_department)
+    */
+    @ApiModelProperty("组织部门(xjr_department)")
+    private Long orgId;
+
+    @ApiModelProperty("组织部门名称")
+    private String orgCn;
+    /**
+    * 报名结束时间
+    */
+    @ApiModelProperty("报名结束时间")
+    private Date enrollEndTime;
+    /**
+    * 活动负责人
+    */
+    @ApiModelProperty("活动负责人")
+    private String dutyPerson;
+    /**
+    * 活动负责人电话
+    */
+    @ApiModelProperty("活动负责人电话")
+    private String dutyPersonMobile;
+    /**
+    * 封面图片
+    */
+    @ApiModelProperty("封面图片")
+    private String coverFileId;
+
+    @ApiModelProperty("封面图片地址")
+    private String coverFileUrl;
+    /**
+    * 报名范围
+    */
+    @ApiModelProperty("报名范围")
+    private String enrollRange;
+    /**
+    * 状态(0:未发布 1:报名中 2:报名结束 3:活动结束)
+    */
+    @ApiModelProperty("状态(0:未发布 1:报名中 2:报名结束 3:活动结束)")
+    private Integer status;
+    /**
+    * 活动内容
+    */
+    @ApiModelProperty("活动内容")
+    private String content;
+    /**
+    * 合作企业
+    */
+    @ApiModelProperty("合作企业")
+    private Long enterpriseId;
+    /**
+    * 1:校企合作活动 2:赛事活动 3:社团活动 4:思政德育活动 5:教研培训 6:党建活动
+    */
+    @ApiModelProperty("1:校企合作活动 2:赛事活动 3:社团活动 4:思政德育活动 5:教研培训 6:党建活动 7:课表数据 8:会议")
+    private Integer category;
+
+    @ApiModelProperty("合作企业名称")
+    private String enterpriseName;
+
+    @ApiModelProperty("报名人数")
+    private Integer enrollCount;
+
+
+    @ApiModelProperty("是否已报名(1:是 0:否)")
+    private Integer isEnroll;
+
+    @ApiModelProperty("参与状态(0:待确认 1:未参与 2:已参与)")
+    private Integer enrollStatus;
+
+}

+ 10 - 2
src/main/java/com/xjrsoft/module/job/JianyuekbScheduleTask.java

@@ -49,11 +49,19 @@ public class JianyuekbScheduleTask {
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DataUtil dataUtil = new DataUtil();
         //查询出传入排课系统的年级和班级
-        sql = "SELECT * FROM jianyue_data WHERE source_id IS NOT NULL AND jianyue_id != '' and table_name = 'base_grade'";
+        List<String> eduYearSerialNo1 = receiveMsgs.stream().map(x -> "'" + x.get("edu_year_serial_no").toString() + "'").collect(Collectors.toList());
+
+        //查询出传入排课系统的年级和班级
+        sql = "SELECT * FROM jianyue_data WHERE source_id IS NOT NULL AND jianyue_id != ''" +
+                " and table_name = 'base_grade'" +
+                " and jianyue_id in (" + eduYearSerialNo1.toString().replace("[","").replace("]","") + ")";
         List<Map<String, Object>> jianyueData = SqlRunnerAdapter.db().selectList(sql);
         Map<String, List<Long>> gradeClassMaps = new HashMap<>();//存入对应年级的所有班级id
         for (Map<String, Object> el : jianyueData) {
-            String gradeId = el.get("source_id").toString().split("_")[1];
+            String gradeId = el.get("source_id").toString();
+            if(gradeId.contains("_")){
+                gradeId = el.get("source_id").toString().split("_")[1];
+            }
             List<BaseClass> classList = classService.list(new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getGradeId, gradeId));
             List<Long> classIds = classList.stream().map(BaseClass::getId).collect(Collectors.toList());
 

+ 1 - 1
src/main/resources/application.yml

@@ -5,7 +5,7 @@ server:
 spring:
   # 环 io境 dev|pre|prod
   profiles:
-    active: dev
+    active: pre
   # jackson时间格式化
   jackson:
     time-zone: GMT+8

+ 75 - 0
src/main/resources/sqlScript/20240822_sql.sql

@@ -0,0 +1,75 @@
+ALTER TABLE `whitelist_management`   
+  ADD COLUMN `is_temporary` INT DEFAULT 0  NULL   COMMENT '是否临时性的(1:是 0:否)' AFTER `phone`,
+  ADD COLUMN `start_time` DATE NULL   COMMENT '临时使用开始时间' AFTER `is_temporary`,
+  ADD COLUMN `end_time` DATE NULL   COMMENT '临时使用结束时间' AFTER `start_time`;
+  
+ALTER TABLE `teaching_quality_evaluation`   
+  CHANGE `course_code` `course_code` VARCHAR(255) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL   COMMENT '课程编号',
+  CHANGE `course_type` `course_type` VARCHAR(255) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL   COMMENT '课程分类';
+
+DROP TABLE IF EXISTS `wf_overtime_long`;
+CREATE TABLE `wf_overtime_long`  (
+  `id` BIGINT NOT NULL,
+  `user_id` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '申请人',
+  `overtime_department` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '加班部门',
+  `overtime_start_time` DATETIME NULL DEFAULT NULL COMMENT '加班开始时间',
+  `overtime_end_time` DATETIME NULL DEFAULT NULL COMMENT '加班结束时间',
+  `overtime_template` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '加班明细模板',
+  `supporting_materials` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '加班明细附件',
+  `leader_in_charge` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '分管领导',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = INNODB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '加班申请(长)' ROW_FORMAT = DYNAMIC; 
+
+
+DROP TABLE IF EXISTS `student_report_record`;
+CREATE TABLE `student_report_record`  (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATETIME DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `user_id` BIGINT DEFAULT NULL COMMENT '学生id',
+  `report_time` DATETIME DEFAULT NULL COMMENT '报到时间',
+  `base_semester_id` BIGINT DEFAULT NULL COMMENT '所属学期',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = INNODB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生报到记录表'; 
+
+
+ALTER TABLE  `base_new_student`   
+  ADD COLUMN `delete_reason` VARCHAR(300) NULL   COMMENT '删除原因(用于新生删除功能)' AFTER `second_ambition_id`;
+
+ALTER TABLE `material_task_appendix`   
+  CHANGE `material_task_id` `material_task_id` BIGINT NULL   COMMENT '材料提交任务分配(material_task_assign)';
+
+ALTER TABLE `course_table`   
+  CHANGE `create_date` `create_date` DATETIME NULL   COMMENT '创建时间',
+  CHANGE `modify_date` `modify_date` DATETIME NULL   COMMENT '修改时间';
+
+
+DROP TABLE IF EXISTS `base_class_dynamics`;
+CREATE TABLE `base_class_dynamics`  (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATETIME DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `class_id` BIGINT DEFAULT NULL COMMENT '班级id',
+  `title` VARCHAR(200) DEFAULT NULL COMMENT '标题',
+  `role_type` VARCHAR(50) DEFAULT NULL COMMENT '发送范围(学生、家长)',
+  `content` VARCHAR(1000) DEFAULT NULL COMMENT '内容',
+  `folder_id` BIGINT DEFAULT NULL COMMENT '附件',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = INNODB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '班级动态表'; 
+
+-- 2024年9月5日
+ALTER TABLE xjr_workflow_record ADD workflow_approve_type INT NOT NULL DEFAULT 4 COMMENT '工作流审批类型';
+
+ALTER TABLE xjr_workflow_form_relation ADD current_state VARCHAR(50) COMMENT '当前状态 STATE_ACTIVE-正在运行的流程实例,STATE_SUSPENDED-挂起的流程实例,STATE_COMPLETED-通过正常结束事件完成,STATE_EXTERNALLY_TERMINATED-外部终止,例如通过REST API终止,STATEINTERNALY_TERMINATED-内部终止,例如通过终止边界事件';
+
+ALTER TABLE xjr_workflow_form_relation ADD start_time DATETIME COMMENT '开始时间';
+
+ALTER TABLE xjr_workflow_form_relation ADD end_time DATETIME COMMENT '结束时间';

+ 97 - 1
src/test/java/com/xjrsoft/module/job/JianyuekbBaseDataTaskTest.java

@@ -383,7 +383,8 @@ class JianyuekbBaseDataTaskTest {
         DataUtil dataUtil = new DataUtil();
         String currenSemeter = dataUtil.getCurrenSemeter();
 
-        for (BaseClass baseClass : classMap2.values()) {
+        for (String jianyueId : classMap2.keySet()) {
+            BaseClass baseClass = classMap2.get(jianyueId);
             if(baseClass == null){
                 continue;
             }
@@ -577,4 +578,99 @@ class JianyuekbBaseDataTaskTest {
         }
         dataUtil.insertRecord("base_class", idMap);
     }
+
+
+    @Test
+    void updateClassBySemester() throws Exception {
+        DataUtil dataUtil = new DataUtil();
+        String currenSemeter = dataUtil.getCurrenSemeter();
+
+        long timestamp = System.currentTimeMillis();
+        //生成签名
+        String sign = ScheduleUtil.createSign(timestamp);
+        JsonArray semesterSerialNos = new JsonArray();
+        semesterSerialNos.add(currenSemeter);
+        JsonObject paramJson = new JsonObject();
+        paramJson.add("semesterSerialNos", semesterSerialNos);
+        paramJson.addProperty("pageSize", 200);
+        paramJson.addProperty("pageIndex", 1);
+        String url= ScheduleUtil.apiUrl + "Class/page";
+        String doPost = ScheduleUtil.doPost(url, paramJson.toString(), sign, timestamp);
+
+
+        JsonParser parser = new JsonParser();
+        JsonObject jsonObject = parser.parse(doPost).getAsJsonObject();
+        JsonArray jsonArray = jsonObject.get("data").getAsJsonObject().get("dataList").getAsJsonArray();
+        List<String> jianyueIds  = new ArrayList<>();
+        for (JsonElement jsonElement : jsonArray) {
+            JsonObject object = jsonElement.getAsJsonObject();
+            jianyueIds.add("'" + object.get("serialNo").getAsString() + "'");
+        }
+
+        DataSource datasource = DatasourceUtil.getDataSource(GlobalConstant.DEFAULT_DATASOURCE_KEY);
+        Db use = Db.use(datasource);
+        String sql = "SELECT * FROM jianyue_data WHERE table_name = 'base_class' and jianyue_id in (" + jianyueIds.toString().replace("[","").replace("]","") + ")";
+        List<JianyueData> classList = use.query(sql, JianyueData.class);
+        Map<String, String> classJianyueSourceMap = new HashMap<>();
+        for (JianyueData jianyueData : classList) {
+            classJianyueSourceMap.put(jianyueData.getJianyueId(), jianyueData.getSourceId());
+        }
+
+        url  = ScheduleUtil.apiUrl + "class/update";
+        paramJson = new JsonObject();
+        paramJson.addProperty("pageSize", 200);
+        paramJson.addProperty("pageIndex", 1);
+
+        timestamp = System.currentTimeMillis();
+        //生成签名
+        sign = ScheduleUtil.createSign(timestamp);
+
+        doPost = ScheduleUtil.doPost(url, paramJson.toString(), sign, timestamp);
+
+        sql = "SELECT * FROM base_class WHERE delete_mark = 0 and is_graduate = 1";
+        List<BaseClass> dataList = use.query(sql, BaseClass.class);
+        Map<String, BaseClass> classMap = new HashMap<>();
+        for (BaseClass baseClass : dataList) {
+            classMap.put(baseClass.getId().toString(), baseClass);
+        }
+
+        sql = "SELECT * FROM jianyue_data WHERE table_name = 'base_classroom'";
+        List<JianyueData> classroomList = use.query(sql, JianyueData.class);
+        Map<String, String> classroomMap = new HashMap<>();
+        for (JianyueData jianyueData : classroomList) {
+            classroomMap.put(jianyueData.getSourceId(), jianyueData.getJianyueId());
+        }
+
+        sql = "SELECT * FROM jianyue_data WHERE table_name = 'base_teacher'";
+        List<JianyueData> teacherList = use.query(sql, JianyueData.class);
+        Map<String, String> teacherMap = new HashMap<>();
+        for (JianyueData jianyueData : teacherList) {
+            teacherMap.put(jianyueData.getSourceId(), jianyueData.getJianyueId());
+        }
+
+        url  = ScheduleUtil.apiUrl + "class/update";
+
+
+        for (String jianyueId : classJianyueSourceMap.keySet()) {
+            BaseClass baseClass = classMap.get(classJianyueSourceMap.get(jianyueId));
+            if(baseClass == null){
+                continue;
+            }
+            paramJson = new JsonObject();
+            paramJson.addProperty("name", baseClass.getName());
+
+            paramJson.addProperty("semesterSerialNo", currenSemeter);
+            paramJson.addProperty("extendId", baseClass.getId());
+            paramJson.addProperty("classRoomSerialNo", classroomMap.get(baseClass.getClassroomId().toString()));
+            paramJson.addProperty("serialNo", jianyueId);
+            paramJson.addProperty("teacherSerialNo", teacherMap.get(baseClass.getTeacherId().toString()));
+
+            timestamp = System.currentTimeMillis();
+            //生成签名
+            sign = ScheduleUtil.createSign(timestamp);
+            String result = ScheduleUtil.doPost(url, paramJson.toString(), sign, timestamp);
+
+            System.out.println(baseClass.getName() + " -> " + result);
+        }
+    }
 }

+ 88 - 22
src/test/java/com/xjrsoft/module/job/JianyuekbScheduleTaskTest.java

@@ -2,18 +2,22 @@ package com.xjrsoft.module.job;
 
 import cn.hutool.db.Entity;
 import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import com.xjrsoft.XjrSoftApplication;
 import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
+import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.schedule.entity.CourseReceiveMsg;
 import com.xjrsoft.module.schedule.util.DataUtil;
 import com.xjrsoft.module.schedule.util.ScheduleUtil;
 import org.camunda.bpm.engine.impl.util.JsonUtil;
 import org.junit.jupiter.api.Test;
 import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
@@ -28,6 +32,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * @author dzx
@@ -37,26 +42,49 @@ import java.util.Set;
 @RunWith(SpringRunner.class)
 @SpringBootTest(classes = XjrSoftApplication.class)
 class JianyuekbScheduleTaskTest {
-
+    @Autowired
+    private IBaseClassService classService;
     @Test
     public void RefreshConnectionPool() throws Exception {
         String active = SpringUtil.getActiveProfile();
-        if(!"prod".equals(active)){
-            return;
-        }
-        String sql = "SELECT * FROM course_receive_msg WHERE delete_mark = 0 AND id in (1821034023531098114,1821034021123567617)";
+        String sql = "SELECT * FROM course_receive_msg WHERE delete_mark = 0 AND is_callback IS NULL";
         List<Map<String, Object>> receiveMsgs = SqlRunnerAdapter.db().selectList(sql, CourseReceiveMsg.class);
         JsonArray allScheduleInfo = new JsonArray();
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DataUtil dataUtil = new DataUtil();
+
+        List<String> eduYearSerialNo1 = receiveMsgs.stream().map(x -> "'" + x.get("edu_year_serial_no").toString() + "'").collect(Collectors.toList());
+
+        //查询出传入排课系统的年级和班级
+        sql = "SELECT * FROM jianyue_data WHERE source_id IS NOT NULL AND jianyue_id != ''" +
+                " and table_name = 'base_grade'" +
+                " and jianyue_id in (" + eduYearSerialNo1.toString().replace("[","").replace("]","") + ")";
+        List<Map<String, Object>> jianyueData = SqlRunnerAdapter.db().selectList(sql);
+        Map<String, List<Long>> gradeClassMaps = new HashMap<>();//存入对应年级的所有班级id
+        for (Map<String, Object> el : jianyueData) {
+            String gradeId = el.get("source_id").toString().split("_")[1];
+            List<BaseClass> classList = classService.list(new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getGradeId, gradeId));
+            List<Long> classIds = classList.stream().map(BaseClass::getId).collect(Collectors.toList());
+
+            gradeClassMaps.put(el.get("jianyue_id").toString(), classIds);
+        }
+
+
         for (Map<String, Object> receiveMsg : receiveMsgs) {
             String updSql = "update course_receive_msg set is_callback = 0 where id = " + receiveMsg.get("id").toString();
             SqlRunnerAdapter.db().update(updSql);
 
             String eduYearSerialNo = receiveMsg.get("edu_year_serial_no").toString();
+            String startDateStr = receiveMsg.get("start_date").toString();
+            String endDateStr = receiveMsg.get("end_date").toString();
+            //删除课表信息
+            String delSql = "delete from course_table where schedule_date between '" + startDateStr + "'" +
+                    " and '" + endDateStr + "'" +
+                    " and class_id in (" + gradeClassMaps.get(eduYearSerialNo).toString().replace("[","").replace("]","")+ ")";
+            SqlRunnerAdapter.db().delete(delSql);
 
-            LocalDate startDateObj = LocalDate.parse(receiveMsg.get("start_date").toString());
-            LocalDate endDateObj = LocalDate.parse(receiveMsg.get("end_date").toString());
+            LocalDate startDateObj = LocalDate.parse(startDateStr);
+            LocalDate endDateObj = LocalDate.parse(endDateStr);
             long between = ChronoUnit.DAYS.between(startDateObj, endDateObj);
             int times = Integer.parseInt(((between / 7) + 1) + "");
 
@@ -77,21 +105,7 @@ class JianyuekbScheduleTaskTest {
             updSql = "update course_receive_msg set is_callback = 1 where id = " + receiveMsg.get("id").toString();
             SqlRunnerAdapter.db().update(updSql);
         }
-        doExecute(allScheduleInfo);
-//        Map<String, JsonObject> infoMap = new HashMap<>();
-//        Map<Integer, Integer> tmePeriod = ScheduleUtil.getTmePeriod();
-//        for (JsonElement jsonElement : allScheduleInfo) {
-//            JsonObject asJsonObject = jsonElement.getAsJsonObject();
-//            String numberOfDayName = asJsonObject.get("numberOfDayName").getAsString();
-//            JsonObject json = new JsonObject();
-//            json.add("startTime", asJsonObject.get("startTime"));
-//            json.add("endTime", asJsonObject.get("endTime"));
-//            json.addProperty("tmePeriod", tmePeriod.get(asJsonObject.get("timeOption").getAsInt()));
-//            json.add("numberOfDay", asJsonObject.get("numberOfDay"));
-//            infoMap.put(numberOfDayName, json);
-//        }
-//        System.out.println(JsonUtil.asString(infoMap));
-
+//        doExecute(allScheduleInfo);
     }
 
     void doExecute(JsonArray scheduleInfo){
@@ -189,4 +203,56 @@ class JianyuekbScheduleTaskTest {
         SqlRunnerAdapter.db().dynamicInsertBatch(tableName, insertList);
 
     }
+
+
+    @Test
+    void updateClass2() throws Exception {
+        String url  = ScheduleUtil.apiUrl + "Class/page";
+        JsonObject pageJson = new JsonObject();
+        pageJson.addProperty("pageSize", 200);
+        pageJson.addProperty("pageIndex", 1);
+        JsonParser parser = new JsonParser();
+
+        long timestamp = System.currentTimeMillis();
+        String sign = ScheduleUtil.createSign(timestamp);
+
+        String doPost = ScheduleUtil.doPost(url, pageJson.toString(), sign, timestamp);
+        System.out.println(doPost);
+        JsonArray dataList = parser.parse(doPost).getAsJsonObject().get("data").getAsJsonObject().get("dataList").getAsJsonArray();
+        String sql = "select * from base_class where delete_mark = 0";
+        List<Map<String, Object>> classList = SqlRunnerAdapter.db().selectList(sql);
+        Map<String, Long> classMap = new HashMap<>();
+        for (Map<String, Object> objectMap : classList) {
+            classMap.put(objectMap.get("name").toString(), (Long)objectMap.get("id"));
+        }
+
+        sql = "select * from jianyue_data where table_name = 'base_class'";
+        List<Map<String, Object>> classList2 = SqlRunnerAdapter.db().selectList(sql);
+        Set<String> sourceIds = new HashSet<>();
+        for (Map<String, Object> objectMap : classList2) {
+            sourceIds.add(objectMap.get("jianyue_id").toString());
+        }
+
+        String tableName = "jianyue_data";
+        List<Entity> insertList = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        for (JsonElement jsonElement : dataList) {
+            JsonObject object = jsonElement.getAsJsonObject();
+            String serialNo = object.get("serialNo").getAsString();
+            if(sourceIds.contains(serialNo)){
+                continue;
+            }
+            if(classMap.get(object.get("name").getAsString()) == null){
+                continue;
+            }
+            Entity entity = Entity.create(tableName);
+            entity.set("create_date", sdf.format(new Date()));
+            entity.set("table_name", "base_class");
+            entity.set("source_id", classMap.get(object.get("name").getAsString()));
+            entity.set("jianyue_id", serialNo);
+            insertList.add(entity);
+        }
+        SqlRunnerAdapter.db().dynamicInsertBatch(tableName, insertList);
+
+    }
 }