diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/job/TaskJob.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/job/TaskJob.java new file mode 100644 index 0000000..ef4c855 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/job/TaskJob.java @@ -0,0 +1,58 @@ +package org.jeecg.modules.quartz.job; + +import com.alibaba.fastjson.JSON; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.util.DateUtils; +import org.jeecg.modules.extbpm.process.entity.ExtActProcessForm; +import org.jeecg.modules.extbpm.process.service.impl.BpmBaseExtApiImpl; +import org.jeecg.modules.extbpm.process.service.impl.ExtActProcessServiceImpl; +import org.jeecg.modules.tasktask.constant.FlowConstants; +import org.jeecg.modules.tasktask.entity.TaskTask; +import org.jeecg.modules.tasktask.service.ITaskTaskService; +import org.jeecg.modules.tasktask.service.impl.TaskTaskServiceImpl; +import org.quartz.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Description: 同步定时任务测试 + *
+ * 此处的同步是指 当定时任务的执行时间大于任务的时间间隔时
+ * 会等待第一个任务执行完成才会走第二个任务
+ * @author: taoyan
+ * @date: 2020年06月19日
+ */
+@PersistJobDataAfterExecution
+@DisallowConcurrentExecution
+@Component
+@Slf4j
+public class TaskJob implements Job {
+ @Autowired
+ private TaskTaskServiceImpl taskTaskServiceImpl;
+ @Autowired
+ private BpmBaseExtApiImpl bpmBaseExtApiImpl;
+
+ @Override
+ public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+
+ log.info(" --- 周期性遍历taskTask表 --- ");
+ LocalDateTime now = LocalDateTime.now();
+ List