jiazx0107@163.com
2023-11-10 5e538429fe5a230344bbb1906ec58577cc2684e3
提交配置
已删除3个文件
已修改9个文件
317 ■■■■ 文件已修改
pom.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/api/data/GatewayDeviceType.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/GatewayUtils.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/hx2023/data/GrainData.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/hx2023/service/OnReceiveMqttService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/hx2023/service/ScGatewayTestServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/hx2023/websocket/WebSockDeviceMessageReport.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/hx2023/websocket/WebSockDeviceMessageSender.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/hx2023/websocket/WebSocketDeviceReport.java 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-proGateway.yml 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/logback-spring.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -357,6 +357,7 @@
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.7.9</version>
                <executions>
                    <execution>
                        <goals>
@@ -365,17 +366,6 @@
                    </execution>
                </executions>
            </plugin>
<!--            <plugin>-->
<!--                <groupId>org.springframework.boot</groupId>-->
<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
<!--                <executions>-->
<!--                    <execution>-->
<!--                        <goals>-->
<!--                            <goal>repackage</goal>-->
<!--                        </goals>-->
<!--                    </execution>-->
<!--                </executions>-->
<!--            </plugin>-->
        </plugins>
src/main/java/com/fzzy/api/data/GatewayDeviceType.java
@@ -19,6 +19,7 @@
    TYPE_06("TYPE_06", "视频安防摄像头"),
    TYPE_07("TYPE_07", "粮情分机"),
    TYPE_08("TYPE_08", "桌面抓拍摄像头"),
    TYPE_09("TYPE_09", "库区气象站"),
    TYPE_99("TYPE_99", "独立IOT");
@@ -36,6 +37,7 @@
        list.add(new ApiTrigger(TYPE_06.getCode(), TYPE_06.getName()));
        list.add(new ApiTrigger(TYPE_07.getCode(), TYPE_07.getName()));
        list.add(new ApiTrigger(TYPE_08.getCode(), TYPE_08.getName()));
        list.add(new ApiTrigger(TYPE_09.getCode(), TYPE_09.getName()));
        list.add(new ApiTrigger(TYPE_99.getCode(), TYPE_99.getName()));
        return list;
    }
src/main/java/com/fzzy/gateway/GatewayUtils.java
@@ -1,13 +1,17 @@
package com.fzzy.gateway;
import com.fzzy.gateway.entity.GatewayDevice;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * å¸¸é‡
 */
