From 6c3899978b6fc7f4bd82e386bda35b583f93dfb8 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期六, 16 八月 2025 18:53:40 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/SiemensCrnThread.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index f9ecce5..27e31f3 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -208,7 +208,15 @@
                     }
                 }
 
-                if (System.currentTimeMillis() - crnProtocol.getDeviceDataLog() > 1000 * 5) {
+                if (crnProtocol.getAlarm() > 0) {
+                    crnProtocol.setLastCommandTime(-1L);
+                }
+
+                if (crnProtocol.getAlarm() == 0 && crnProtocol.getLastCommandTime() == -1) {
+                    crnProtocol.setLastCommandTime(System.currentTimeMillis());
+                }
+
+                if (System.currentTimeMillis() - crnProtocol.getDeviceDataLog() > 1000 * 1) {
                     //閲囬泦鏃堕棿瓒呰繃5s锛屼繚瀛樹竴娆℃暟鎹褰�
                     //淇濆瓨鏁版嵁璁板綍
                     DeviceDataLogService deviceDataLogService = SpringUtils.getBean(DeviceDataLogService.class);

--
Gitblit v1.9.1