Java Code Examples for com.ruoyi.quartz.domain.SysJob#setStatus()

The following examples show how to use com.ruoyi.quartz.domain.SysJob#setStatus() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SysJobController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 任务调度状态修改
 */
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions("monitor:job:changeStatus")
@PostMapping("/changeStatus")
@ResponseBody
public AjaxResult changeStatus(SysJob job) throws SchedulerException
{
    SysJob newJob = jobService.selectJobById(job.getJobId());
    newJob.setStatus(job.getStatus());
    return toAjax(jobService.changeStatus(newJob));
}
 
Example 2
Source File: SysJobServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 暂停任务
 * 
 * @param job 调度信息
 */
@Override
@Transactional
public int pauseJob(SysJob job) throws SchedulerException
{
    Long jobId = job.getJobId();
    String jobGroup = job.getJobGroup();
    job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
    int rows = jobMapper.updateJob(job);
    if (rows > 0)
    {
        scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup));
    }
    return rows;
}
 
Example 3
Source File: SysJobServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 恢复任务
 * 
 * @param job 调度信息
 */
@Override
@Transactional
public int resumeJob(SysJob job) throws SchedulerException
{
    Long jobId = job.getJobId();
    String jobGroup = job.getJobGroup();
    job.setStatus(ScheduleConstants.Status.NORMAL.getValue());
    int rows = jobMapper.updateJob(job);
    if (rows > 0)
    {
        scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup));
    }
    return rows;
}
 
Example 4
Source File: SysJobServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 新增任务
 * 
 * @param job 调度信息 调度信息
 */
@Override
@Transactional
public int insertJob(SysJob job) throws SchedulerException, TaskException
{
    job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
    int rows = jobMapper.insertJob(job);
    if (rows > 0)
    {
        ScheduleUtils.createScheduleJob(scheduler, job);
    }
    return rows;
}
 
Example 5
Source File: SysJobServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 暂停任务
 * 
 * @param job 调度信息
 */
@Override
public int pauseJob(SysJob job)
{
    job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
    int rows = jobMapper.updateJob(job);
    if (rows > 0)
    {
        ScheduleUtils.pauseJob(scheduler, job.getJobId());
    }
    return rows;
}
 
Example 6
Source File: SysJobServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 恢复任务
 * 
 * @param job 调度信息
 */
@Override
public int resumeJob(SysJob job)
{
    job.setStatus(ScheduleConstants.Status.NORMAL.getValue());
    int rows = jobMapper.updateJob(job);
    if (rows > 0)
    {
        ScheduleUtils.resumeJob(scheduler, job.getJobId());
    }
    return rows;
}
 
Example 7
Source File: SysJobServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 新增任务
 * 
 * @param job 调度信息 调度信息
 */
@Override
public int insertJobCron(SysJob job)
{
    job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
    int rows = jobMapper.insertJob(job);
    if (rows > 0)
    {
        ScheduleUtils.createScheduleJob(scheduler, job);
    }
    return rows;
}
 
Example 8
Source File: SysJobController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 任务调度状态修改
 */
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions("monitor:job:changeStatus")
@PostMapping("/changeStatus")
@ResponseBody
public AjaxResult changeStatus(SysJob job) throws SchedulerException{
    SysJob newJob = jobService.selectJobById(job.getJobId());
    newJob.setStatus(job.getStatus());
    newJob.setUpdateBy(ShiroUtils.getLoginName());
    return toAjax(jobService.changeStatus(job));
}
 
Example 9
Source File: SysJobServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 暂停任务
 *
 * @param job 调度信息
 */
@Override
public int pauseJob(SysJob job) throws SchedulerException{
    job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
    int rows = jobMapper.updateJob(job);
    if (rows > 0) {
        ScheduleUtils.pauseJob(scheduler, job.getJobId());
    }
    return rows;
}
 
Example 10
Source File: SysJobServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 恢复任务
 *
 * @param job 调度信息
 */
@Override
public int resumeJob(SysJob job) throws SchedulerException{
    job.setStatus(ScheduleConstants.Status.NORMAL.getValue());
    int rows = jobMapper.updateJob(job);
    if (rows > 0) {
        ScheduleUtils.resumeJob(scheduler, job.getJobId());
    }
    return rows;
}
 
Example 11
Source File: SysJobServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 新增任务
 *
 * @param job 调度信息 调度信息
 */
@Override
public int insertJobCron(SysJob job) throws SchedulerException, TaskException{
    job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
    int rows = jobMapper.insertJob(job);
    if (rows > 0) {
        createScheduleJob(scheduler, job);
    }
    return rows;
}