@Component
public class GatewayUtils {
@@ -41,6 +45,21 @@
        return cacheMapDeviceSn.get(deviceSn);
    }
    public static List<GatewayDevice> getCacheByDeviceType(String deviceType) {
        List<GatewayDevice> result = new ArrayList<>();
        for (GatewayDevice device : cacheMapDeviceId.values()) {
            if (deviceType.equals(device.getType())) result.add(device);
        }
        return result;
    }
    public static GatewayDevice getCacheByDeviceTypeOne(String deviceType) {
        for (GatewayDevice device : cacheMapDeviceId.values()) {
            if (deviceType.equals(device.getType())) return device;
        }
        return null;
    }
    public static void removeCache(GatewayDevice data) {
        cacheMapDeviceId.remove(data.getDeviceId());
src/main/java/com/fzzy/gateway/hx2023/data/GrainData.java
@@ -22,7 +22,7 @@
    private String timestamp;
    private GrainOutPut outPut;
    private GrainOutPut output;
    private GrainWeather weatherStation;
src/main/java/com/fzzy/gateway/hx2023/service/OnReceiveMqttService.java
@@ -63,11 +63,11 @@
        syncReqData.setAutoReplay(true);
        syncReqData.setDevice(device);
        BaseResp resp;
        if (GatewayDeviceProtocol.DEVICE_TEST.getCode().equals(device.getSyncProtocol())) {
            resp = gatewayRemoteManager.getGatewayTestService(device.getPushProtocol()).testGrain(syncReqData);
        } else {
            syncReqData.setAutoReplay(false);
            resp = gatewayRemoteManager.getSyncGrainService(device.getSyncProtocol()).syncGrain(syncReqData);
        }
src/main/java/com/fzzy/gateway/hx2023/service/ScGatewayTestServiceImpl.java
@@ -1,12 +1,13 @@
package com.fzzy.gateway.hx2023.service;
import com.alibaba.fastjson2.JSONObject;
import com.fzzy.api.data.GatewayDeviceType;
import com.fzzy.api.data.PushProtocol;
import com.fzzy.api.utils.DateUtil;
import com.fzzy.api.utils.NumberUtil;
import com.fzzy.async.fzzy40.Fzzy40CommonService;
import com.fzzy.async.fzzy40.entity.Fz40Grain;
import com.fzzy.gateway.api.GatewayDeviceReportService;
import com.fzzy.gateway.GatewayUtils;
import com.fzzy.gateway.api.GatewayDeviceTestService;
import com.fzzy.gateway.data.BaseReqData;
import com.fzzy.gateway.data.BaseResp;
@@ -341,12 +342,20 @@
        outPut.setTemperature(temperature);
        grain.setOutPut(outPut);
        grain.setOutput(outPut);
        GatewayDevice gatewayDeviceWeather = GatewayUtils.getCacheByDeviceTypeOne(GatewayDeviceType.TYPE_09.getCode());
        //气象信息
        GrainWeather weatherStation = new GrainWeather();
        weatherStation.setMessageId(ScConstant.getMessageId());
        if (null != gatewayDeviceWeather) {
            weatherStation.setId(gatewayDeviceWeather.getDeviceId());
        } else {
        weatherStation.setId(device.getDeviceId());
        }
        weatherStation.setAirPressure(weather.getPressure());
        weatherStation.setHumidity(weather.getHumidity());
        weatherStation.setPm(weather.getAir_pm25());
src/main/java/com/fzzy/gateway/hx2023/websocket/WebSockDeviceMessageReport.java
ÎļþÒÑɾ³ý
src/main/java/com/fzzy/gateway/hx2023/websocket/WebSockDeviceMessageSender.java
ÎļþÒÑɾ³ý
src/main/java/com/fzzy/gateway/hx2023/websocket/WebSocketDeviceReport.java
ÎļþÒÑɾ³ý
src/main/resources/application-proGateway.yml
@@ -5,13 +5,13 @@
  datasource:
    #主数据源
    primary:
      url: jdbc:mysql://127.0.0.1:3306/igds_api_5012?useUnicode=true&useSSL=false&characterEncoding=utf-8
      url: jdbc:mysql://127.0.0.1:3306/igds_api_2023?useUnicode=true&useSSL=false&characterEncoding=utf-8
      username: root
      password: Abc123..
      driver-class-name: com.mysql.jdbc.Driver
    #次数据源
    secondary:
      url: jdbc:mysql://127.0.0.1:3306/igds_5012?useUnicode=true&useSSL=false&characterEncoding=utf-8
      url: jdbc:mysql://127.0.0.1:3306/igds_v4?useUnicode=true&useSSL=false&characterEncoding=utf-8
      username: root
      password: Abc123..
@@ -38,7 +38,7 @@
    database: 5
    host: 127.0.0.1
    port: 6379
    password: Redispwd..
    password:
    # è¿žæŽ¥æ± æœ€å¤§è¿žæŽ¥æ•°ï¼ˆä½¿ç”¨è´Ÿå€¼è¡¨ç¤ºæ²¡æœ‰é™åˆ¶ï¼‰
    pool:
      max-active: 200
@@ -48,11 +48,6 @@
      timeout: 6000
  kafka:
    bootstrap-servers: 103.203.217.16:9092
    security-protocol: SASL_PLAINTEXT
    sasl-mechanism: PLAIN
    sasl-jaas-config: org.apache.kafka.common.security.scram.ScramLoginModule required username=\"{username}\" password=\"{password}\";"
    sasl-username: sc001
    sasl-password: wCV0ISwmoKwbx1lpBKMW
    producer:
      retries: 0
      acks: 1
@@ -60,6 +55,12 @@
      buffer-memory: 33554432
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringSerializer
    properties:
      security.protocol: SASL_PLAINTEXT
      sasl.mechanism: PLAIN
      sasl.username: sc001
      sasl.password: wCV0ISwmoKwbx1lpBKMW
      sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username='sc001' password='wCV0ISwmoKwbx1lpBKMW';
    consumer:
      group-id: fzzygroup
      enable-auto-commit: true
@@ -69,13 +70,15 @@
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
mqtt:
  host: tcp://10.13.4.84:11883
  client-id:
  client-username:
  client-password:
  client-timeout: 10
  client-alive-time: 20
  client-max-connect-times: 5
  client-topics:
  client-qos: 0
    host: tcp://127.0.0.1:1883
    username: admin
    password: admin123321
    client-inId: fzzy_client_id_in_igds_api
    client-outId: fzzy_client_id_out_igds_api
    completionTimeout: 3000
    keep-alive-interval: 2
    max-connect-times: 5
    qos: 0
  isOpen: false
    default-topic: mqtt/+/test1
    topics: /device-message-sender/#
src/main/resources/application.yml
src/main/resources/logback-spring.xml
@@ -6,9 +6,9 @@
    <property name="APP_MODEL" value="igds-api" />
    <!-- dev文件路径 ä¸€èˆ¬ä¸éœ€è¦é…ç½® -->
    <property name="DEV_LOG_HOME" value="C:/app/igds-api/log"/>\
    <property name="DEV_LOG_HOME" value="D:/app/igds-api/log"/>\
    <!-- pro文件路径 -->
    <property name="PRO_LOG_HOME" value="C:/app/igds-api/log" />
    <property name="PRO_LOG_HOME" value="D:/app/igds-api/log" />
    <!-- linux文件路径 -->
    <property name="PRO_LINUX_HOME" value="/usr/local/fzzy/igds-api/log" />