|
|
|
@ -2,11 +2,11 @@ package com.foreverwin.mesnac.quartz.job;
|
|
|
|
|
|
|
|
|
|
import com.foreverwin.mesnac.anomaly.service.AnomalyJobService;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BaseException;
|
|
|
|
|
import org.quartz.DisallowConcurrentExecution;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -19,17 +19,20 @@ public class AnomalyJob implements Job {
|
|
|
|
|
private static final String SITE_UPPERCASE = "SITE";
|
|
|
|
|
private static final String SITE_LOWERCASE = "site";
|
|
|
|
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(AnomalyJob.class);
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private AnomalyJobService anomalyJobService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void execute(JobExecutionContext context) throws JobExecutionException {
|
|
|
|
|
public void execute(JobExecutionContext context) {
|
|
|
|
|
logger.info("异常定时任务开始执行");
|
|
|
|
|
//获取站点,若站点为空则抛出异常
|
|
|
|
|
String site = getSite(context);
|
|
|
|
|
if (StringUtil.isBlank(site)) {
|
|
|
|
|
throw new BaseException("anomaly.quartz.task.not.site", null);
|
|
|
|
|
logger.error("异常定时任务未配置站点参数!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
anomalyJobService.anomalyJobProcess(site);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|