Commit 7c6b3e7c authored by 黎博's avatar 黎博

修复启用/禁用接口

parent a2b44b2e
...@@ -285,6 +285,11 @@ public class SqlMonitorTaskController { ...@@ -285,6 +285,11 @@ public class SqlMonitorTaskController {
if (sqlMonitorTask == null) { if (sqlMonitorTask == null) {
return JsonResult.buildErrorStateResult("监控不存在!", false); return JsonResult.buildErrorStateResult("监控不存在!", false);
} }
// 首先判断监控是否存在
String jobName = sqlMonitorTask.getTaskName();
if (!QuartzUtils.queryJobExistence(scheduler, jobName)) {
QuartzUtils.createSqlScheduleJob(scheduler, sqlMonitorTask);
}
if (status == 1) { if (status == 1) {
if (sqlMonitorTask.getStatus() == 1) { if (sqlMonitorTask.getStatus() == 1) {
return JsonResult.buildErrorStateResult("监控已是启用状态", false); return JsonResult.buildErrorStateResult("监控已是启用状态", false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment