From b977364facab9c6bf1b92f9815100b15a30443ff Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期三, 08 五月 2024 17:00:07 +0800
Subject: [PATCH] 修改plc连接报警条件

---
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java |    8 ++++----
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java |   18 ++++++++++--------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
index 1fc3c55..7773370 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -23,16 +23,16 @@
 
   @Override
   public void run() {
-
+    spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
+      spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
+      
+      jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
     while (this != null) {
       try {
         spianService.result=new ArrayList<>();
         Thread.sleep(300);
         // if (S7control.getinstance().CheckConnected() == false) {
-      spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
-      spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
       
-      jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
       // 鏍规嵁鐜荤拑id鑾峰彇璁㈠崟鍙�,鍗曠嫭鏁版嵁婧�
       
       // try {
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
index 237d034..8fa8143 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -62,14 +62,7 @@
     // b.put()
     @Override
     public void run() {
-        while (this != null) {
-            Short zhi = 0;
-            JSONObject jsonObject = new JSONObject();
-            jsonObject.append("feedglassid", feedglassid);
-            try {
-                Thread.sleep(1000);
-                // 娉ㄥ叆mapper
-                homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
+        homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
                 spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
                 spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
                 outSliceServive = WebSocketServer.applicationContext.getBean(OutSliceServive.class);
@@ -77,6 +70,15 @@
                         .getBean(North_Glass_Buffer1Service.class);
                 storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
                 dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
+        while (this != null) {
+            Short zhi = 0;
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.append("feedglassid", feedglassid);
+            
+            try {
+                Thread.sleep(1000);
+                // 娉ㄥ叆mapper
+                
 
                 // boolean dbconnected = false;
                 try {

--
Gitblit v1.8.0