|
@@ -3,9 +3,7 @@ package com.xjrsoft.module.job;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.google.gson.JsonArray;
|
|
import com.google.gson.JsonArray;
|
|
|
import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
|
|
import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
|
|
|
-import com.xjrsoft.common.utils.SqlRunnerAdapterUtil;
|
|
|
|
|
import com.xjrsoft.module.schedule.entity.CourseReceiveMsg;
|
|
import com.xjrsoft.module.schedule.entity.CourseReceiveMsg;
|
|
|
-import com.xjrsoft.module.schedule.entity.JianyueData;
|
|
|
|
|
import com.xjrsoft.module.schedule.util.DataUtil;
|
|
import com.xjrsoft.module.schedule.util.DataUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -37,14 +35,13 @@ public class JianyuekbScheduleTask {
|
|
|
}
|
|
}
|
|
|
String sql = "SELECT * FROM course_receive_msg WHERE delete_mark = 0 AND is_callback IS NULL";
|
|
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);
|
|
List<Map<String, Object>> receiveMsgs = SqlRunnerAdapter.db().selectList(sql, CourseReceiveMsg.class);
|
|
|
- for (Map<String, Object> receiveMsgMap : receiveMsgs) {
|
|
|
|
|
- CourseReceiveMsg receiveMsg = SqlRunnerAdapterUtil.convertMapToEntity(receiveMsgMap, CourseReceiveMsg.class);
|
|
|
|
|
- String updSql = "update course_receive_msg set is_callback = 0 where id = " + receiveMsg.getId();
|
|
|
|
|
|
|
+ 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);
|
|
SqlRunnerAdapter.db().update(updSql);
|
|
|
|
|
|
|
|
- doExecute(receiveMsg.getEduYearSerialNo(), receiveMsg.getStartDate(), receiveMsg.getEndDate());
|
|
|
|
|
|
|
+ doExecute(receiveMsg.get("edu_year_serial_no").toString(), receiveMsg.get("start_date").toString(), receiveMsg.get("end_date").toString());
|
|
|
|
|
|
|
|
- updSql = "update course_receive_msg set is_callback = 1 where id = " + receiveMsg.getId();
|
|
|
|
|
|
|
+ updSql = "update course_receive_msg set is_callback = 1 where id = " + receiveMsg.get("id").toString();
|
|
|
SqlRunnerAdapter.db().update(updSql);
|
|
SqlRunnerAdapter.db().update(updSql);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -53,23 +50,21 @@ public class JianyuekbScheduleTask {
|
|
|
log.info("开始获取课表数据");
|
|
log.info("开始获取课表数据");
|
|
|
try {
|
|
try {
|
|
|
String sql = "SELECT distinct table_name FROM jianyue_data WHERE 1 = 1";
|
|
String sql = "SELECT distinct table_name FROM jianyue_data WHERE 1 = 1";
|
|
|
- List<Map<String, Object>> query = SqlRunnerAdapter.db().selectList(sql, JianyueData.class);
|
|
|
|
|
|
|
+ List<Map<String, Object>> query = SqlRunnerAdapter.db().selectList(sql);
|
|
|
Set<String> tables = new HashSet<>();
|
|
Set<String> tables = new HashSet<>();
|
|
|
- for (Map<String, Object> jianyueDataMap : query) {
|
|
|
|
|
- JianyueData jianyueData = SqlRunnerAdapterUtil.convertMapToEntity(jianyueDataMap, JianyueData.class);
|
|
|
|
|
- tables.add(jianyueData.getTableName());
|
|
|
|
|
|
|
+ for (Map<String, Object> jianyueData : query) {
|
|
|
|
|
+ tables.add(jianyueData.get("table_name").toString());
|
|
|
}
|
|
}
|
|
|
sql = "SELECT * FROM jianyue_data WHERE 0 = 0";
|
|
sql = "SELECT * FROM jianyue_data WHERE 0 = 0";
|
|
|
- List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql, JianyueData.class);
|
|
|
|
|
|
|
+ List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
Map<String, Map<String, String>> dataMap = new HashMap<>();
|
|
Map<String, Map<String, String>> dataMap = new HashMap<>();
|
|
|
for (String table : tables) {
|
|
for (String table : tables) {
|
|
|
Map<String, String> tableData = new HashMap<>();
|
|
Map<String, String> tableData = new HashMap<>();
|
|
|
- for (Map<String, Object> jianyueDataMap : list) {
|
|
|
|
|
- JianyueData jianyueData = SqlRunnerAdapterUtil.convertMapToEntity(jianyueDataMap, JianyueData.class);
|
|
|
|
|
- if(!table.equals(jianyueData.getTableName())){
|
|
|
|
|
|
|
+ for (Map<String, Object> jianyueData : list) {
|
|
|
|
|
+ if(!table.equals(jianyueData.get("table_name").toString())){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- tableData.put(jianyueData.getJianyueId(), jianyueData.getSourceId());
|
|
|
|
|
|
|
+ tableData.put(jianyueData.get("jianyue_id").toString(), jianyueData.get("source_id").toString());
|
|
|
}
|
|
}
|
|
|
dataMap.put(table, tableData);
|
|
dataMap.put(table, tableData);
|
|
|
}
|
|
}
|