From 164bdd039c4f5c5fe0572b7f1f090b9346cd735f Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期日, 29 一月 2023 13:23:06 +0800
Subject: [PATCH] #

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

diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index 9bc94c7..d4991f8 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -5,12 +5,14 @@
 import HslCommunication.Profinet.Siemens.SiemensPLCS;
 import HslCommunication.Profinet.Siemens.SiemensS7Net;
 import com.alibaba.fastjson.JSON;
+import com.core.common.Cools;
 import com.core.common.DateUtils;
 import com.core.common.SpringUtils;
 import com.zy.asrs.entity.BasCrnOpt;
 import com.zy.asrs.entity.BasCrnp;
 import com.zy.asrs.service.BasCrnOptService;
 import com.zy.asrs.service.BasCrnpService;
+import com.zy.common.utils.News;
 import com.zy.core.CrnThread;
 import com.zy.core.cache.MessageQueue;
 import com.zy.core.cache.OutputQueue;
@@ -132,10 +134,10 @@
         if(connect.IsSuccess){
             result = true;
             OutputQueue.CRN.offer(MessageFormat.format( "銆恵0}銆戝爢鍨涙満plc杩炴帴鎴愬姛 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
-            log.info("鍫嗗灈鏈簆lc杩炴帴鎴愬姛 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
+            News.info("鍫嗗灈鏈簆lc杩炴帴鎴愬姛 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
         } else {
             OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆戝爢鍨涙満plc杩炴帴澶辫触锛侊紒锛� ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
-            log.error("鍫嗗灈鏈簆lc杩炴帴澶辫触锛侊紒锛� ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
+            News.error("鍫嗗灈鏈簆lc杩炴帴澶辫触锛侊紒锛� ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
             initCrn();
         }
 //        siemensNet.ConnectClose();
@@ -178,7 +180,7 @@
                 OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
 
                 // 澶嶄綅淇″彿
-                if (crnProtocol.getStatusType().equals(CrnStatusType.WAITING)) {
+                if (!Cools.isEmpty(crnProtocol.getStatusType()) && crnProtocol.getStatusType().equals(CrnStatusType.WAITING)) {
                     if (resetFlag) {
                         if(crnProtocol.getTaskNo()==9999){
                             backHpFlag = false;
@@ -281,7 +283,7 @@
         if (result != null && result.IsSuccess) {
             Thread.sleep(200);
             this.readStatus();
-            log.info("鍫嗗灈鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
+            News.info("鍫嗗灈鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
             OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] >>>>> 鍛戒护涓嬪彂锛� {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command)));
             return true;
         } else {

--
Gitblit v1.9.1