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
6cda3844
Commit
6cda3844
authored
Dec 31, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 写自检后 判断下 是否写成功
2 写自检 根据 状态 去 判断 是否需要写
parent
50632aea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
23 deletions
+40
-23
AgingStageOneProcessJob.java
.../java/com/zehong/system/task/AgingStageOneProcessJob.java
+5
-4
AgingStageThreeProcessJob.java
...ava/com/zehong/system/task/AgingStageThreeProcessJob.java
+5
-5
AgingStageTwoProcessJob.java
.../java/com/zehong/system/task/AgingStageTwoProcessJob.java
+30
-14
No files found.
zhmes-agecal-system/src/main/java/com/zehong/system/task/AgingStageOneProcessJob.java
View file @
6cda3844
...
@@ -177,11 +177,12 @@ public class AgingStageOneProcessJob implements Job {
...
@@ -177,11 +177,12 @@ public class AgingStageOneProcessJob implements Job {
binding
.
setRecordMinute
(
String
.
valueOf
(
writeCurrentTimeVo
.
getMinute
()));
binding
.
setRecordMinute
(
String
.
valueOf
(
writeCurrentTimeVo
.
getMinute
()));
binding
.
setWriteTimeStatus
(
"1"
);
binding
.
setWriteTimeStatus
(
"1"
);
}
}
}
// 5. 写入自检让设备开始自检,跟 上面的状态没关系
int
i
=
Modbus4jUtils
.
writeSelfCheckStatus
(
master
,
deviceId
);
binding
.
setWriteSelfCheckStatus
(
i
);
// 5. 写入自检让设备开始自检,跟 上面的状态没关系
// 20251231 写自检 根据状态判断
int
i
=
Modbus4jUtils
.
writeSelfCheckStatus
(
master
,
deviceId
);
binding
.
setWriteSelfCheckStatus
(
i
);
}
// 6. 更新数据库
// 6. 更新数据库
palletDeviceBindingMapper
.
updatePalletDeviceBinding
(
binding
);
palletDeviceBindingMapper
.
updatePalletDeviceBinding
(
binding
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/task/AgingStageThreeProcessJob.java
View file @
6cda3844
...
@@ -191,19 +191,19 @@ public class AgingStageThreeProcessJob implements Job {
...
@@ -191,19 +191,19 @@ public class AgingStageThreeProcessJob implements Job {
}
}
// 处理 继电器状态,脉冲状态,模组状态,SIM卡状态,网络状态
// 处理 继电器状态,脉冲状态,模组状态,SIM卡状态,网络状态
if
(
result
[
10
]
==
1
){
if
(
result
[
10
]
==
1
&&
binding
.
getRelayStatus
()
==
0
){
binding
.
setRelayStatus
(
1
);
binding
.
setRelayStatus
(
1
);
}
}
if
(
result
[
11
]
==
1
){
if
(
result
[
11
]
==
1
&&
binding
.
getPulseStatus
()
==
0
){
binding
.
setPulseStatus
(
1
);
binding
.
setPulseStatus
(
1
);
}
}
if
(
result
[
12
]
==
1
){
if
(
result
[
12
]
==
1
&&
binding
.
getModuleStatus
()
==
0
){
binding
.
setModuleStatus
(
1
);
binding
.
setModuleStatus
(
1
);
}
}
if
(
result
[
13
]
==
1
){
if
(
result
[
13
]
==
1
&&
binding
.
getSimCardStatus
()
==
0
){
binding
.
setSimCardStatus
(
1
);
binding
.
setSimCardStatus
(
1
);
}
}
if
(
result
[
14
]
==
1
){
if
(
result
[
14
]
==
1
&&
binding
.
getNetworkStatus
()
==
0
){
binding
.
setNetworkStatus
(
1
);
binding
.
setNetworkStatus
(
1
);
}
}
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/task/AgingStageTwoProcessJob.java
View file @
6cda3844
...
@@ -200,22 +200,38 @@ public class AgingStageTwoProcessJob implements Job {
...
@@ -200,22 +200,38 @@ public class AgingStageTwoProcessJob implements Job {
errorCount
.
incrementAndGet
();
errorCount
.
incrementAndGet
();
return
false
;
return
false
;
}
}
if
(
result
[
10
]
==
1
)
{
int
relayStatus
=
result
[
10
];
binding
.
setRelayStatus
(
1
);
int
pulseStatus
=
result
[
11
];
}
else
{
int
moduleStatus
=
result
[
12
];
binding
.
setRelayStatus
(
0
);
int
simCardStatus
=
result
[
13
];
}
int
networkStatus
=
result
[
14
];
if
(
result
[
11
]
==
1
)
{
binding
.
setPulseStatus
(
1
);
binding
.
setRelayStatus
(
relayStatus
);
}
else
{
binding
.
setPulseStatus
(
pulseStatus
);
binding
.
setPulseStatus
(
0
);
binding
.
setModuleStatus
(
moduleStatus
);
}
binding
.
setSimCardStatus
(
simCardStatus
);
if
(
result
[
12
]
==
1
)
{
binding
.
setNetworkStatus
(
networkStatus
);
binding
.
setModuleStatus
(
1
);
}
else
{
binding
.
setModuleStatus
(
0
);
}
if
(
result
[
13
]
==
1
)
{
binding
.
setSimCardStatus
(
1
);
}
else
{
binding
.
setSimCardStatus
(
0
);
}
if
(
result
[
14
]
==
1
)
{
binding
.
setNetworkStatus
(
1
);
}
else
{
binding
.
setNetworkStatus
(
0
);
}
// 重用之前的master连接进行写操作
// 重用之前的master连接进行写操作
master
=
Modbus4jUtils
.
createModbusMaster
(
ip
,
port
);
master
=
Modbus4jUtils
.
createModbusMaster
(
ip
,
port
);
int
i
=
Modbus4jUtils
.
writeSelfCheckStatus
(
master
,
deviceId
);
// 2025 1231 根据状态去执行自检
binding
.
setWriteSelfCheckStatus
(
i
);
if
(
result
[
1
]
==
1
||
result
[
1
]
==
3
||
result
[
1
]
==
4
)
{
int
i
=
Modbus4jUtils
.
writeSelfCheckStatus
(
master
,
deviceId
);
binding
.
setWriteSelfCheckStatus
(
i
);
}
// 5. 更新数据库
// 5. 更新数据库
palletDeviceBindingMapper
.
updatePalletDeviceBinding
(
binding
);
palletDeviceBindingMapper
.
updatePalletDeviceBinding
(
binding
);
...
...
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