From 597de022b7ebbdeafc4c2a4cf76a008c0029e2cc Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期三, 20 九月 2023 19:07:07 +0800
Subject: [PATCH] 调整出库空指针错误问题

---
 igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv2/msg/AnalysisService.java |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv2/msg/AnalysisService.java b/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv2/msg/AnalysisService.java
index 5d4e413..4a33cf9 100644
--- a/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv2/msg/AnalysisService.java
+++ b/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv2/msg/AnalysisService.java
@@ -81,6 +81,7 @@
                 ser.setPort(message.getPort());
                 ser.setStatus(Constant.YN_Y);
                 coreSerService.updateByData(ser);
+                log.info("涓绘満------->>骞冲彴锛氭敞鍐屾垚鍔燂紝鍒嗘満淇℃伅={}", ser);
             }
             return;
         }
@@ -164,7 +165,7 @@
 
             //濡傛灉褰撳墠鍖呯殑鏁版嵁涓暟澶т簬绛変簬褰撳墠浠撳簱鐨勯厤缃偣浣嶅垯琛ㄧず鍗曞寘杩斿洖
             if (curPoint >= sumPoint) {
-
+                log.info("鍒嗘満------>>>骞冲彴锛氱伯鎯呮暟鎹崟鍖�=" + grainHex);
                 //杩斿洖绮儏鎺ユ敹淇℃伅
                 replayGrain(message);
 
@@ -188,11 +189,12 @@
             if (grainHex.length() >= sumPoint * 4) {
                 //杩斿洖绮儏鎺ユ敹淇℃伅
                 replayGrain(message);
-
+                log.info("鍒嗘満------>>>骞冲彴锛氱伯鎯呮暟鎹鍖咃紝瀹屾暣鏁版嵁=" + grainHex);
                 analysisGrain2(ser, message, exeRequest, depotConf, sysConf, batchId, grainHex);
                 return;
 
             } else {
+                log.info("鍒嗘満------>>>骞冲彴锛氬皢绗竴鍖呮暟鎹瓨鍏ュ唴瀛�=" + grainHex);
                 contextMapGrain.put(key, grainHex);
                 replayGrain(message);
             }
@@ -207,10 +209,11 @@
      *
      * @param message
      */
-    private void replayGrain(IoMessage message) {
+    private void replayGrain(IoMessage message) throws InterruptedException {
+        Thread.sleep(50);
         String hexStr = CommandBuild.getMsgGrainReply(message.getAddr());
         log.info("骞冲彴--------->>>涓绘満锛岃繑鍥炵伯鎯呮姤鏂囨敹鍒颁俊鎭紝鎶ユ枃={}", hexStr);
-        serverEngine.pushByMin(hexStr);
+        serverEngine.push(message.getIp(),message.getPort(),BytesUtil.hexStrToBytes(hexStr));
     }
 
     private void analysisGrain2(DeviceSer ser, IoMessage message, ExeRequest exeRequest, DepotConf depotConf, DicSysConf sysConf, String batchId, String grainStr) {
@@ -459,7 +462,7 @@
         } finally {
             String hexStr = CommandBuild.getMsgTHReply(message.getAddr());
             log.info("骞冲彴--------->>>涓绘満锛岃繑鍥炰粨娓╀粨婀挎敹鍒颁俊鎭紝鎶ユ枃={}", hexStr);
-            serverEngine.pushByMin(hexStr);
+            serverEngine.push(message.getIp(),message.getPort(),BytesUtil.hexStrToBytes(hexStr));
         }
     }
 

--
Gitblit v1.9.3