From a376b30e63684f1a0f5b7f45322801be9145c09f Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期六, 07 十月 2023 10:43:19 +0800
Subject: [PATCH] 贝博粮情解析4

---
 igds-web/src/main/resources/application-pro.yml                                                    |   10 ++--
 igds-web/src/main/resources/application.yml                                                        |    2 
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java |   43 ++++++++++++---------
 igds-web/pom.xml                                                                                   |    9 ++--
 igds-web/src/main/resources/application-uat.yml                                                    |    8 ++--
 5 files changed, 38 insertions(+), 34 deletions(-)

diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java
index 176e119..f93e77b 100644
--- a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java
@@ -20,6 +20,7 @@
 import com.ld.igds.protocol.beibo.grainv1.util.BeiboGrainServerUtils;
 import com.ld.igds.util.BytesUtil;
 import com.ld.igds.util.ContextUtil;
+import com.ld.igds.util.NumberUtil;
 import com.ld.igds.warn.WarnUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -170,23 +171,6 @@
         }
 
         // 涓�鍒嗗嚑澶氫粨鎯呭喌锛岃�冭檻鍗曚粨閲囬泦鍜屽浠撻噰闆�
-        // 鍗曚粨閲囬泦鏃跺�欐暟鎹粠0杩斿洖
-        if (StringUtils.isEmpty(exeRequest.getDepotIds())) {
-
-            depotConf.setCableEnd(depotConf.getCableEnd() - depotConf.getCableStart() + 1);
-            depotConf.setCableStart(ser.getCableStart());
-
-            if (DepotType.TYPE_02.getCode().equals(depotConf.getDepotType())) {
-                analysisStep2(depotConf, ser, exeRequest, reMessage, sysConf);
-            } else if (DepotType.TYPE_04.getCode().equals(depotConf.getDepotType())) {
-                analysisStep2(depotConf, ser, exeRequest, reMessage, sysConf);
-            } else {
-                analysisStep1(depotConf, ser, exeRequest, reMessage, sysConf);
-            }
-
-            return;
-
-        }
 
         // 鎵归噺閲囬泦鎵�鏈夊叧鑱斾竴璧烽噰闆嗭紝閬嶅巻鎵ц
         for (DepotConf depotConfTemp : depotConfs) {
@@ -264,12 +248,22 @@
         int curRoot = 1;//鎵�鍦ㄦ牴
         int curCir = 1;//鎵�鍦ㄥ湀
         int cirLay = 1;//褰撳墠鍦堢殑灞�
+        int symbol = 0; //绗﹀彿浣�
         for (int i = 0; i < strPoints.length() / 4; i++) {
             temp = strPoints.substring(i * 4, i * 4 + 4);
             if (temp == null) {
                 temp = "0000";
             }
-            tempValue = BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) / 10.0;
+            //楂樹綆浣嶈浆鎹㈠悗杞负16浣嶄簩杩涘埗瀛楃涓�
+            temp = BytesUtil.toBinary8StringSame(BytesUtil.hexToInt(BytesUtil.tran_LH(temp)), 16);
+            //绗﹀彿浣�
+            symbol = Integer.valueOf(temp.substring(0, 1));
+            //鑾峰彇娓╁害鍊�
+            tempValue = BytesUtil.hexToInt(BytesUtil.binToHex(temp.substring(6))) * 0.0625;
+            if(symbol == 1){
+                tempValue = (1- BytesUtil.hexToInt(BytesUtil.binToHex(temp.substring(6))))*0.0625;
+            }
+            tempValue = NumberUtil.keepPrecision(tempValue, 1);
 
             //闈炴甯稿��
             if (tempValue > ERROR_CHECK_TAG2) {
@@ -369,12 +363,23 @@
         List<Double> temps = new ArrayList<>();
         double tempValue;
         String temp;
+        int symbol = 0;
         for (int i = 0; i < strPoints.length() / 4; i++) {
             temp = strPoints.substring(i * 4, i * 4 + 4);
             if (temp == null) {
                 temp = "0000";
             }
-            tempValue = BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) / 10.0;
+
+            //楂樹綆浣嶈浆鎹㈠悗杞负16浣嶄簩杩涘埗瀛楃涓�
+            temp = BytesUtil.toBinary8StringSame(BytesUtil.hexToInt(BytesUtil.tran_LH(temp)), 16);
+            //绗﹀彿浣�
+            symbol = Integer.valueOf(temp.substring(0, 1));
+            //鑾峰彇娓╁害鍊�
+            tempValue = BytesUtil.hexToInt(BytesUtil.binToHex(temp.substring(6))) * 0.0625;
+            if(symbol == 1){
+                tempValue = (1- BytesUtil.hexToInt(BytesUtil.binToHex(temp.substring(6))))*0.0625;
+            }
+            tempValue = NumberUtil.keepPrecision(tempValue, 1);
             // 璇存槑瑙f瀽鐨勬暟鎹湁闂
             if (tempValue == ERROR_CHECK_TAG || tempValue == ERROR_CHECK_TAG2) {
                 tempValue = Constant.ERROR_TEMP;
diff --git a/igds-web/pom.xml b/igds-web/pom.xml
index 7c4af0a..14866a1 100644
--- a/igds-web/pom.xml
+++ b/igds-web/pom.xml
@@ -10,7 +10,6 @@
         <groupId>com.ld.igds</groupId>
         <artifactId>igds-parent-pom</artifactId>
         <version>4.0.0-RELEASE</version>
-        <relativePath>../igds-parent-pom/pom.xml</relativePath>
     </parent>
 
     <dependencies>
@@ -239,7 +238,7 @@
             </exclusions>
         </dependency>
 
-        <!--  绉佹湁鍗忚-閭︽捣鏅鸿兘
+        <!--  绉佹湁鍗忚-閭︽捣鏅鸿兘-->
         <dependency>
             <groupId>com.ld.igds</groupId>
             <artifactId>igds-protocol-bhzn</artifactId>
@@ -254,7 +253,7 @@
                     <groupId>log4j</groupId>
                 </exclusion>
             </exclusions>
-        </dependency>-->
+        </dependency>
 
         <!--  绉佹湁鍗忚-姝f潵鐢靛瓙
         <dependency>
@@ -273,7 +272,7 @@
             </exclusions>
         </dependency> -->
 
-        <!--  娴峰悍杞︾墝璇嗗埆-SDK
+        <!--  娴峰悍杞︾墝璇嗗埆-SDK-->
         <dependency>
             <groupId>com.ld.igds</groupId>
             <artifactId>igds-protocol-sdk</artifactId>
@@ -288,7 +287,7 @@
                     <groupId>log4j</groupId>
                 </exclusion>
             </exclusions>
-        </dependency>-->
+        </dependency>
     </dependencies>
 
     <dependencyManagement>
diff --git a/igds-web/src/main/resources/application-pro.yml b/igds-web/src/main/resources/application-pro.yml
index 5cc0298..220bdc0 100644
--- a/igds-web/src/main/resources/application-pro.yml
+++ b/igds-web/src/main/resources/application-pro.yml
@@ -1,4 +1,4 @@
-##########################  骞夸笢鎯犲窞鎯犳柊绮簱椤圭洰   ##########################
+##########################  骞夸笢浣涘北绂呭煄鍖�   ##########################
 server:
   port: 8888
   context-path: /
@@ -64,17 +64,17 @@
   subject: ld_license
   publicAlias: publicCert
   storePass: PUBLICFZZYXXJSGFYXGS888888
-  licensePath: D:/IGDS/license/license.lic
-  publicKeysStorePath: D:/IGDS/license/publicCerts.keystore
+  licensePath: C:/IGDS/license/license.lic
+  publicKeysStorePath: C:/IGDS/license/publicCerts.keystore
 
 ##########################  IGDS   ##########################
 ## 绯荤粺鎺ュ彛璺敱閰嶇疆 娉ㄦ剰鏁板瓧濡傛灉浠�0寮�澶寸殑璇濓紝鍚庡彴浼氬嚭鐜拌浆涔夛紝璇锋坊鍔�""
 igds:
   default:
-    companyId: 5326
+    companyId: 5329
     sys-name: 鏅烘収绮簱绠$悊绯荤粺
     logo: logo-default.png
     logo-title: logo-title-default.png
     support: 椋庢鑷磋繙淇℃伅鎶�鏈偂浠芥湁闄愬叕鍙�
     grian-add-point: N
-  file-path: D:/IGDS/FILE/
\ No newline at end of file
+  file-path: C:/IGDS/FILE/
\ No newline at end of file
diff --git a/igds-web/src/main/resources/application-uat.yml b/igds-web/src/main/resources/application-uat.yml
index 220bdc0..2883971 100644
--- a/igds-web/src/main/resources/application-uat.yml
+++ b/igds-web/src/main/resources/application-uat.yml
@@ -5,7 +5,7 @@
   connection-timeout: 5000
   tomcat:
     uri-encoding: UTF-8
-
+#######绮儏,鑳借��,閫氶,姘旇皟,瀹夐槻,缁煎悎绠$悊,鏅鸿兘棰勮,鏁伴噺妫�娴�,鍑哄叆搴�,涓夌淮,璐濆崥绮儏,DLT645鐢佃〃鍗忚########
 ##########################  datasourcec   ##########################
 spring:
   datasource:
@@ -18,9 +18,9 @@
       password: ukJp12Qf+elyBvGHkJ5MQMa95pfVm0oFBHefdEgDFKoFSjbgYa9PYfv5vlem5nvoXjQsP9tIIo53DvSbsl160Q==
       public-key:
       config-decrypt: true
-      initial-size:  5
-      min-idle:  5
-      max-active:  50
+      initial-size: 5
+      min-idle: 5
+      max-active: 50
       max-wait: 60000
       time-between-eviction-runs-millis: 60000
       min-evictable-idle-time-millis: 300000
diff --git a/igds-web/src/main/resources/application.yml b/igds-web/src/main/resources/application.yml
index 2e7f083..c8dab5c 100644
--- a/igds-web/src/main/resources/application.yml
+++ b/igds-web/src/main/resources/application.yml
@@ -1,4 +1,4 @@
-##########################  Server   ########################## 涓规1鍩庡叧鐪佺伯椋熷偍澶囧簱
+##########################  Server   ##########################
 spring:
   profiles:
     active: dev

--
Gitblit v1.9.3