Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
项目统一框架
amos-boot-biz
Commits
95c7bf24
Commit
95c7bf24
authored
Jan 09, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务 13675
parent
4051b155
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
JobService.java
.../main/java/com/yeejoin/amos/patrol/quartz/JobService.java
+21
-0
dbTemplate_check.xml
...-patrol/src/main/resources/db/mapper/dbTemplate_check.xml
+2
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/JobService.java
View file @
95c7bf24
package
com
.
yeejoin
.
amos
.
patrol
.
quartz
;
package
com
.
yeejoin
.
amos
.
patrol
.
quartz
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo
;
import
com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo
;
import
com.yeejoin.amos.patrol.business.bo.PlanTaskSyncBo
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
com.yeejoin.amos.patrol.business.dao.mapper.CheckInputMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.CheckInputMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.MsgMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.MsgMapper
;
...
@@ -26,6 +28,7 @@ import com.yeejoin.amos.patrol.mqtt.WebMqttComponent;
...
@@ -26,6 +28,7 @@ import com.yeejoin.amos.patrol.mqtt.WebMqttComponent;
import
org.quartz.Job
;
import
org.quartz.Job
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -530,6 +533,11 @@ public class JobService implements IJobService {
...
@@ -530,6 +533,11 @@ public class JobService implements IJobService {
if
(
PlanTaskFinishStatusEnum
.
NOTSTARTED
.
getValue
()
==
planTask
.
getFinishStatus
())
{
if
(
PlanTaskFinishStatusEnum
.
NOTSTARTED
.
getValue
()
==
planTask
.
getFinishStatus
())
{
planTask
.
setFinishStatus
(
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
());
planTask
.
setFinishStatus
(
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
());
iPlanTaskDao
.
save
(
planTask
);
iPlanTaskDao
.
save
(
planTask
);
if
(
planTask
!=
null
)
{
PlanTaskSyncBo
planTaskSyncBo
=
buildPlanTaskBo
(
planTask
);
String
message
=
buildSyncMessage
(
PatrolDataSyncTopicEnum
.
PLAN_TASK
.
getTopic
(),
planTaskSyncBo
);
webMqttComponent
.
publish
(
PatrolDataSyncTopicEnum
.
EQM_PATROL_CREATED
.
getTopic
(),
message
);
}
}
}
}
else
if
(
XJConstant
.
STATUS_MONITOR_END
.
equals
(
jobType
))
{
}
else
if
(
XJConstant
.
STATUS_MONITOR_END
.
equals
(
jobType
))
{
if
(
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
()
==
planTask
.
getFinishStatus
())
{
if
(
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
()
==
planTask
.
getFinishStatus
())
{
...
@@ -543,6 +551,19 @@ public class JobService implements IJobService {
...
@@ -543,6 +551,19 @@ public class JobService implements IJobService {
removeJob
(
jobName
);
removeJob
(
jobName
);
}
}
public
PlanTaskSyncBo
buildPlanTaskBo
(
PlanTask
planTask
)
{
PlanTaskSyncBo
taskSyncBo
=
new
PlanTaskSyncBo
();
BeanUtils
.
copyProperties
(
planTask
,
taskSyncBo
);
return
taskSyncBo
;
}
public
String
buildSyncMessage
(
String
topic
,
Object
object
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"topic"
,
topic
);
map
.
put
(
"data"
,
object
);
return
JSON
.
toJSONString
(
map
,
SerializerFeature
.
WriteMapNullValue
);
}
@Override
@Override
public
void
msgAddJob
(
Msg
msg
)
{
public
void
msgAddJob
(
Msg
msg
)
{
addJob
(
"msg"
,
XJConstant
.
MESSAGE_PUSH
,
msg
.
getId
(),
msg
.
getFixedTime
());
addJob
(
"msg"
,
XJConstant
.
MESSAGE_PUSH
,
msg
.
getId
(),
msg
.
getFixedTime
());
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
95c7bf24
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
<if
test=
"pointName!=null"
>
and b.name like concat(concat("%",#{pointName}),"%")
</if>
<if
test=
"pointName!=null"
>
and b.name like concat(concat("%",#{pointName}),"%")
</if>
<if
test=
"pointNo!=null"
>
and b.point_no like concat('%',#{pointNo},'%')
</if>
<if
test=
"pointNo!=null"
>
and b.point_no like concat('%',#{pointNo},'%')
</if>
<if
test=
"isFixed!=null"
>
and b.is_fixed = #{isFixed}
</if>
<if
test=
"isFixed!=null"
>
and b.is_fixed = #{isFixed}
</if>
<if
test=
"isOK!=null and isO
k
!=''"
>
and a.is_OK = #{isOK}
</if>
<if
test=
"isOK!=null and isO
K
!=''"
>
and a.is_OK = #{isOK}
</if>
<if
test=
"planId!=null"
>
and a.plan_Id = #{planId}
</if>
<if
test=
"planId!=null"
>
and a.plan_Id = #{planId}
</if>
<if
test=
"planTaskId!=null"
>
and a.plan_task_id = #{planTaskId}
</if>
<if
test=
"planTaskId!=null"
>
and a.plan_task_id = #{planTaskId}
</if>
<if
test=
"userId!=null"
>
and find_in_set(#{userId}, a.user_id) > 0
</if>
<if
test=
"userId!=null"
>
and find_in_set(#{userId}, a.user_id) > 0
</if>
...
@@ -292,7 +292,7 @@
...
@@ -292,7 +292,7 @@
<if
test=
"pointName!=null"
>
and b.name like concat(concat("%",#{pointName}),"%")
</if>
<if
test=
"pointName!=null"
>
and b.name like concat(concat("%",#{pointName}),"%")
</if>
<if
test=
"pointNo!=null"
>
and b.point_no like concat('%',#{pointNo},'%')
</if>
<if
test=
"pointNo!=null"
>
and b.point_no like concat('%',#{pointNo},'%')
</if>
<if
test=
"isFixed!=null"
>
and b.is_fixed = #{isFixed}
</if>
<if
test=
"isFixed!=null"
>
and b.is_fixed = #{isFixed}
</if>
<if
test=
"isOK!=null"
>
and a.is_OK = #{isOK}
</if>
<if
test=
"isOK!=null
and isOK!=''
"
>
and a.is_OK = #{isOK}
</if>
<if
test=
"planId!=null"
>
and a.plan_Id = #{planId}
</if>
<if
test=
"planId!=null"
>
and a.plan_Id = #{planId}
</if>
<if
test=
"planTaskId!=null"
>
and a.plan_task_id = #{planTaskId}
</if>
<if
test=
"planTaskId!=null"
>
and a.plan_task_id = #{planTaskId}
</if>
<if
test=
"userId!=null"
>
and find_in_set(#{userId}, a.user_id) > 0
</if>
<if
test=
"userId!=null"
>
and find_in_set(#{userId}, a.user_id) > 0
</if>
...
...
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