From 13a7ee010e75bab8030c7c0be736d0ca02d966d7 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期五, 08 十二月 2023 10:04:11 +0800
Subject: [PATCH] #避让起始列

---
 src/main/java/com/zy/core/thread/NyShuttleThread.java |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/NyShuttleThread.java b/src/main/java/com/zy/core/thread/NyShuttleThread.java
index 6d381d2..2d2b4ad 100644
--- a/src/main/java/com/zy/core/thread/NyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/NyShuttleThread.java
@@ -113,12 +113,6 @@
 
     private void readStatus() {
         try {
-            if (null == shuttleProtocol) {
-                shuttleProtocol = new NyShuttleProtocol();
-                shuttleProtocol.setShuttleNo(slave.getId().shortValue());
-                shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
-            }
-
             //----------璇诲彇鍥涘悜绌挎杞︾姸鎬�-----------
             NyShuttleHttpCommand readStatusCommand = NyHttpUtils.getReadStatusCommand(slave.getId());
             JSONObject jsonObject = NyHttpUtils.requestCommand(socket, readStatusCommand);
@@ -247,6 +241,7 @@
                     OutputQueue.SHUTTLE.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
 //                    log.info(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
                 }
+//                log.warn(JSON.toJSONString(shuttleProtocol));//杈撳嚭灏忚溅鐘舵��
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -269,6 +264,11 @@
             socket.setSoTimeout(60000);
             socket.setKeepAlive(true);
             this.socket = socket;
+            if (null == shuttleProtocol) {
+                shuttleProtocol = new NyShuttleProtocol();
+                shuttleProtocol.setShuttleNo(slave.getId().shortValue());
+            }
+            shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
             log.info(MessageFormat.format("銆恵0}銆戝洓鍚戠┛姊溅Socket閾炬帴鎴愬姛 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
         } catch (IOException e) {
             OutputQueue.SHUTTLE.offer(MessageFormat.format("銆恵0}銆戝洓鍚戠┛姊溅Socket閾炬帴澶辫触 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
@@ -405,7 +405,7 @@
                     //涓婁竴鏉℃寚浠ょ殑鐩爣浣嶇疆鍜屽綋鍓嶅皬杞︿綅缃浉鍚岋紝鍒欒瀹氫笂涓�鏉′换鍔″畬鎴�
                     lastCommand.setComplete(true);
                     //瑙i攣閿佸畾璺緞锛屼笂涓�鏉¤矾寰�
-                    List<NavigateNode> nodes = lastCommand.getNodes();
+                    List<NavigateNode> nodes = JSON.parseArray(JSON.toJSONString(lastCommand.getNodes()), NavigateNode.class);//杩涜娣卞害copy
 //                    //瑙i攣褰撳墠璺緞
 //                    if (command != null && command.getNodes() != null) {
 //                        nodes.addAll(command.getNodes());

--
Gitblit v1.9.1