2023年6月6日 添加将定时任务串起来
This commit is contained in:
parent
5d7c78bba0
commit
eba71773f2
|
@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.compress.utils.Lists;
|
import org.apache.commons.compress.utils.Lists;
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.jeecg.common.util.DateUtils;
|
import org.jeecg.common.util.DateUtils;
|
||||||
import org.jeecg.modules.kc.grab.SynchronizationService.base.BaseSync;
|
import org.jeecg.modules.kc.grab.SynchronizationService.base.BaseSync;
|
||||||
import org.jeecg.modules.kc.grab.exports.entity.TFwdtBkjxtkpj;
|
import org.jeecg.modules.kc.grab.exports.entity.TFwdtBkjxtkpj;
|
||||||
|
@ -12,16 +11,19 @@ import org.jeecg.modules.kc.grab.exports.service.ITFwdtBkjxtkpjService;
|
||||||
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbkjxtkpj;
|
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbkjxtkpj;
|
||||||
import org.jeecg.modules.kc.grab.imports.entity.Xxhbsynclog;
|
import org.jeecg.modules.kc.grab.imports.entity.Xxhbsynclog;
|
||||||
import org.jeecg.modules.kc.grab.imports.service.IXxhbbkjxtkpjService;
|
import org.jeecg.modules.kc.grab.imports.service.IXxhbbkjxtkpjService;
|
||||||
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
|
|
||||||
import org.jeecg.modules.kc.ktgl.service.IKcKetangbiaoService;
|
import org.jeecg.modules.kc.ktgl.service.IKcKetangbiaoService;
|
||||||
import org.jeecg.modules.kc.qa.entity.KcEvaluation;
|
|
||||||
import org.jeecg.modules.kc.qa.entity.KcEvaluations;
|
|
||||||
import org.jeecg.modules.kc.qa.service.IKcEvaluationService;
|
import org.jeecg.modules.kc.qa.service.IKcEvaluationService;
|
||||||
import org.jeecg.modules.kc.qa.service.IKcEvaluationsService;
|
import org.jeecg.modules.kc.qa.service.IKcEvaluationsService;
|
||||||
|
import org.jeecg.modules.quartz.entity.QuartzJob;
|
||||||
|
import org.jeecg.modules.quartz.mapper.QuartzJobMapper;
|
||||||
|
import org.jeecg.modules.quartz.service.IQuartzJobService;
|
||||||
import org.quartz.JobExecutionContext;
|
import org.quartz.JobExecutionContext;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务大厅-本科教学服务评价
|
* 服务大厅-本科教学服务评价
|
||||||
|
@ -44,6 +46,9 @@ public class SyncTFwdtBkjxtkpj extends BaseSync {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IKcKetangbiaoService kcKetangbiaoService;
|
private IKcKetangbiaoService kcKetangbiaoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IQuartzJobService quartzJobService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 若参数变量名修改 QuartzJobController中也需对应修改
|
* 若参数变量名修改 QuartzJobController中也需对应修改
|
||||||
*/
|
*/
|
||||||
|
@ -61,6 +66,8 @@ public class SyncTFwdtBkjxtkpj extends BaseSync {
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
public void run(Map<String, Object> param){
|
public void run(Map<String, Object> param){
|
||||||
|
|
||||||
|
|
||||||
//查询数据
|
//查询数据
|
||||||
Date date = new Date();//获取当前时间
|
Date date = new Date();//获取当前时间
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
@ -360,6 +367,20 @@ public class SyncTFwdtBkjxtkpj extends BaseSync {
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
//执行清洗
|
||||||
|
QueryWrapper<QuartzJob> jobQw = new QueryWrapper<>();
|
||||||
|
jobQw.eq("job_class_name","org.jeecg.modules.kc.grab.SynchronizationService.SyncZwdtEvaluation");
|
||||||
|
jobQw.last("limit 1");
|
||||||
|
QuartzJob quartzJob = quartzJobService.getOne(jobQw);
|
||||||
|
try {
|
||||||
|
if(quartzJob != null){
|
||||||
|
quartzJobService.execute(quartzJob);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Xxhbsynclog xxhbsynclog = new Xxhbsynclog();
|
Xxhbsynclog xxhbsynclog = new Xxhbsynclog();
|
||||||
xxhbsynclog.setSyncRowNum(String.valueOf(outDataList.size()));
|
xxhbsynclog.setSyncRowNum(String.valueOf(outDataList.size()));
|
||||||
saveLog(xxhbsynclog,Xxhbbkjxtkpj.class);
|
saveLog(xxhbsynclog,Xxhbbkjxtkpj.class);
|
||||||
|
|
Loading…
Reference in New Issue