|
@@ -2,6 +2,12 @@ package com.warewms.quartz.task.service.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
import javax.annotation.PostConstruct;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.warewms.common.core.domain.base.page.PageDomain;
|
|
|
+import com.warewms.common.core.domain.base.page.TableDataInfo;
|
|
|
+import com.warewms.common.utils.StringUtils;
|
|
|
+import com.warewms.quartz.domain.SysJobLog;
|
|
|
import org.quartz.JobDataMap;
|
|
|
import org.quartz.JobKey;
|
|
|
import org.quartz.Scheduler;
|
|
@@ -19,7 +25,7 @@ import com.warewms.quartz.util.ScheduleUtils;
|
|
|
|
|
|
|
|
|
* 定时任务调度信息 服务层
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
*/
|
|
|
@Service
|
|
@@ -47,19 +53,24 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 获取quartz调度器的计划任务列表
|
|
|
- *
|
|
|
- * @param job 调度信息
|
|
|
+ *
|
|
|
+ * @param job 调度信息
|
|
|
+ * @param pageDomain
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<SysJob> selectJobList(SysJob job)
|
|
|
+ public TableDataInfo selectJobList(SysJob job, PageDomain pageDomain)
|
|
|
{
|
|
|
- return jobMapper.selectJobList(job);
|
|
|
+ return TableDataInfo.build( jobMapper.selectPage(pageDomain.build(),new LambdaQueryWrapper<SysJob>()
|
|
|
+ .eq(StringUtils.isNotEmpty(job.getJobName()), SysJob::getJobName, job.getJobName())
|
|
|
+ .eq(StringUtils.isNotEmpty(job.getJobGroup()), SysJob::getJobGroup, job.getJobGroup())
|
|
|
+ .eq(StringUtils.isNotEmpty(job.getStatus()), SysJob::getStatus, job.getStatus())
|
|
|
+ ));
|
|
|
}
|
|
|
|
|
|
|
|
|
* 通过调度任务ID查询调度信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param jobId 调度任务ID
|
|
|
* @return 调度任务对象信息
|
|
|
*/
|
|
@@ -71,7 +82,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 暂停任务
|
|
|
- *
|
|
|
+ *
|
|
|
* @param job 调度信息
|
|
|
*/
|
|
|
@Override
|
|
@@ -91,7 +102,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 恢复任务
|
|
|
- *
|
|
|
+ *
|
|
|
* @param job 调度信息
|
|
|
*/
|
|
|
@Override
|
|
@@ -111,7 +122,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 删除任务后,所对应的trigger也将被删除
|
|
|
- *
|
|
|
+ *
|
|
|
* @param job 调度信息
|
|
|
*/
|
|
|
@Override
|
|
@@ -130,7 +141,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 批量删除调度信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param jobIds 需要删除的任务ID
|
|
|
* @return 结果
|
|
|
*/
|
|
@@ -147,7 +158,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 任务调度状态修改
|
|
|
- *
|
|
|
+ *
|
|
|
* @param job 调度信息
|
|
|
*/
|
|
|
@Override
|
|
@@ -169,7 +180,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 立即运行任务
|
|
|
- *
|
|
|
+ *
|
|
|
* @param job 调度信息
|
|
|
*/
|
|
|
@Override
|
|
@@ -194,7 +205,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 新增任务
|
|
|
- *
|
|
|
+ *
|
|
|
* @param job 调度信息 调度信息
|
|
|
*/
|
|
|
@Override
|
|
@@ -212,7 +223,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 更新任务的时间表达式
|
|
|
- *
|
|
|
+ *
|
|
|
* @param job 调度信息
|
|
|
*/
|
|
|
@Override
|
|
@@ -230,7 +241,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 更新任务
|
|
|
- *
|
|
|
+ *
|
|
|
* @param job 任务对象
|
|
|
* @param jobGroup 任务组名
|
|
|
*/
|
|
@@ -249,7 +260,7 @@ public class SysJobServiceImpl implements ISysJobService
|
|
|
|
|
|
|
|
|
* 校验cron表达式是否有效
|
|
|
- *
|
|
|
+ *
|
|
|
* @param cronExpression 表达式
|
|
|
* @return 结果
|
|
|
*/
|