Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
holmes
Commits
d60dc671
Commit
d60dc671
authored
Jan 06, 2022
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改编辑SQL监控接口
parent
b061543d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
SqlMonitorTaskController.java
...g/holmes/controller/monitor/SqlMonitorTaskController.java
+4
-3
No files found.
src/main/java/cn/qg/holmes/controller/monitor/SqlMonitorTaskController.java
View file @
d60dc671
...
...
@@ -107,14 +107,15 @@ public class SqlMonitorTaskController {
public
JsonResult
editMonitorTask
(
@RequestBody
SqlMonitorTask
sqlMonitorTask
)
{
QueryWrapper
<
SqlMonitorTask
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"task_name"
,
sqlMonitorTask
.
getTaskName
());
SqlMonitorTask
sqlMonitorTaskDb
=
sqlMonitorTaskService
.
getOne
(
queryWrapper
);
if
(
sqlMonitorTaskDb
!=
null
&&
!
sqlMonitorTaskDb
.
getId
().
equals
(
sqlMonitorTask
.
getId
()))
{
SqlMonitorTask
sqlMonitorTaskTemp
=
sqlMonitorTaskService
.
getOne
(
queryWrapper
);
SqlMonitorTask
sqlMonitorTaskOld
=
sqlMonitorTaskService
.
getById
(
sqlMonitorTask
.
getId
());
if
(
sqlMonitorTaskTemp
!=
null
&&
!
sqlMonitorTaskTemp
.
getId
().
equals
(
sqlMonitorTask
.
getId
()))
{
return
JsonResult
.
buildErrorStateResult
(
"监控名称重复"
,
false
);
}
boolean
updateResult
=
sqlMonitorTaskService
.
updateById
(
sqlMonitorTask
);
if
(
updateResult
)
{
// 如果状态发生了变更,则根据改变之后的状态来决定是暂停任务还是重启任务
if
(!
sqlMonitorTask
.
getStatus
().
equals
(
sqlMonitorTask
Db
.
getStatus
()))
{
if
(!
sqlMonitorTask
.
getStatus
().
equals
(
sqlMonitorTask
Old
.
getStatus
()))
{
// 如果变更后的状态为0
if
(
sqlMonitorTask
.
getStatus
()
==
0
)
{
QuartzUtils
.
pauseScheduleJob
(
scheduler
,
sqlMonitorTask
.
getTaskName
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment