From 27a3b60fdd102fac12999684ead75a3a412ed66d Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期二, 12 九月 2023 08:48:13 +0800
Subject: [PATCH] Merge branch 'master' of ssh://10.153.19.150:29418/CanadaMes
---
springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
index 1597562..7e9a4fa 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
@@ -31,7 +31,7 @@
if (sendwServer != null) {
sendwServer.sendMessage(jsonObject.toString());
}
- // 将读取到的plclist转为数组
+ // 灏嗚鍙杙lc鏁版嵁鐨刾lclist杞崲涓烘暟缁�
Short[] shuzu1 = plclist.toArray(new Short[0]);
// Short[] shuzu1 = {
// 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
@@ -83,14 +83,10 @@
};
alarmMapper = WebSocketServer.applicationContext.getBean(AlarmMapper.class);
for (short i = 0; i < shuzu1.length; i++) {
- // 查询结束时间为null的个数
short result = alarmMapper.selectnullti(shuzu[i]);
- // 读取PLC对应地址的值为1并且该地址没有结束时间为null的数据,添加一条新的报警信息
if (shuzu1[i] == 1 && result == 0) {
alarmMapper.Insertalarm(shuzu[i]);
- }
- // 读取PLC对应地址的值为0并且该地址有结束时间为null的数据,修改该条数据的结束时间
- else if (shuzu1[i] == 0 && result > 0) {
+ } else if (shuzu1[i] == 0 && result > 0) {
alarmMapper.updatealarm(shuzu[i]);
}
}
--
Gitblit v1.8.0