dataease-dm/backend/src/main/java/io/dataease/job/sechedule/DeScheduleJob.java

29 lines
999 B
Java
Raw Normal View History

package io.dataease.job.sechedule;
2021-03-10 18:13:27 +08:00
import io.dataease.commons.utils.LogUtil;
import org.quartz.*;
public abstract class DeScheduleJob implements Job {
2021-03-10 18:13:27 +08:00
protected String datasetTableId;
protected String expression;
protected String taskId;
2021-03-18 17:59:52 +08:00
protected String updateType;
2021-03-10 18:13:27 +08:00
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
2021-03-10 18:13:27 +08:00
JobKey jobKey = context.getTrigger().getJobKey();
JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
this.datasetTableId = jobDataMap.getString("datasetTableId");
this.expression = jobDataMap.getString("expression");
this.taskId = jobDataMap.getString("taskId");
2021-03-18 17:59:52 +08:00
this.updateType = jobDataMap.getString("updateType");
2021-03-10 18:13:27 +08:00
LogUtil.info(jobKey.getGroup() + " Running: " + datasetTableId);
LogUtil.info("CronExpression: " + expression);
businessExecute(context);
}
abstract void businessExecute(JobExecutionContext context);
}