CZT
2023-10-07 a376b30e63684f1a0f5b7f45322801be9145c09f
贝博粮情解析4
已修改5个文件
72 ■■■■ 文件已修改
igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/pom.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/application-pro.yml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/application-uat.yml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
            // 说明解析的数据有问题
            if (tempValue == ERROR_CHECK_TAG || tempValue == ERROR_CHECK_TAG2) {
                tempValue = Constant.ERROR_TEMP;
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>
        <!--  私有协议-正来电子
        <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>
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/
  file-path: C:/IGDS/FILE/
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
igds-web/src/main/resources/application.yml
@@ -1,4 +1,4 @@
##########################  Server   ########################## 丹棱城关省粮食储备库
##########################  Server   ##########################
spring:
  profiles:
    active: dev