From ff1aa7a9218e458dfd9255b1f87490af52afb62a Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期二, 06 一月 2026 13:39:17 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java |   42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java b/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
index 513fd34..74b1bc1 100644
--- a/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
@@ -114,6 +114,27 @@
         crnProtocol.setYDistance(0D);
         crnProtocol.setXDuration(0D);
         crnProtocol.setYDuration(0D);
+
+        BasCrnpService basCrnpService = null;
+        try {
+            basCrnpService = SpringUtils.getBean(BasCrnpService.class);
+        }catch (Exception e){
+
+        }
+        if (basCrnpService != null) {
+            BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo()));
+            if(basCrnp == null) {
+                basCrnp = new BasCrnp();
+                basCrnp.setCrnNo(deviceConfig.getDeviceNo());
+                basCrnp.setStatus(1);
+                basCrnp.setInEnable("N");
+                basCrnp.setOutEnable("N");
+                basCrnp.setMaxInTask(5);
+                basCrnp.setMaxOutTask(5);
+                basCrnp.setCreateTime(new Date());
+                basCrnpService.insert(basCrnp);
+            }
+        }
     }
 
     @Override
@@ -178,27 +199,6 @@
             redisUtil.set(RedisKeyType.DEVICE_LOG_KEY.key + System.currentTimeMillis(), deviceDataLog, 60 * 60 * 24);
             //鏇存柊閲囬泦鏃堕棿
             crnProtocol.setDeviceDataLog(System.currentTimeMillis());
-        }
-
-        BasCrnpService basCrnpService = null;
-        try {
-            basCrnpService = SpringUtils.getBean(BasCrnpService.class);
-        }catch (Exception e){
-
-        }
-        if (basCrnpService != null) {
-            BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo()));
-            if(basCrnp == null) {
-                basCrnp = new BasCrnp();
-                basCrnp.setCrnNo(deviceConfig.getDeviceNo());
-                basCrnp.setStatus(1);
-                basCrnp.setInEnable("N");
-                basCrnp.setOutEnable("N");
-                basCrnp.setMaxInTask(5);
-                basCrnp.setMaxOutTask(5);
-                basCrnp.setCreateTime(new Date());
-                basCrnpService.insert(basCrnp);
-            }
         }
     }
 

--
Gitblit v1.9.1