From 62ed44f8c15a0d2ce8aff83129f23c1656ee9968 Mon Sep 17 00:00:00 2001
From: pjb <123456>
Date: 星期三, 03 七月 2024 19:27:04 +0800
Subject: [PATCH] 解决设备断电报错写日志把磁盘写满问题

---
 src/main/java/com/zy/core/thread/SiemensDevpThread.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index b27c739..be32c2b 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -224,7 +224,7 @@
                 }
             } else {
                 OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆戣鍙栬緭閫佺嚎plc鐘舵�佷俊鎭け璐� ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
-                log.error("璇诲彇杈撻�佺嚎plc鐘舵�佷俊鎭け璐� ===>> [id:{}] [ip:{}] [port:{}] ", slave.getId(), slave.getIp(), slave.getPort());
+//                log.error("璇诲彇杈撻�佺嚎plc鐘舵�佷俊鎭け璐� ===>> [id:{}] [ip:{}] [port:{}] ", slave.getId(), slave.getIp(), slave.getPort());
             }
 
             //鏉$爜鎵弿鍣�
@@ -271,7 +271,7 @@
                 }
             } else {
                 OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆戣鍙栬緭閫佺嚎plc鐘舵�佷俊鎭け璐� ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
-                log.error("璇诲彇杈撻�佺嚎plc鐘舵�佷俊鎭け璐� ===>> [id:{}] [ip:{}] [port:{}] ", slave.getId(), slave.getIp(), slave.getPort());
+//                log.error("璇诲彇杈撻�佺嚎plc鐘舵�佷俊鎭け璐� ===>> [id:{}] [ip:{}] [port:{}] ", slave.getId(), slave.getIp(), slave.getPort());
             }
 
             //澶栧舰妫�娴�
@@ -306,6 +306,7 @@
         }
         // 鏍规嵁瀹炴椂淇℃伅鏇存柊鏁版嵁搴�
         try {
+            if (!station.isEmpty()) {
             List<BasDevp> basDevps = new ArrayList<>();
             for (Integer siteId : staNos) {
                 StaProtocol staProtocol = station.get(siteId);
@@ -316,6 +317,7 @@
             if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) {
                 throw new Exception("鏇存柊鏁版嵁搴撴暟鎹け璐�");
             }
+            }
         } catch (Exception e) {
             e.printStackTrace();
             OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆戞洿鏂版暟鎹簱鏁版嵁澶辫触 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));

--
Gitblit v1.9.1