Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zhmes-agecal
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
耿迪迪
zhmes-agecal
Commits
5ee584e4
Commit
5ee584e4
authored
Sep 23, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1测试上电断电操作
parent
7576b766
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
DeviceTaskScheduler.java
...main/java/com/zehong/system/task/DeviceTaskScheduler.java
+7
-1
No files found.
zhmes-agecal-system/src/main/java/com/zehong/system/task/DeviceTaskScheduler.java
View file @
5ee584e4
...
...
@@ -34,6 +34,7 @@ public class DeviceTaskScheduler {
*/
public
void
scheduleDeviceMonitoring
(
Long
fStoreyId
,
String
fPowerOutageIp
,
Integer
fPowerOutagePort
)
throws
SchedulerException
{
log
.
info
(
"创建设备监控任务:{}"
,
fStoreyId
);
// 2. 创建每小时通信任务
createHourlyCommunicationJob
(
fStoreyId
);
...
...
@@ -46,6 +47,7 @@ public class DeviceTaskScheduler {
*/
private
void
createHourlyCommunicationJob
(
Long
fStoreyId
)
throws
SchedulerException
{
// 1. 构建任务唯一标识(JobKey = jobId + 任务组名)
log
.
info
(
"创建每小时通信任务:{}"
,
fStoreyId
);
String
jobId
=
"COMM_"
+
fStoreyId
;
JobKey
jobKey
=
new
JobKey
(
jobId
,
JOB_GROUP
);
// 构建触发器唯一标识(TriggerKey = jobId + "_TRIGGER" + 触发器组名)
...
...
@@ -70,7 +72,10 @@ public class DeviceTaskScheduler {
// 4. 分场景处理:存在则更新,不存在则创建
if
(
scheduler
.
checkExists
(
jobKey
))
{
// 先删除旧触发器再添加新触发器
// 删除旧触发器,避免冲突
if
(
scheduler
.
checkExists
(
triggerKey
))
{
scheduler
.
unscheduleJob
(
triggerKey
);
}
scheduler
.
scheduleJob
(
newTrigger
);
log
.
info
(
"每小时通信任务[{}]已存在,成功更新触发器"
,
jobId
);
}
else
{
...
...
@@ -85,6 +90,7 @@ public class DeviceTaskScheduler {
*/
private
void
createFinalExecutionJob
(
Long
fStoreyId
,
String
fPowerOutageIp
,
Integer
fPowerOutagePort
)
throws
SchedulerException
{
log
.
info
(
"创建71小时后执行任务:{}"
,
fStoreyId
);
String
jobId
=
"FINAL_"
+
fStoreyId
;
JobKey
jobKey
=
new
JobKey
(
jobId
,
JOB_GROUP
);
TriggerKey
triggerKey
=
new
TriggerKey
(
jobId
+
"_TRIGGER"
,
TRIGGER_GROUP
);
...
...
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