|
@@ -1,28 +1,28 @@
|
|
package com.example.xiaoshiweixinback.service.quartzService;
|
|
package com.example.xiaoshiweixinback.service.quartzService;
|
|
|
|
|
|
import com.example.xiaoshiweixinback.entity.quartz.QuartzVO;
|
|
import com.example.xiaoshiweixinback.entity.quartz.QuartzVO;
|
|
|
|
+import com.example.xiaoshiweixinback.service.MonitorRecordService;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.quartz.*;
|
|
import org.quartz.*;
|
|
import org.springframework.scheduling.quartz.QuartzJobBean;
|
|
import org.springframework.scheduling.quartz.QuartzJobBean;
|
|
|
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 定义任务
|
|
* 定义任务
|
|
*/
|
|
*/
|
|
@DisallowConcurrentExecution
|
|
@DisallowConcurrentExecution
|
|
-public class TaskAddJob extends QuartzJobBean {
|
|
|
|
|
|
+@RequiredArgsConstructor
|
|
|
|
+public class MonitorProductJob extends QuartzJobBean {
|
|
|
|
|
|
- private static final Log logger = LogFactory.getLog(TaskAddJob.class);
|
|
|
|
|
|
+ private static final Log logger = LogFactory.getLog(MonitorProductJob.class);
|
|
private boolean flag =true;
|
|
private boolean flag =true;
|
|
|
|
+ private final MonitorRecordService monitorRecordService;
|
|
@Override
|
|
@Override
|
|
public void executeInternal(JobExecutionContext context) throws JobExecutionException {
|
|
public void executeInternal(JobExecutionContext context) throws JobExecutionException {
|
|
JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
|
|
JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
|
|
QuartzVO qrtzTask = (QuartzVO) jobDataMap.get("qrtzTask");
|
|
QuartzVO qrtzTask = (QuartzVO) jobDataMap.get("qrtzTask");
|
|
-
|
|
|
|
-
|
|
|
|
- logger.info("添加任务" + "信息是" + "1");
|
|
|
|
|
|
+ monitorRecordService.addMonitorRecords();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|