From b579fe0be3bd02ec39d612a62b23901fb852c173 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期六, 16 八月 2025 09:02:12 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/RgvThread.java |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/RgvThread.java b/src/main/java/com/zy/core/thread/RgvThread.java
index 0fc5c79..0e89c7b 100644
--- a/src/main/java/com/zy/core/thread/RgvThread.java
+++ b/src/main/java/com/zy/core/thread/RgvThread.java
@@ -9,8 +9,10 @@
 import com.core.common.SpringUtils;
 import com.zy.asrs.entity.BasRgv;
 import com.zy.asrs.entity.BasRgvOpt;
+import com.zy.asrs.entity.DeviceDataLog;
 import com.zy.asrs.service.BasRgvOptService;
 import com.zy.asrs.service.BasRgvService;
+import com.zy.asrs.service.DeviceDataLogService;
 import com.zy.common.utils.News;
 import com.zy.core.RgvThread2;
 import com.zy.core.cache.MessageQueue;
@@ -26,6 +28,7 @@
 import lombok.extern.slf4j.Slf4j;
 
 import java.text.MessageFormat;
+import java.util.Base64;
 import java.util.Date;
 
 /**
@@ -183,6 +186,22 @@
                     }
                 }
 
+                if (System.currentTimeMillis() - rgvProtocol.getDeviceDataLog() > 1000 * 5) {
+                    //閲囬泦鏃堕棿瓒呰繃5s锛屼繚瀛樹竴娆℃暟鎹褰�
+                    //淇濆瓨鏁版嵁璁板綍
+                    DeviceDataLogService deviceDataLogService = SpringUtils.getBean(DeviceDataLogService.class);
+                    DeviceDataLog deviceDataLog = new DeviceDataLog();
+                    deviceDataLog.setOriginData(Base64.getEncoder().encodeToString(result.Content));
+                    deviceDataLog.setWcsData(JSON.toJSONString(rgvProtocol));
+                    deviceDataLog.setType("rgv");
+                    deviceDataLog.setDeviceNo(rgvProtocol.getRgvNo());
+                    deviceDataLog.setCreateTime(new Date());
+                    deviceDataLogService.insert(deviceDataLog);
+
+                    //鏇存柊閲囬泦鏃堕棿
+                    rgvProtocol.setDeviceDataLog(System.currentTimeMillis());
+                }
+
                 try {
                     // 鏍规嵁瀹炴椂淇℃伅鏇存柊鏁版嵁搴�
                     BasRgvService basRgvService = SpringUtils.getBean(BasRgvService.class);

--
Gitblit v1.9.1