From 0215fce538f4f07069bf16cd2bfe505a907bcbd5 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期二, 12 九月 2023 10:06:51 +0800
Subject: [PATCH] 优化邦海智能粮情V2版

---
 igds-web/src/main/resources/static/img/aerial-5329_001.png                                  |    0 
 igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv2/msg/AnalysisService.java |    9 +++-
 igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java                |   10 ++++-
 igds-web/pom.xml                                                                            |   44 +++++++++++-----------
 4 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java b/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java
index 4e73906..595f230 100644
--- a/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java
+++ b/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java
@@ -30,11 +30,17 @@
     public void run(String... strings) throws Exception {
 
         if (configData.getActive().indexOf("pro") >= 0) {
-            bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT);
+            //寰愰椈銆丗ZZY浜戞湇鍔″櫒浣跨敤
+//            bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT);
+
+            //姹熻タ璧e窞銆佸箍涓滈珮宸炰娇鐢�
+            bhznGrainServerEngine2.start(BhznGrainV2ServerEngine.PORT);
+            //骞夸笢楂樺窞浣跨敤
            // bhznVerbServerEngine.start(BhznVerbServerEngine.PORT);
         }
         if (configData.getActive().indexOf("dev") >= 0) {
-            bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT);
+//            bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT);
+            bhznGrainServerEngine2.start(BhznGrainV2ServerEngine.PORT);
             //bhznVerbServerEngine.start(BhznVerbServerEngine.PORT);
         }
     }
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 3a46bff..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,7 +209,8 @@
      *
      * @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.push(message.getIp(),message.getPort(),BytesUtil.hexStrToBytes(hexStr));
diff --git a/igds-web/pom.xml b/igds-web/pom.xml
index ff463ac..fff77dc 100644
--- a/igds-web/pom.xml
+++ b/igds-web/pom.xml
@@ -144,7 +144,7 @@
         </dependency>
 
 
-        <!-- 鎺ュ彛鍖咃紝鍖呮嫭涓婃捣鎺ュ彛鍜屾皵璞℃帴鍙�-->
+        <!-- 鎺ュ彛鍖咃紝鍖呮嫭涓婃捣鎺ュ彛鍜屻�佹皵璞℃帴鍙c�佷笁缁存帴鍙�-->
         <dependency>
             <groupId>com.ld.igds</groupId>
             <artifactId>igds-api-inte</artifactId>
@@ -170,21 +170,21 @@
         </dependency>
 
         <!-- MODBUS-TCP -->
-<!--        <dependency>-->
-<!--            <groupId>com.ld.igds</groupId>-->
-<!--            <artifactId>igds-protocol-modbus</artifactId>-->
-<!--            <version>${igds.version}</version>-->
-<!--            <exclusions>-->
-<!--                <exclusion>-->
-<!--                    <artifactId>slf4j-log4j12</artifactId>-->
-<!--                    <groupId>org.slf4j</groupId>-->
-<!--                </exclusion>-->
-<!--                <exclusion>-->
-<!--                    <artifactId>log4j</artifactId>-->
-<!--                    <groupId>log4j</groupId>-->
-<!--                </exclusion>-->
-<!--            </exclusions>-->
-<!--        </dependency>-->
+        <dependency>
+            <groupId>com.ld.igds</groupId>
+            <artifactId>igds-protocol-modbus</artifactId>
+            <version>${igds.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>slf4j-log4j12</artifactId>
+                    <groupId>org.slf4j</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>log4j</artifactId>
+                    <groupId>log4j</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
 
 
         <!-- 绉佹湁鍗忚-椋庢鑷磋繙IOT銆佸埗姘満
@@ -221,7 +221,7 @@
             </exclusions>
         </dependency>-->
 
-        <!--  绉佹湁鍗忚-閭︽捣鏅鸿兘
+        <!--  绉佹湁鍗忚-閭︽捣鏅鸿兘-->
         <dependency>
             <groupId>com.ld.igds</groupId>
             <artifactId>igds-protocol-bhzn</artifactId>
@@ -236,9 +236,9 @@
                     <groupId>log4j</groupId>
                 </exclusion>
             </exclusions>
-        </dependency>-->
+        </dependency>
 
-        <!--  绉佹湁鍗忚-姝f潵鐢靛瓙 -->
+        <!--  绉佹湁鍗忚-姝f潵鐢靛瓙
         <dependency>
             <groupId>com.ld.igds</groupId>
             <artifactId>igds-protocol-zldz</artifactId>
@@ -253,9 +253,9 @@
                     <groupId>log4j</groupId>
                 </exclusion>
             </exclusions>
-        </dependency>
+        </dependency> -->
 
-        <!--  娴峰悍杞︾墝璇嗗埆-SDK -->
+        <!--  娴峰悍杞︾墝璇嗗埆-SDK
         <dependency>
             <groupId>com.ld.igds</groupId>
             <artifactId>igds-protocol-sdk</artifactId>
@@ -270,7 +270,7 @@
                     <groupId>log4j</groupId>
                 </exclusion>
             </exclusions>
-        </dependency>
+        </dependency>-->
     </dependencies>
 
     <dependencyManagement>
diff --git a/igds-web/src/main/resources/static/img/aerial-5329_001.png b/igds-web/src/main/resources/static/img/aerial-5329_001.png
new file mode 100644
index 0000000..be3c58e
--- /dev/null
+++ b/igds-web/src/main/resources/static/img/aerial-5329_001.png
Binary files differ

--
Gitblit v1.9.3