From 09fe50d59e2f1e2261d376eb49ad6c40301f25b4 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期五, 10 五月 2024 16:08:59 +0800
Subject: [PATCH] 修改IP与数据库连接

---
 springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 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 6989dec..99f639c 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
@@ -2,6 +2,7 @@
 
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
+import lombok.extern.slf4j.Slf4j;
 
 import java.io.BufferedReader;
 import java.io.FileInputStream;
@@ -15,6 +16,7 @@
 
 import com.example.springboot.mapper.AlarmMapper;
 
+@Slf4j
 public class Plcalarm extends Thread {
   private AlarmMapper alarmMapper;
 
@@ -78,11 +80,7 @@
     while (this != null) {
       try {
         Thread.sleep(1000);
-      } catch (InterruptedException e) {
-        e.printStackTrace();
-      }
-
-      this.readValue();
+        this.readValue();
       String PlcAddress = this.name;
       Integer Plccount = this.count;
 
@@ -141,7 +139,10 @@
               }
             }
           }
-        }
+      } catch (InterruptedException e) {
+        e.printStackTrace();
       }
-    }
 
+    }
+  }
+}

--
Gitblit v1.8.0