package com.securityControl.task.schedule; import com.securityControl.common.core.utils.aes.DateTimeHelper; import com.securityControl.task.service.TaskService; import lombok.extern.slf4j.Slf4j; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.stereotype.Component; /** * 站班会的定时分析预警 */ @Slf4j @Component @EnableScheduling public class ScheduledClassMettinglWarn implements Job { private static final Logger log = LoggerFactory.getLogger(ScheduledClassMettinglWarn.class); /** * 任务管理 */ @Autowired private TaskService taskService; @Override public void execute(JobExecutionContext context) throws JobExecutionException { try{ taskService.updateTask("bns_warn","1", DateTimeHelper.getNowTime()); log.info("开始执行站班会预警分析>>>>>>>>>>>>"); taskService.getAllClassMettingWarn(); log.info("开始执行站班会预警分析结束<<<<<<<"); }catch (Exception e){ log.error(e.toString(),e); } } }