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
df387f58
Commit
df387f58
authored
Sep 24, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "1 测试 上电后通信 和 最终完成 定时任务功能"
parent
0f8f8576
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
DeviceCommunicationJob.java
...n/java/com/zehong/system/task/DeviceCommunicationJob.java
+4
-5
No files found.
zhmes-agecal-system/src/main/java/com/zehong/system/task/DeviceCommunicationJob.java
View file @
df387f58
...
...
@@ -96,7 +96,6 @@ public class DeviceCommunicationJob implements Job {
// 将变量声明为final,供匿名内部类使用
final
String
finalIp
=
ip
;
final
Long
finalFStoreyId
=
fStoreyId
;
final
TStoreyInfo
finalTStoreyInfo
=
tStoreyInfo
;
// 设备ID列表
List
<
Integer
>
offsets1
=
Arrays
.
asList
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
);
...
...
@@ -107,23 +106,23 @@ public class DeviceCommunicationJob implements Job {
executeWithTimeout
(()
->
{
deviceStatusReaderAndTimeSetter
.
startMultiDeviceMonitoring
(
finalIp
,
501
,
offsets1
,
resultHandler
,
ModbusResultHandler
.
createDefaultStopCondition
());
log
.
info
(
"Modbus 501端口通信完成:fStoreyId={}"
,
finalFStoreyId
);
},
10
,
TimeUnit
.
SECONDS
,
finalT
StoreyInfo
,
"501端口通信超时"
,
finalIp
,
finalFStoreyId
);
},
10
,
TimeUnit
.
SECONDS
,
t
StoreyInfo
,
"501端口通信超时"
,
finalIp
,
finalFStoreyId
);
executeWithTimeout
(()
->
{
deviceStatusReaderAndTimeSetter
.
startMultiDeviceMonitoring
(
finalIp
,
502
,
offsets2
,
resultHandler
,
ModbusResultHandler
.
createDefaultStopCondition
());
log
.
info
(
"Modbus 502端口通信完成:fStoreyId={}"
,
finalFStoreyId
);
},
10
,
TimeUnit
.
SECONDS
,
finalT
StoreyInfo
,
"502端口通信超时"
,
finalIp
,
finalFStoreyId
);
},
10
,
TimeUnit
.
SECONDS
,
t
StoreyInfo
,
"502端口通信超时"
,
finalIp
,
finalFStoreyId
);
executeWithTimeout
(()
->
{
deviceStatusReaderAndTimeSetter
.
startMultiDeviceMonitoring
(
finalIp
,
503
,
offsets3
,
resultHandler
,
ModbusResultHandler
.
createDefaultStopCondition
());
log
.
info
(
"Modbus 503端口通信完成:fStoreyId={}"
,
finalFStoreyId
);
},
10
,
TimeUnit
.
SECONDS
,
finalT
StoreyInfo
,
"503端口通信超时"
,
finalIp
,
finalFStoreyId
);
},
10
,
TimeUnit
.
SECONDS
,
t
StoreyInfo
,
"503端口通信超时"
,
finalIp
,
finalFStoreyId
);
// 校验执行时间
long
costTime
=
System
.
currentTimeMillis
()
-
startTime
;
if
(
costTime
>
110000
)
{
log
.
warn
(
"任务执行时间过长:{}ms(接近Cron周期),可能导致任务叠加"
,
costTime
);
recordAlarm
(
finalT
StoreyInfo
,
"任务执行时间过长:"
+
costTime
+
"ms"
);
recordAlarm
(
t
StoreyInfo
,
"任务执行时间过长:"
+
costTime
+
"ms"
);
}
log
.
info
(
"=== DeviceCommunicationJob 执行成功:fStoreyId={}(耗时:{}ms) ==="
,
finalFStoreyId
,
costTime
);
...
...
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