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
88cb43a3
Commit
88cb43a3
authored
Mar 04, 2026
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 断电重启项目测试。
parent
59ae1e5e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
77 deletions
+87
-77
AgingStageThreeProcessJob.java
...ava/com/zehong/system/task/AgingStageThreeProcessJob.java
+40
-35
AgingStageTwoProcessJob.java
.../java/com/zehong/system/task/AgingStageTwoProcessJob.java
+47
-42
No files found.
zhmes-agecal-system/src/main/java/com/zehong/system/task/AgingStageThreeProcessJob.java
View file @
88cb43a3
...
@@ -188,41 +188,46 @@ public class AgingStageThreeProcessJob implements Job {
...
@@ -188,41 +188,46 @@ public class AgingStageThreeProcessJob implements Job {
checkAndUpdateTime
(
master
,
deviceId
,
binding
);
checkAndUpdateTime
(
master
,
deviceId
,
binding
);
}
}
String
readingMode
=
binding
.
getReadingMode
();
// String readingMode = binding.getReadingMode();
// * 1 读继电器不读脉冲 * 2 读脉冲不读继电器 * 3 两个都读
// // * 1 读继电器不读脉冲 * 2 读脉冲不读继电器 * 3 两个都读
//
String
plateType
=
binding
.
getPlateType
();
// String plateType = binding.getPlateType();
//
// 处理 继电器状态,脉冲状态,模组状态,SIM卡状态,网络状态
// // 处理 继电器状态,脉冲状态,模组状态,SIM卡状态,网络状态
if
(!
"2"
.
equals
(
readingMode
))
{
// if(!"2".equals(readingMode)) {
if
(
result
[
10
]
==
1
&&
binding
.
getRelayStatus
()
==
0
){
// if(result[10] == 1 && binding.getRelayStatus() == 0){
binding
.
setRelayStatus
(
1
);
// binding.setRelayStatus(1);
}
// }
}
// }
//
if
(!
"1"
.
equals
(
readingMode
))
{
// if(!"1".equals(readingMode)) {
if
(
result
[
11
]
==
1
&&
binding
.
getPulseStatus
()
==
0
){
// if(result[11] == 1 && binding.getPulseStatus() == 0){
binding
.
setPulseStatus
(
1
);
// binding.setPulseStatus(1);
}
// }
}
// }
//
if
(
result
[
12
]
==
1
&&
binding
.
getModuleStatus
()
==
0
){
// if(result[12] == 1 && binding.getModuleStatus() == 0){
binding
.
setModuleStatus
(
1
);
// binding.setModuleStatus(1);
}
// }
if
(
result
[
13
]
==
1
&&
binding
.
getSimCardStatus
()
==
0
){
// if(result[13] == 1 && binding.getSimCardStatus() == 0){
binding
.
setSimCardStatus
(
1
);
// binding.setSimCardStatus(1);
}
// }
//
if
(
"1"
.
equals
(
plateType
))
{
// if("1".equals(plateType)) {
if
(
result
[
14
]
==
1
&&
binding
.
getNetworkStatus
()
==
0
){
// if(result[14] == 1 && binding.getNetworkStatus() == 0){
binding
.
setNetworkStatus
(
1
);
// binding.setNetworkStatus(1);
}
// }
}
// }
//
if
(
"5"
.
equals
(
binding
.
getDeviceStatus
()))
{
// if("5".equals(binding.getDeviceStatus())) {
binding
.
setWriteTimeStatus
(
"0"
);
// binding.setWriteTimeStatus("0");
}
// }
binding
.
setRelayStatus
(
result
[
10
]);
binding
.
setPulseStatus
(
result
[
11
]);
binding
.
setModuleStatus
(
result
[
12
]);
binding
.
setSimCardStatus
(
result
[
13
]);
binding
.
setNetworkStatus
(
result
[
14
]);
// 5. 更新数据库
// 5. 更新数据库
palletDeviceBindingMapper
.
updatePalletDeviceBinding
(
binding
);
palletDeviceBindingMapper
.
updatePalletDeviceBinding
(
binding
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/task/AgingStageTwoProcessJob.java
View file @
88cb43a3
...
@@ -193,48 +193,53 @@ public class AgingStageTwoProcessJob implements Job {
...
@@ -193,48 +193,53 @@ public class AgingStageTwoProcessJob implements Job {
// 2. 读取设备数据
// 2. 读取设备数据
int
[]
result
=
Modbus4jUtils
.
readDeviceWithRetry
(
ip
,
port
,
deviceId
);
int
[]
result
=
Modbus4jUtils
.
readDeviceWithRetry
(
ip
,
port
,
deviceId
);
String
readingMode
=
binding
.
getReadingMode
();
// String readingMode = binding.getReadingMode();
//
String
plateType
=
binding
.
getPlateType
();
// String plateType = binding.getPlateType();
if
(
StringUtils
.
isBlank
(
readingMode
))
{
// if(StringUtils.isBlank(readingMode)) {
readingMode
=
"3"
;
// readingMode = "3";
}
// }
//
// 不是2 的时候才读继电器
// // 不是2 的时候才读继电器
if
(!
"2"
.
equals
(
readingMode
))
{
// if(!"2".equals(readingMode)) {
if
(
result
[
10
]
==
1
)
{
// if(result[10] == 1) {
binding
.
setRelayStatus
(
1
);
// binding.setRelayStatus(1);
}
else
{
// } else {
binding
.
setRelayStatus
(
0
);
// binding.setRelayStatus(0);
}
// }
}
// }
binding
.
setRelayStatus
(
result
[
10
]);
// 不是1 的时候 才 读 脉冲
binding
.
setPulseStatus
(
result
[
11
]);
if
(!
"1"
.
equals
(
binding
.
getReadingMode
()))
{
binding
.
setModuleStatus
(
result
[
12
]);
if
(
result
[
11
]
==
1
)
{
binding
.
setSimCardStatus
(
result
[
13
]);
binding
.
setPulseStatus
(
1
);
binding
.
setNetworkStatus
(
result
[
14
]);
}
else
{
//
binding
.
setPulseStatus
(
0
);
// // 不是1 的时候 才 读 脉冲
}
// if(!"1".equals(binding.getReadingMode())) {
}
// if(result[11] == 1) {
if
(
result
[
12
]
==
1
)
{
// binding.setPulseStatus(1);
binding
.
setModuleStatus
(
1
);
// } else {
}
else
{
// binding.setPulseStatus(0);
binding
.
setModuleStatus
(
0
);
// }
}
// }
if
(
result
[
13
]
==
1
)
{
// if(result[12] == 1) {
binding
.
setSimCardStatus
(
1
);
// binding.setModuleStatus(1);
}
else
{
// } else {
binding
.
setSimCardStatus
(
0
);
// binding.setModuleStatus(0);
}
// }
// if(result[13] == 1) {
if
(
"1"
.
equals
(
plateType
))
{
// binding.setSimCardStatus(1);
if
(
result
[
14
]
==
1
)
{
// } else {
binding
.
setNetworkStatus
(
1
);
// binding.setSimCardStatus(0);
}
else
{
// }
binding
.
setNetworkStatus
(
0
);
//
}
// if("1".equals(plateType)) {
}
// if(result[14] == 1) {
// binding.setNetworkStatus(1);
// } else {
// binding.setNetworkStatus(0);
// }
// }
// 重用之前的master连接进行写操作
// 重用之前的master连接进行写操作
master
=
Modbus4jUtils
.
createModbusMaster
(
ip
,
port
);
master
=
Modbus4jUtils
.
createModbusMaster
(
ip
,
port
);
...
...
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