|
@@ -55,7 +55,6 @@ public class SysJobController {
|
|
|
* 定时任务分页查询
|
|
* 定时任务分页查询
|
|
|
* @param page 分页对象
|
|
* @param page 分页对象
|
|
|
* @param sysJob 定时任务调度表
|
|
* @param sysJob 定时任务调度表
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/page")
|
|
@GetMapping("/page")
|
|
|
@Operation(description = "分页定时业务查询")
|
|
@Operation(description = "分页定时业务查询")
|
|
@@ -147,7 +146,6 @@ public class SysJobController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 暂停全部定时任务
|
|
* 暂停全部定时任务
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@SysLog("暂停全部定时任务")
|
|
@SysLog("暂停全部定时任务")
|
|
|
@PostMapping("/shutdownJobs")
|
|
@PostMapping("/shutdownJobs")
|
|
@@ -172,7 +170,6 @@ public class SysJobController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 启动全部定时任务
|
|
* 启动全部定时任务
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@SysLog("启动全部定时任务")
|
|
@SysLog("启动全部定时任务")
|
|
|
@PostMapping("/startJobs")
|
|
@PostMapping("/startJobs")
|
|
@@ -189,7 +186,6 @@ public class SysJobController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 刷新全部定时任务
|
|
* 刷新全部定时任务
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@SysLog("刷新全部定时任务")
|
|
@SysLog("刷新全部定时任务")
|
|
|
@PostMapping("/refreshJobs")
|
|
@PostMapping("/refreshJobs")
|
|
@@ -214,14 +210,13 @@ public class SysJobController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 启动定时任务
|
|
* 启动定时任务
|
|
|
- * @param jobId
|
|
|
|
|
- * @return
|
|
|
|
|
|
|
+ * @param jobId 定时人ID
|
|
|
*/
|
|
*/
|
|
|
@SysLog("启动定时任务")
|
|
@SysLog("启动定时任务")
|
|
|
- @PostMapping("/startJob/{id}")
|
|
|
|
|
|
|
+ @PostMapping("/startJob")
|
|
|
@PreAuthorize("@pms.hasPermission('job_sys_job_start_job')")
|
|
@PreAuthorize("@pms.hasPermission('job_sys_job_start_job')")
|
|
|
@Operation(description = "启动定时任务")
|
|
@Operation(description = "启动定时任务")
|
|
|
- public R startJob(@PathVariable("id") Long jobId) throws SchedulerException {
|
|
|
|
|
|
|
+ public R startJob(@RequestParam("jobId") Long jobId) throws SchedulerException {
|
|
|
SysJob querySysJob = this.sysJobService.getById(jobId);
|
|
SysJob querySysJob = this.sysJobService.getById(jobId);
|
|
|
if (querySysJob == null) {
|
|
if (querySysJob == null) {
|
|
|
return R.failed("无此定时任务,请确认");
|
|
return R.failed("无此定时任务,请确认");
|
|
@@ -247,14 +242,13 @@ public class SysJobController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 启动定时任务
|
|
* 启动定时任务
|
|
|
- * @param jobId
|
|
|
|
|
- * @return
|
|
|
|
|
|
|
+ * @param jobId 任务ID
|
|
|
*/
|
|
*/
|
|
|
@SysLog("立刻执行定时任务")
|
|
@SysLog("立刻执行定时任务")
|
|
|
- @PostMapping("/runJob/{id}")
|
|
|
|
|
|
|
+ @PostMapping("/runJob")
|
|
|
@PreAuthorize("@pms.hasPermission('job_sys_job_run_job')")
|
|
@PreAuthorize("@pms.hasPermission('job_sys_job_run_job')")
|
|
|
@Operation(description = "立刻执行定时任务")
|
|
@Operation(description = "立刻执行定时任务")
|
|
|
- public R runJob(@PathVariable("id") Long jobId) throws SchedulerException {
|
|
|
|
|
|
|
+ public R runJob(@RequestParam("jobId") Long jobId) throws SchedulerException {
|
|
|
SysJob querySysJob = this.sysJobService.getById(jobId);
|
|
SysJob querySysJob = this.sysJobService.getById(jobId);
|
|
|
|
|
|
|
|
// 执行定时任务前判定任务是否在quartz中
|
|
// 执行定时任务前判定任务是否在quartz中
|
|
@@ -269,14 +263,13 @@ public class SysJobController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 暂停定时任务
|
|
* 暂停定时任务
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@SysLog("暂停定时任务")
|
|
@SysLog("暂停定时任务")
|
|
|
- @PostMapping("/shutdownJob/{id}")
|
|
|
|
|
|
|
+ @PostMapping("/shutdownJob")
|
|
|
@PreAuthorize("@pms.hasPermission('job_sys_job_shutdown_job')")
|
|
@PreAuthorize("@pms.hasPermission('job_sys_job_shutdown_job')")
|
|
|
@Operation(description = "暂停定时任务")
|
|
@Operation(description = "暂停定时任务")
|
|
|
- public R shutdownJob(@PathVariable("id") Long id) {
|
|
|
|
|
- SysJob querySysJob = this.sysJobService.getById(id);
|
|
|
|
|
|
|
+ public R shutdownJob(@RequestParam("jobId") Long jobId) {
|
|
|
|
|
+ SysJob querySysJob = this.sysJobService.getById(jobId);
|
|
|
// 更新定时任务状态条件,运行状态2更新为暂停状态3
|
|
// 更新定时任务状态条件,运行状态2更新为暂停状态3
|
|
|
this.sysJobService.updateById(SysJob.builder()
|
|
this.sysJobService.updateById(SysJob.builder()
|
|
|
.jobId(querySysJob.getJobId())
|
|
.jobId(querySysJob.getJobId())
|
|
@@ -288,7 +281,6 @@ public class SysJobController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 唯一标识查询定时执行日志
|
|
* 唯一标识查询定时执行日志
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/jobLog")
|
|
@GetMapping("/jobLog")
|
|
|
@Operation(description = "唯一标识查询定时执行日志")
|
|
@Operation(description = "唯一标识查询定时执行日志")
|
|
@@ -298,7 +290,6 @@ public class SysJobController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 检验任务名称和任务组联合是否唯一
|
|
* 检验任务名称和任务组联合是否唯一
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/isValidTaskName")
|
|
@GetMapping("/isValidTaskName")
|
|
|
@Operation(description = "检验任务名称和任务组联合是否唯一")
|
|
@Operation(description = "检验任务名称和任务组联合是否唯一")
|
|
@@ -311,7 +302,6 @@ public class SysJobController {
|
|
|
/**
|
|
/**
|
|
|
* 导出任务
|
|
* 导出任务
|
|
|
* @param sysJob
|
|
* @param sysJob
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@ResponseExcel
|
|
@ResponseExcel
|
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|