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
f64bfb3b
Commit
f64bfb3b
authored
Nov 13, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目启动初始化巡检任务修改
parent
41a3d7fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
10 deletions
+45
-10
PlanTaskMapper.java
...ejoin/amos/patrol/business/dao/mapper/PlanTaskMapper.java
+5
-1
JobService.java
.../main/java/com/yeejoin/amos/patrol/quartz/JobService.java
+16
-9
dbTemplate_plan_task.xml
...biz/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+24
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/PlanTaskMapper.java
View file @
f64bfb3b
...
...
@@ -231,5 +231,9 @@ public interface PlanTaskMapper extends BaseMapper {
void
updatePlanTaskByPlanId
(
List
<
Long
>
ids
,
int
finishStatus
);
void
updatePlanTaskDetailsByPlanId
(
List
<
Long
>
ids
,
int
finishStatus
);
void
updatePlanTaskDetailsByPlanId
(
List
<
Long
>
ids
);
List
<
PlanTask
>
getInitPlanTaskList
();
void
updatePlanTaskList
(
long
planId
,
int
oldStatus
,
int
newStatus
);
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/JobService.java
View file @
f64bfb3b
...
...
@@ -120,7 +120,7 @@ public class JobService implements IJobService {
log
.
debug
(
"======================initScheduler==========================="
);
initTaskJob
();
initPlanTaskJob
();
initMsgJob
();
//
initMsgJob();
}
@Override
...
...
@@ -161,7 +161,7 @@ public class JobService implements IJobService {
List
<
Integer
>
statusList
=
new
ArrayList
<
Integer
>();
statusList
.
add
(
PlanTaskFinishStatusEnum
.
NOTSTARTED
.
getValue
());
statusList
.
add
(
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
());
List
<
PlanTask
>
planTaskList
=
iPlanTaskDao
.
findAllByFinishStatusIn
(
statusList
);
List
<
PlanTask
>
planTaskList
=
planTaskMapper
.
getInitPlanTaskList
(
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
log
.
error
(
"项目初始化执行开始添加定时任务监控========"
);
planTaskList
.
forEach
(
planTask
->
{
...
...
@@ -172,19 +172,18 @@ public class JobService implements IJobService {
if
(
PlanTaskFinishStatusEnum
.
NOTSTARTED
.
getValue
()
==
planTask
.
getFinishStatus
())
{
if
(
beginTime
.
getTime
()
>
timestamp
)
{
planTaskAddJob
(
planTask
);
}
else
if
(
beginTime
.
getTime
()
<
timestamp
&&
endTime
.
getTime
()
>
timestamp
)
{
planTask
.
setFinishStatus
(
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
());
iPlanTaskDao
.
save
(
planTask
);
planTaskMapper
.
updatePlanTaskList
(
planTask
.
getPlanId
(),
PlanTaskFinishStatusEnum
.
NOTSTARTED
.
getValue
(),
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
());
planTaskAddJob
(
planTask
);
}
else
if
(
endTime
.
getTime
()
<
timestamp
)
{
updatePlanTask
Status
(
planTask
,
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
()
);
updatePlanTask
AndDetailStatus
(
planTask
);
}
}
else
{
if
(
endTime
.
getTime
()
<
timestamp
)
{
updatePlanTaskStatus
(
planTask
,
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
());
}
else
{
planTaskMapper
.
updatePlanTaskList
(
planTask
.
getPlanId
(),
PlanTaskFinishStatusEnum
.
NOTSTARTED
.
getValue
(),
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
());
planTaskAddJob
(
planTask
);
}
else
{
updatePlanTaskAndDetailStatus
(
planTask
);
}
}
}
catch
(
ParseException
e
)
{
...
...
@@ -196,6 +195,14 @@ public class JobService implements IJobService {
}
private
void
updatePlanTaskAndDetailStatus
(
PlanTask
planTask
)
{
planTaskMapper
.
updatePlanTaskList
(
planTask
.
getPlanId
(),
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
(),
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
());
List
<
Long
>
ids
=
new
ArrayList
<>();
ids
.
add
(
planTask
.
getId
());
planTaskMapper
.
updatePlanTaskDetailsByPlanId
(
ids
);
createOmissionCheckRecord
(
planTask
);
}
private
void
initMsgJob
()
{
List
<
Msg
>
msgList
=
iMsgDao
.
findAllByIsImmediatelyTrueAndStatus
(
0
);
if
(!
msgList
.
isEmpty
())
{
...
...
@@ -602,7 +609,7 @@ public class JobService implements IJobService {
}
else
if
(
XJConstant
.
STATUS_MONITOR_END
.
equals
(
jobType
))
{
if
(!
ValidationUtil
.
isEmpty
(
StartPlanTaskList
))
{
planTaskMapper
.
updatePlanTaskByPlanId
(
StartPlanTaskList
,
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
());
planTaskMapper
.
updatePlanTaskDetailsByPlanId
(
StartPlanTaskList
,
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
()
);
planTaskMapper
.
updatePlanTaskDetailsByPlanId
(
StartPlanTaskList
);
for
(
PlanTask
planTask:
planTaskList
)
{
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
f64bfb3b
...
...
@@ -1606,4 +1606,27 @@
</foreach>
AND is_finish = 0
</update>
<select
id=
"getInitPlanTaskList"
resultType=
"com.yeejoin.amos.patrol.dao.entity.PlanTask"
>
SELECT
*
FROM
"p_plan_task"
WHERE
finish_status = '1'
OR finish_status = '0'
GROUP BY
plan_id,
finish_status
</select>
<update
id=
"updatePlanTaskList"
>
update
"p_plan_task"
set
finish_status = #{newStatus}
where
plan_id = #{planId}
and finish_status = #{oldStatus}
</update>
</mapper>
\ No newline at end of file
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