From 271f8ac3fc635fcf96d3226dc7d37f81c9755c2b Mon Sep 17 00:00:00 2001
From: lsh <lsh123456>
Date: 星期五, 28 六月 2024 02:21:17 +0800
Subject: [PATCH] #

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

diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index 0929642..0adeb16 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -357,7 +357,7 @@
         do {
             try{
                 if(!result.IsSuccess){
-                    log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔�  鍐欏叆鐩存帴澶辫触 ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSON(command),writeCount);
+                    log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔�  鍐欏叆鐩存帴澶辫触 ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSONString(command),writeCount);
                     result = siemensNet.Write("DB100.0", array);
                     Thread.sleep(100);
                     writeCount++;
@@ -380,12 +380,12 @@
                             || !command.getDestinationPosY().equals(one.getDestinationPosY()) || !command.getDestinationPosZ().equals(one.getDestinationPosZ())
                     ){
                         try{
-                            log.error("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇诲け璐�==>涓嶄竴鑷碵id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one));
+                            log.error("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇诲け璐�==>涓嶄竴鑷碵id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSONString(command),JSON.toJSONString(one));
                         }catch (Exception e){
                             try{
-                                log.error("鏃ュ織鎵撳嵃澶辫触锛�===>>鍙傛暟one鎶ラ敊 [id:{}],{}", slave.getId(), JSON.toJSON(command),JSON.toJSON(resultRead));
+                                log.error("鏃ュ織鎵撳嵃澶辫触锛�===>>鍙傛暟one鎶ラ敊 [id:{}],{}", slave.getId(), JSON.toJSONString(command),JSON.toJSONString(resultRead));
                             }catch (Exception e1){
-                                log.error("鏃ュ織鎵撳嵃澶辫触锛�===>> [id:{}],{}", slave.getId(), JSON.toJSON(command));
+                                log.error("鏃ュ織鎵撳嵃澶辫触锛�===>> [id:{}],{}", slave.getId(), JSON.toJSONString(command));
                             }
                         }
                         try{
@@ -393,12 +393,12 @@
                         }catch (Exception e){
 
                         }
-                        log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔�  鍥炶涓嶄竴鑷� ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSON(command),writeCount);
+                        log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔�  鍥炶涓嶄竴鑷� ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSONString(command),writeCount);
                         result = siemensNet.Write("DB100.0", array);
                         writeCount++;
                         continue;
                     } else {
-                        log.info("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇绘垚鍔焄id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one));
+                        log.info("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇绘垚鍔焄id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSONString(command),JSON.toJSONString(one));
                         break;
                     }
                 }
@@ -455,8 +455,8 @@
         if (result != null && result.IsSuccess) {
             Thread.sleep(200);
             this.readStatus();
-            log.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)));
+            log.info("鍫嗗灈鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSONString(command));
+            OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] >>>>> 鍛戒护涓嬪彂锛� {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSONString(command)));
             return true;
         } else {
             OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆戝啓鍏ュ爢鍨涙満plc鏁版嵁澶辫触 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
@@ -498,7 +498,7 @@
         do {
             try{
                 if(!result.IsSuccess){
-                    log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔�  鍐欏叆鐩存帴澶辫触 ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSON(command),writeCount);
+                    log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔�  鍐欏叆鐩存帴澶辫触 ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSONString(command),writeCount);
                     result = siemensNet.Write("DB100.20", array);
                     Thread.sleep(100);
                     writeCount++;
@@ -521,12 +521,12 @@
                             || !command.getDestinationPosY().equals(one.getDestinationPosY()) || !command.getDestinationPosZ().equals(one.getDestinationPosZ())
                     ){
                         try{
-                            log.error("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇诲け璐�==>涓嶄竴鑷碵id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one));
+                            log.error("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇诲け璐�==>涓嶄竴鑷碵id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSONString(command),JSON.toJSONString(one));
                         }catch (Exception e){
                             try{
-                                log.error("鏃ュ織鎵撳嵃澶辫触锛�===>>鍙傛暟one鎶ラ敊 [id:{}],{}", slave.getId(), JSON.toJSON(command),JSON.toJSON(resultRead));
+                                log.error("鏃ュ織鎵撳嵃澶辫触锛�===>>鍙傛暟one鎶ラ敊 [id:{}],{}", slave.getId(), JSON.toJSONString(command),JSON.toJSONString(resultRead));
                             }catch (Exception e1){
-                                log.error("鏃ュ織鎵撳嵃澶辫触锛�===>> [id:{}],{}", slave.getId(), JSON.toJSON(command));
+                                log.error("鏃ュ織鎵撳嵃澶辫触锛�===>> [id:{}],{}", slave.getId(), JSON.toJSONString(command));
                             }
                         }
                         try{
@@ -534,12 +534,12 @@
                         }catch (Exception e){
 
                         }
-                        log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔�  鍥炶涓嶄竴鑷� ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSON(command),writeCount);
+                        log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔�  鍥炶涓嶄竴鑷� ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSONString(command),writeCount);
                         result = siemensNet.Write("DB100.20", array);
                         writeCount++;
                         continue;
                     } else {
-                        log.info("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇绘垚鍔焄id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one));
+                        log.info("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇绘垚鍔焄id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSONString(command),JSON.toJSONString(one));
                         break;
                     }
                 }
@@ -596,8 +596,8 @@
         if (result != null && result.IsSuccess) {
             Thread.sleep(200);
             this.readStatus();
-            log.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)));
+            log.info("鍫嗗灈鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSONString(command));
+            OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] >>>>> 鍛戒护涓嬪彂锛� {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSONString(command)));
             return true;
         } else {
             OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆戝啓鍏ュ爢鍨涙満plc鏁版嵁澶辫触 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));

--
Gitblit v1.9.1