فهرست منبع

'开发光电感烟报警器心跳和告警信息处理接口,新增请求类'

james 10 ماه پیش
والد
کامیت
b6a6b7111f
53فایلهای تغییر یافته به همراه951 افزوده شده و 9 حذف شده
  1. 13 0
      .idea/libraries/Maven__org_eclipse_paho_org_eclipse_paho_client_mqttv3_1_2_5.xml
  2. 13 0
      .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_integration_2_6_6.xml
  3. 13 0
      .idea/libraries/Maven__org_springframework_integration_spring_integration_core_5_5_10.xml
  4. 13 0
      .idea/libraries/Maven__org_springframework_integration_spring_integration_mqtt_5_5_10.xml
  5. BIN
      data-protocol-http/data-protocol-http-api/target/data-protocol-http-api.jar
  6. 5 0
      data-protocol-http/data-protocol-http-api/target/maven-archiver/pom.properties
  7. 0 0
      data-protocol-http/data-protocol-http-api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  8. 13 7
      data-protocol-http/data-protocol-http-biz/data-protocol-http-biz.iml
  9. 11 0
      data-protocol-http/data-protocol-http-biz/pom.xml
  10. 21 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/controller/web/DmpDeviceController.java
  11. 13 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/controller/web/TcAepCommandController.java
  12. 131 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/domain/DmpDevice.java
  13. 16 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/mapper/DmpDeviceMapper.java
  14. 16 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/DmpDeviceService.java
  15. 3 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/TcAepCommandService.java
  16. 50 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/config/mqtt/MqttBaseConfig.java
  17. 53 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/config/mqtt/MqttInConfig.java
  18. 87 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/config/mqtt/MqttOutConfig.java
  19. 74 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/enums/TopListener.java
  20. 20 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/impl/DmpDeviceServiceImpl.java
  21. 76 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/impl/TcAepCommandServiceImpl.java
  22. 90 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/listener/MqttListener.java
  23. 21 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/mqtt/MqttStrategy.java
  24. 26 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/mqtt/SimpleContext.java
  25. 23 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/mqtt/control/Control.java
  26. 21 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/vo/MqttBaseVO.java
  27. 21 0
      data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/vo/TcAepJTPDeviceInfoAlarmRequestVO.java
  28. 30 0
      data-protocol-http/data-protocol-http-biz/src/main/resources/mapper/http/DmpDeviceMapper.xml
  29. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/controller/web/DmpDeviceController.class
  30. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/controller/web/TcAepCommandController.class
  31. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/domain/DmpDevice.class
  32. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/mapper/DmpDeviceMapper.class
  33. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/DmpDeviceService.class
  34. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/TcAepCommandService.class
  35. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/config/mqtt/MqttBaseConfig.class
  36. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/config/mqtt/MqttInConfig.class
  37. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/config/mqtt/MqttOutConfig$MqttGateway.class
  38. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/config/mqtt/MqttOutConfig.class
  39. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/enums/TopListener.class
  40. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/impl/DmpDeviceServiceImpl.class
  41. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/impl/TcAepCommandServiceImpl.class
  42. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/listener/MqttListener.class
  43. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/mqtt/MqttStrategy.class
  44. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/mqtt/SimpleContext.class
  45. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/mqtt/control/Control.class
  46. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/vo/MqttBaseVO.class
  47. BIN
      data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/vo/TcAepJTPDeviceInfoAlarmRequestVO.class
  48. 30 0
      data-protocol-http/data-protocol-http-biz/target/classes/mapper/http/DmpDeviceMapper.xml
  49. BIN
      data-protocol-http/data-protocol-http-biz/target/data-protocol-http-biz.jar
  50. BIN
      data-protocol-http/data-protocol-http-biz/target/data-protocol-http-biz.jar.original
  51. 5 0
      data-protocol-http/data-protocol-http-biz/target/maven-archiver/pom.properties
  52. 26 0
      data-protocol-http/data-protocol-http-biz/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  53. 17 2
      data-protocol-http/data-protocol-http-biz/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

+ 13 - 0
.idea/libraries/Maven__org_eclipse_paho_org_eclipse_paho_client_mqttv3_1_2_5.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/paho/org.eclipse.paho.client.mqttv3/1.2.5/org.eclipse.paho.client.mqttv3-1.2.5.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/paho/org.eclipse.paho.client.mqttv3/1.2.5/org.eclipse.paho.client.mqttv3-1.2.5-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/paho/org.eclipse.paho.client.mqttv3/1.2.5/org.eclipse.paho.client.mqttv3-1.2.5-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_integration_2_6_6.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework.boot:spring-boot-starter-integration:2.6.6">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-integration/2.6.6/spring-boot-starter-integration-2.6.6.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-integration/2.6.6/spring-boot-starter-integration-2.6.6-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-integration/2.6.6/spring-boot-starter-integration-2.6.6-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_integration_spring_integration_core_5_5_10.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework.integration:spring-integration-core:5.5.10">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/integration/spring-integration-core/5.5.10/spring-integration-core-5.5.10.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/integration/spring-integration-core/5.5.10/spring-integration-core-5.5.10-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/integration/spring-integration-core/5.5.10/spring-integration-core-5.5.10-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_integration_spring_integration_mqtt_5_5_10.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework.integration:spring-integration-mqtt:5.5.10">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/integration/spring-integration-mqtt/5.5.10/spring-integration-mqtt-5.5.10.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/integration/spring-integration-mqtt/5.5.10/spring-integration-mqtt-5.5.10-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/integration/spring-integration-mqtt/5.5.10/spring-integration-mqtt-5.5.10-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

BIN
data-protocol-http/data-protocol-http-api/target/data-protocol-http-api.jar


+ 5 - 0
data-protocol-http/data-protocol-http-api/target/maven-archiver/pom.properties

@@ -0,0 +1,5 @@
+#Generated by Maven
+#Fri Jun 07 19:58:27 CST 2024
+version=0.0.1
+groupId=com.usky
+artifactId=data-protocol-http-api

+ 0 - 0
data-protocol-http/data-protocol-http-api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst


+ 13 - 7
data-protocol-http/data-protocol-http-biz/data-protocol-http-biz.iml

@@ -2183,7 +2183,6 @@
     <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-loadbalancer:3.1.1" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-loadbalancer:3.1.1" level="project" />
-    <orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.16" level="project" />
     <orderEntry type="library" name="Maven: io.projectreactor.addons:reactor-extra:3.4.7" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.6.6" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.18" level="project" />
@@ -2206,7 +2205,6 @@
     <orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-metrics-event-stream:1.5.18" level="project" />
     <orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" />
     <orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
-    <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
     <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" />
     <orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.2" level="project" />
     <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
@@ -2229,7 +2227,6 @@
     <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
     <orderEntry type="library" name="Maven: com.usky:usky-common-security:0.0.1" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.18" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.18" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.18" level="project" />
     <orderEntry type="library" name="Maven: com.usky:usky-common-redis:0.0.1" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.6.6" level="project" />
@@ -2249,8 +2246,6 @@
     <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.0" level="project" />
     <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.0" level="project" />
     <orderEntry type="library" name="Maven: com.baomidou:dynamic-datasource-spring-boot-starter:3.5.0" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.6.6" level="project" />
-    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
     <orderEntry type="library" name="Maven: com.usky:usky-common-log:0.0.1" level="project" />
     <orderEntry type="library" name="Maven: com.usky:ruoyi-common-datascope:0.0.1" level="project" />
     <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
@@ -2348,12 +2343,23 @@
     <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.18" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.amqp:spring-rabbit:2.4.3" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.amqp:spring-amqp:2.4.3" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.3.1" level="project" />
-    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
     <orderEntry type="library" name="Maven: com.rabbitmq:amqp-client:5.13.1" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.18" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.18" level="project" />
     <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.28" level="project" />
+    <orderEntry type="library" name="Maven: com.ag.sdk:AgSdkBiz:1.8.0" level="project" />
+    <orderEntry type="library" name="Maven: com.ct.sdk:ctg-ag-sdk-core-2:1.8.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-integration:2.6.6" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.6.6" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.18" level="project" />
+    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-core:5.5.10" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.3.1" level="project" />
+    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.16" level="project" />
+    <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-mqtt:5.5.10" level="project" />
+    <orderEntry type="library" name="Maven: org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5" level="project" />
     <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.22" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-bootstrap:3.1.1" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:3.1.1" level="project" />

+ 11 - 0
data-protocol-http/data-protocol-http-biz/pom.xml

@@ -51,6 +51,17 @@
             <version>1.8.0</version>
         </dependency>
 
+        <!--MQTT依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-integration</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.integration</groupId>
+            <artifactId>spring-integration-mqtt</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 21 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/controller/web/DmpDeviceController.java

@@ -0,0 +1,21 @@
+package com.usky.http.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 设备信息表 前端控制器
+ * </p>
+ *
+ * @author ya
+ * @since 2024-06-07
+ */
+@Controller
+@RequestMapping("/dmpDevice")
+public class DmpDeviceController {
+
+}
+

+ 13 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/controller/web/TcAepCommandController.java

@@ -1,9 +1,11 @@
 package com.usky.http.controller.web;
 
 
+import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.http.service.TcAepCommandService;
 import com.usky.http.service.vo.TCAepDeviceCommendRequestVO;
+import com.usky.http.service.vo.TcAepJTPDeviceInfoAlarmRequestVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -38,5 +40,16 @@ public class TcAepCommandController {
         return ApiResult.success();
     }
 
+    /**
+     * 光电感烟报警器心跳和告警信息处理
+     * @param requestBody
+     * @return
+     */
+    @PostMapping("/tcAepJTYDeviceInfoAlarm")
+    public ApiResult<Void> tcAepJTYDeviceInfoAlarm(@RequestBody String requestBody){
+        tcAepCommandService.tcAepJTYDeviceInfo(requestBody);
+        return ApiResult.success();
+    }
+
 }
 

+ 131 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/domain/DmpDevice.java

@@ -0,0 +1,131 @@
+package com.usky.http.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 设备信息表
+ * </p>
+ *
+ * @author ya
+ * @since 2024-06-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class DmpDevice implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 设备ID;设备注册时系统自动生成一个唯一编号
+     */
+    private String deviceId;
+
+    /**
+     * 设备名称
+     */
+    private String deviceName;
+
+    /**
+     * 设备类型(501、监控系统  502、门禁系统  503、梯控系统  504、机房系统  509、环境系统  510、照明系统)
+     */
+    private Integer deviceType;
+
+    /**
+     * 产品ID
+     */
+    private Integer productId;
+
+    /**
+     * 物联网卡号
+     */
+    private String simCode;
+
+    /**
+     * 国际移动用户识别码
+     */
+    private String imsiCode;
+
+    /**
+     * 自动订阅标识(0:否,1:是)
+     */
+    private Integer subscribeFlag;
+
+    /**
+     * 节点类型
+     */
+    private Integer nodeType;
+
+    /**
+     * 分组id
+     */
+    private Integer groupId;
+
+    /**
+     * 删除标识
+     */
+    private Integer deleteFlag;
+
+    /**
+     * 创建人
+     */
+    private String createdBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createdTime;
+
+    /**
+     * 更新人
+     */
+    private String updatedBy;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updatedTime;
+
+    /**
+     * 租户号
+     */
+    private Integer tenantId;
+
+    /**
+     * 单位编号
+     */
+    private String companyCode;
+
+    /**
+     * 安装位置
+     */
+    private String installAddress;
+
+    /**
+     * 业务状态;1:未激活,2:已激活,3:禁用
+     */
+    private Integer serviceStatus;
+
+    /**
+     * 产品编码
+     */
+    private String productCode;
+
+    /**
+     * 设备uuid
+     */
+    private String deviceUuid;
+
+
+}

+ 16 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/mapper/DmpDeviceMapper.java

@@ -0,0 +1,16 @@
+package com.usky.http.mapper;
+
+import com.usky.http.domain.DmpDevice;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 设备信息表 Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2024-06-07
+ */
+public interface DmpDeviceMapper extends CrudMapper<DmpDevice> {
+
+}

+ 16 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/DmpDeviceService.java

@@ -0,0 +1,16 @@
+package com.usky.http.service;
+
+import com.usky.http.domain.DmpDevice;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ * 设备信息表 服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2024-06-07
+ */
+public interface DmpDeviceService extends CrudService<DmpDevice> {
+
+}

+ 3 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/TcAepCommandService.java

@@ -3,6 +3,7 @@ package com.usky.http.service;
 import com.usky.http.domain.TcAepCommand;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.http.service.vo.TCAepDeviceCommendRequestVO;
+import com.usky.http.service.vo.TcAepJTPDeviceInfoAlarmRequestVO;
 import org.springframework.web.bind.annotation.RequestBody;
 
 /**
@@ -16,4 +17,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 public interface TcAepCommandService extends CrudService<TcAepCommand> {
 
     void tcAepDeviceCommand(TCAepDeviceCommendRequestVO requestVO) throws Exception;
+
+    void tcAepJTYDeviceInfo(String requestBody);
 }

+ 50 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/config/mqtt/MqttBaseConfig.java

@@ -0,0 +1,50 @@
+package com.usky.http.service.config.mqtt;
+
+import lombok.Data;
+import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory;
+import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
+import org.springframework.stereotype.Component;
+
+@ConditionalOnProperty(prefix = "mqtt", value = {"enabled"}, havingValue = "true")
+@Data
+@Component
+@ConfigurationProperties(prefix = "mqtt")
+public class MqttBaseConfig {
+
+	@Value("${mqtt.username}")
+	private String username;
+
+	@Value("${mqtt.password}")
+	private String password;
+
+	@Value("${mqtt.url}")
+	private String hostUrl;
+
+	@Value("${mqtt.sub-topics}")
+	private String msgTopic;
+
+	@Value("${mqtt.keep-alive-interval}")
+	//心跳间隔
+	private int keepAliveInterval;
+	@Value("${mqtt.completionTimeout}")
+	//心跳间隔
+	private int completionTimeout;
+
+
+	@Bean
+	public MqttPahoClientFactory mqttClientFactory() {
+		DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory();
+		MqttConnectOptions options = new MqttConnectOptions();
+		options.setServerURIs(new String[]{this.getHostUrl()});
+		options.setUserName(this.getUsername());
+		options.setPassword(this.getPassword().toCharArray());
+		factory.setConnectionOptions(options);
+		return factory;
+	}
+
+}

+ 53 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/config/mqtt/MqttInConfig.java

@@ -0,0 +1,53 @@
+package com.usky.http.service.config.mqtt;
+
+import com.usky.http.service.enums.TopListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.integration.channel.DirectChannel;
+import org.springframework.integration.core.MessageProducer;
+import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
+import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter;
+import org.springframework.messaging.MessageChannel;
+
+import java.util.List;
+
+/**
+ * @author yq
+ * @date 2021/11/1 16:37
+ */
+@ConditionalOnProperty(prefix = "mqtt", value = {"enabled"}, havingValue = "true")
+@Configuration
+public class MqttInConfig {
+
+    @Autowired
+    private MqttBaseConfig mqttBaseConfig;
+
+    public static final String CHANNEL_NAME_INPUT = "mqttInputChannel";
+
+    @Bean(name = CHANNEL_NAME_INPUT)
+    public MessageChannel mqttInputChannel() {
+        return new DirectChannel();
+    }
+
+
+    /**
+     * 消息订阅绑定-消费者
+     *
+     * @return
+     */
+    @Bean
+    public MessageProducer inbound() {
+        List<TopListener> parse = TopListener.parse(1);
+        String[] tops = parse.stream().map(TopListener::getCode).toArray(String[]::new);
+        String clientId = "h-backend-mqtt-in-" + System.currentTimeMillis();
+        MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter(clientId,
+                mqttBaseConfig.mqttClientFactory(), tops);
+        adapter.setCompletionTimeout(mqttBaseConfig.getCompletionTimeout());
+        adapter.setConverter(new DefaultPahoMessageConverter());
+        adapter.setQos(2);
+        adapter.setOutputChannel(mqttInputChannel());
+        return adapter;
+    }
+}

+ 87 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/config/mqtt/MqttOutConfig.java

@@ -0,0 +1,87 @@
+package com.usky.http.service.config.mqtt;
+
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.integration.annotation.MessagingGateway;
+import org.springframework.integration.annotation.ServiceActivator;
+import org.springframework.integration.channel.DirectChannel;
+import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;
+import org.springframework.integration.mqtt.support.MqttHeaders;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.MessageHandler;
+import org.springframework.messaging.handler.annotation.Header;
+
+import javax.annotation.Resource;
+
+@ConditionalOnProperty(prefix = "mqtt", value = {"enabled"}, havingValue = "true")
+@Configuration
+public class MqttOutConfig {
+
+    @Autowired
+    public MqttBaseConfig mqttBaseConfig;
+
+    public static final String CHANNEL_NAME_OUT = "mqttOutboundChannel";
+
+    public static final String MESSAGE_NAME = "messageOut";
+
+    public static final String DEFAULT_TOPIC = "testTopic";
+
+    /**
+     * 连接通道
+     *
+     * @return
+     */
+    @Resource
+    @Bean(name = CHANNEL_NAME_OUT)
+    public MessageChannel mqttOutboundChannel() {
+        return new DirectChannel();
+    }
+
+    /**
+     * 发送消息和消费消息Channel可以使用相同MqttPahoClientFactory
+     *
+     * @return
+     */
+    @Bean(name = MESSAGE_NAME)
+    @ServiceActivator(outputChannel = CHANNEL_NAME_OUT)
+    public MessageHandler outbound() {
+        // 在这里进行mqttOutboundChannel的相关设置
+        String clientId = "h-protocol-mqtt-out-" + System.currentTimeMillis();
+        MqttPahoMessageHandler messageHandler =
+                new MqttPahoMessageHandler(clientId, mqttBaseConfig.mqttClientFactory());
+        //如果设置成true,发送消息时将不会阻塞。
+        messageHandler.setAsync(true);
+        messageHandler.setDefaultTopic(DEFAULT_TOPIC);
+        return messageHandler;
+    }
+
+    @MessagingGateway(defaultRequestChannel = CHANNEL_NAME_OUT)
+    public interface MqttGateway {
+        /**
+         * 发送消息
+         *
+         * @param payload
+         */
+        void sendToMqtt(String payload);
+
+        /**
+         * 指定top发送消息
+         *
+         * @param topic
+         * @param payload
+         */
+        void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, String payload);
+
+        /**
+         * 指定队列和qos
+         *
+         * @param topic
+         * @param qos
+         * @param payload
+         */
+        void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) int qos, String payload);
+    }
+}

+ 74 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/enums/TopListener.java

@@ -0,0 +1,74 @@
+package com.usky.http.service.enums;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author yq
+ * @date 2021/12/31 11:11
+ */
+public enum TopListener {
+    /**
+     * 全部设备对接
+     */
+    FIRE_INFO("fireInfo","/usky/ytDP0001/+/+/info",1),
+    FIRE_ALERT("fireAlarm","/usky/ytDP0001/+/+/alarm",1),
+    WATER_INFO("waterInfo","/usky/ytDP0002/+/+/info",1),
+    WATER_ALERT("waterAlert","/usky/ytDP0002/+/+/alarm",1),
+    SMOKE_INFO("smokeInfo","/usky/ytDP0003/+/+/info",1),
+    SMOKE_ALERT("smokeAlarm","/usky/ytDP0003/+/+/alarm",1),
+    LIQUID_INFO("waterInfo","/usky/ytDP0005/+/+/info",1),
+    LIQUID_ALERT("waterAlert","/usky/ytDP0005/+/+/alarm",1),
+    RTU_INFO("rtuinfo","/usky/ytDP0006/+/+/info",1),
+    RTU_ALERT("rtuAlert","/usky/ytDP0006/+/+/alarm",1),
+    ELECTRICAL_INFO("electricalInfo","/usky/ytDP0007/+/+/info",1),
+    ELECTRICAL_ALERT("electricalAlarm","/usky/ytDP0007/+/+/alarm",1),
+    MH_COVER_INFO("waterInfo","/usky/ytDP0008/+/+/info",1),
+    MH_COVER_ALERT("waterAlert","/usky/ytDP0008/+/+/alarm",1),
+    VIDEO_ALERT("videoAlert","/usky/ytCamCore/+/+/alarm",1),
+    LR_SMOKE_INFO("smokeInfo","/usky/ytDP00033/+/+/info",1),
+    LR_SMOKE_ALERT("smokeAlarm","/usky/ytDP00033/+/+/alarm",1);
+
+
+
+
+    private String name;
+    private String code;
+    //0发送队列,1监听队列2都是
+    private Integer type;
+
+    TopListener(String name, String code, Integer type){
+        this.name = name;
+        this.code = code;
+        this.type = type;
+    }
+
+    public static TopListener parse(String code){
+        TopListener topListener = null;
+        for (TopListener t:TopListener.values()) {
+            if (t.getCode().equals(code)){
+                topListener = t;
+                break;
+            }
+        }
+        return topListener;
+    }
+    public static List<TopListener> parse(Integer type){
+        List<TopListener> listeners = new ArrayList<>();
+        for (TopListener t:TopListener.values()) {
+            if (t.getType().equals(type)){
+                listeners.add(t);
+            }
+        }
+        return listeners;
+    }
+    public String getCode(){
+        return code;
+    }
+    public String getName(){
+        return name;
+    }
+    public Integer getType(){
+        return type;
+    }
+}

+ 20 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/impl/DmpDeviceServiceImpl.java

@@ -0,0 +1,20 @@
+package com.usky.http.service.impl;
+
+import com.usky.http.domain.DmpDevice;
+import com.usky.http.mapper.DmpDeviceMapper;
+import com.usky.http.service.DmpDeviceService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 设备信息表 服务实现类
+ * </p>
+ *
+ * @author ya
+ * @since 2024-06-07
+ */
+@Service
+public class DmpDeviceServiceImpl extends AbstractCrudService<DmpDeviceMapper, DmpDevice> implements DmpDeviceService {
+
+}

+ 76 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/impl/TcAepCommandServiceImpl.java

@@ -1,20 +1,36 @@
 package com.usky.http.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.alibaba.nacos.common.utils.JacksonUtils;
+import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ctg.ag.sdk.biz.AepDeviceCommandLwmProfileClient;
 import com.ctg.ag.sdk.biz.aep_device_command_lwm_profile.CreateCommandLwm2mProfileRequest;
 import com.ctg.ag.sdk.biz.aep_device_command_lwm_profile.CreateCommandLwm2mProfileResponse;
 import com.usky.common.core.exception.BusinessException;
+import com.usky.common.core.util.JsonUtils;
+import com.usky.http.domain.DmpDevice;
 import com.usky.http.domain.TcAepCommand;
 import com.usky.http.mapper.TcAepCommandMapper;
+import com.usky.http.service.DmpDeviceService;
 import com.usky.http.service.TcAepCommandService;
 import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.http.service.config.mqtt.MqttOutConfig;
 import com.usky.http.service.vo.TCAepDeviceCommendRequestVO;
+import com.usky.http.service.vo.TcAepJTPDeviceInfoAlarmRequestVO;
+import io.swagger.models.auth.In;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * <p>
@@ -27,6 +43,11 @@ import java.util.Map;
 @Service
 @Slf4j
 public class TcAepCommandServiceImpl extends AbstractCrudService<TcAepCommandMapper, TcAepCommand> implements TcAepCommandService {
+    @Autowired
+    private DmpDeviceService dmpDeviceService;
+
+    @Resource
+    private MqttOutConfig.MqttGateway mqttGateway;
 
     @Override
     public void tcAepDeviceCommand(TCAepDeviceCommendRequestVO requestVO) throws Exception {
@@ -61,5 +82,60 @@ public class TcAepCommandServiceImpl extends AbstractCrudService<TcAepCommandMap
         log.info(logInfo);
     }
 
+    @Override
+    public void tcAepJTYDeviceInfo(String requestBody){
+
+        Map map = JsonUtils.fromJson(requestBody,Map.class);
+        String deviceId = map.get("IMEI").toString();
+        LambdaQueryWrapper<DmpDevice> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DmpDevice::getDeviceId,deviceId);
+        DmpDevice one = dmpDeviceService.getOne(queryWrapper);
+        String companyCode = one.getCompanyCode();
+        String deviceName = one.getDeviceName();
+        String deviceType = one.getDeviceType().toString();
+        String infoTopic = String.format("/usky/ytDP0003/",companyCode,"/",deviceId,"/info");
+        String alarmTopic = String.format("/usky/ytDP0003/",companyCode,"/",deviceId,"/alarm");
+        LocalDateTime localDateTime = LocalDateTime.now();
+        String timestamp = String.valueOf(localDateTime.toInstant(ZoneOffset.ofHours(8)).toEpochMilli());
+
+        String messageType = map.get("messageType").toString();
+
+        if(messageType.equals("dataReport")){
+            Map<String,Object> dataMap = JSONObject.parseObject(JSONObject.toJSONString(map.get("payload")));
+            if(Objects.nonNull(dataMap.get("smoke_state"))){ //alarm
+                String smokeState = dataMap.get("smoke_state").toString();
+                if(smokeState.equals("0")){
+                    String deviceStatus = "0";
+                    String battery = dataMap.get("battery_value").toString();
+                    String signal = "";
+                    String temperature = dataMap.get("").toString();
+                    String smoke = dataMap.get("smoke_value").toString();
+                    String deviceAlarmData = String.format("{\"devId\":\"",deviceId,"\",\"connType\":\"N\"",",\"deviceName\":\"",deviceName,"\",\"alarams\":[{\"dp\":[{\"property\":\"烟雾报警\",\"serial\":\"311\",\"value\":\"报警\",\"status\":\"0\" }],\"deviceName\":\"",
+                            deviceName,"\",\"timeStamp\":\"",timestamp,"\",\"deviceModel\":\"\",\"deviceType\":\"",deviceType,"\",\"devId\":\"",deviceId,"\"}],\"type\":\"ALARM\",\"timeStamp\":\"",timestamp,"\"}");
+
+                    mqttGateway.sendToMqtt(infoTopic,deviceAlarmData);
+                }
+
+            }else{ //info
+                String deviceStatus = "0";
+                String battery = dataMap.get("battery_value").toString();
+                String signal = "";
+                String temperature = dataMap.get("").toString();
+                String smoke = "";
+                String deviceInfoData = String.format("{\"devId\":\"",deviceId,"\",\"connType\":\"N\"",",\"deviceName\":\"",deviceName,"\",\"devs\":[{\"dp\":[{\"property\":\"状态\",\"serial\":\"301\",\"value\":\""
+                        ,deviceStatus,"\"},{\"property\":\"剩余电量\",\"serial\":\"302\",\"value\":\"",battery,"\"},{\"property\":\"无线信号\",\"serial\":\"303\",\"value\":\"",signal,
+                        "\"},{\"property\":\"温度\",\"serial\":\"304\",\"value\":\"",temperature,"\"},{\"property\":\"浓度\",\"serial\":\"305\",\"value\":\"",smoke,"\"}],\"deviceName\":\"",deviceName,"\",\"timeStamp\":\"",timestamp,"\",\"deviceModel\":\"\",\"deviceType\":\"",deviceType,"\",\"devId\":\"",deviceId,"\"}],\"type\":\"INFO\",\"timeStamp\":\"",timestamp,"\"}");
+
+                mqttGateway.sendToMqtt(infoTopic,deviceInfoData);
+
+            }
+
+        }else if(messageType.equals("eventReport")){ //alarm
+
+        }
+
+
+    }
+
 
 }

+ 90 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/listener/MqttListener.java

@@ -0,0 +1,90 @@
+package com.usky.http.service.listener;
+
+
+
+import com.usky.http.service.config.mqtt.MqttInConfig;
+import com.usky.http.service.enums.TopListener;
+import com.usky.http.service.mqtt.SimpleContext;
+import com.usky.http.service.vo.MqttBaseVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.integration.annotation.ServiceActivator;
+import org.springframework.messaging.MessageHandler;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author yq
+ * @date 2021/11/3 8:13
+ */
+@ConditionalOnProperty(prefix = "mqtt", value = {"enabled"}, havingValue = "true")
+@Slf4j
+@Component
+public class MqttListener {
+
+    public static final String MESSAGE_NAME = "messageInput";
+
+    @Autowired
+    private SimpleContext simpleContext;
+
+    /**
+     * 处理消息-消费者
+     *
+     * @return
+     */
+    @Bean(MESSAGE_NAME)
+    @ServiceActivator(inputChannel = MqttInConfig.CHANNEL_NAME_INPUT)
+    public MessageHandler handler() {
+        return message -> {
+            String payload = message.getPayload().toString();
+            //进行接口推送
+            String[] code1 = TopListener.FIRE_ALERT.getCode().split("/");
+            String[] code2 = TopListener.WATER_ALERT.getCode().split("/");
+            String[] code3 = TopListener.RTU_ALERT.getCode().split("/");
+            String[] code4 = TopListener.VIDEO_ALERT.getCode().split("/");
+            String[] code5 = TopListener.SMOKE_ALERT.getCode().split("/");
+            String[] code6 = TopListener.ELECTRICAL_ALERT.getCode().split("/");
+            String[] code7 = TopListener.LIQUID_ALERT.getCode().split("/");
+            String[] infoCode1 = TopListener.FIRE_INFO.getCode().split("/");
+            String[] infoCode2 = TopListener.WATER_INFO.getCode().split("/");
+            String[] infoCode3 = TopListener.SMOKE_INFO.getCode().split("/");
+            String[] infoCode4 = TopListener.LIQUID_INFO.getCode().split("/");
+            String[] infoCode5 = TopListener.RTU_INFO.getCode().split("/");
+            String[] infoCode6 = TopListener.ELECTRICAL_INFO.getCode().split("/");
+            String[] infoCode7 = TopListener.MH_COVER_INFO.getCode().split("/");
+            String[] infoCode8 = TopListener.LR_SMOKE_INFO.getCode().split("/");
+            Object mqttReceivedTopic = message.getHeaders().get("mqtt_receivedTopic");
+            if (null != mqttReceivedTopic) {
+                String topic = mqttReceivedTopic.toString();
+                MqttBaseVO mqttBaseVO = new MqttBaseVO();
+                mqttBaseVO.setTopic(topic);
+                if ((topic.indexOf(code1[2]) != -1 && topic.indexOf(code1[5]) != -1) ||
+                        (topic.indexOf(code2[2]) != -1 && topic.indexOf(code2[5]) != -1) ||
+                        (topic.indexOf(code3[2]) != -1 && topic.indexOf(code3[5]) != -1) ||
+                        (topic.indexOf(code4[2]) != -1 && topic.indexOf(code4[5]) != -1) ||
+                        (topic.indexOf(code5[2]) != -1 && topic.indexOf(code5[5]) != -1) ||
+                        (topic.indexOf(code6[2]) != -1 && topic.indexOf(code6[5]) != -1) ||
+                        (topic.indexOf(code7[2]) != -1 && topic.indexOf(code7[5]) != -1)) {
+                    mqttBaseVO.setDescribe("alarm");
+                    mqttBaseVO.setData(payload);
+                }else if((topic.indexOf(infoCode1[2]) != -1 && topic.indexOf(infoCode1[5]) != -1) ||
+                        (topic.indexOf(infoCode2[2]) != -1 && topic.indexOf(infoCode2[5]) != -1) ||
+                        (topic.indexOf(infoCode3[2]) != -1 && topic.indexOf(infoCode3[5]) != -1) ||
+                        (topic.indexOf(infoCode4[2]) != -1 && topic.indexOf(infoCode4[5]) != -1) ||
+                        (topic.indexOf(infoCode5[2]) != -1 && topic.indexOf(infoCode5[5]) != -1) ||
+                        (topic.indexOf(infoCode6[2]) != -1 && topic.indexOf(infoCode6[5]) != -1) ||
+                        (topic.indexOf(infoCode7[2]) != -1 && topic.indexOf(infoCode7[5]) != -1) ||
+                        (topic.indexOf(infoCode8[2]) != -1 && topic.indexOf(infoCode8[5]) != -1)) {
+                    mqttBaseVO.setDescribe("info");
+                    mqttBaseVO.setData(payload);
+                }else {
+                    mqttBaseVO.setDescribe("fireInfoAndAlarm");
+                    mqttBaseVO.setData(payload);
+                }
+                //统一处理数据
+                simpleContext.getResource(mqttBaseVO);
+            }
+        };
+    }
+}

+ 21 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/mqtt/MqttStrategy.java

@@ -0,0 +1,21 @@
+package com.usky.http.service.mqtt;
+
+
+import com.usky.http.service.vo.MqttBaseVO;
+
+/**
+ * 策略类
+ *
+ * @author yq
+ * @date 2021/11/3 8:27
+ */
+public interface MqttStrategy {
+    /**
+     * 处理消息(策略模式由子类实现)
+     *
+     * @param mqttBaseVO
+     * @return
+     */
+    String disposeMessage(MqttBaseVO mqttBaseVO);
+
+}

+ 26 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/mqtt/SimpleContext.java

@@ -0,0 +1,26 @@
+package com.usky.http.service.mqtt;
+
+
+import com.usky.http.service.vo.MqttBaseVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 中间处理消息转发
+ */
+@Service
+public class SimpleContext {
+    @Autowired
+    private final Map<String, MqttStrategy> strategyMap = new ConcurrentHashMap<>();
+
+    public SimpleContext(Map<String, MqttStrategy> strategyMap) {
+        strategyMap.forEach(this.strategyMap::put);
+    }
+
+    public String getResource(MqttBaseVO mqttBaseVO) {
+        return strategyMap.get(mqttBaseVO.getDescribe()).disposeMessage(mqttBaseVO);
+    }
+}

+ 23 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/mqtt/control/Control.java

@@ -0,0 +1,23 @@
+package com.usky.http.service.mqtt.control;
+
+import com.usky.http.service.mqtt.MqttStrategy;
+import com.usky.http.service.vo.MqttBaseVO;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * @author yq
+ * @date 2022/3/4 15:07
+ */
+@Service("control")
+public class Control implements MqttStrategy {
+
+
+    @Override
+    public String disposeMessage(MqttBaseVO mqttBaseVO) {
+
+        return null;
+    }
+
+
+}

+ 21 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/vo/MqttBaseVO.java

@@ -0,0 +1,21 @@
+package com.usky.http.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/11/3 8:32
+ */
+@Data
+public class MqttBaseVO {
+    /**
+     * 接口描述
+     */
+    private String describe;
+
+    private String topic;
+    /**
+     * 数据内容
+      */
+    private Object data;
+}

+ 21 - 0
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/vo/TcAepJTPDeviceInfoAlarmRequestVO.java

@@ -0,0 +1,21 @@
+package com.usky.http.service.vo;
+
+import lombok.Data;
+
+@Data
+public class TcAepJTPDeviceInfoAlarmRequestVO {
+    /**
+     * 信息类型(info,alarm)
+     */
+    private String type;
+
+    /**
+     * 公司编号
+     */
+    private String companyCode;
+
+    /**
+     * 信息体
+     */
+    private String requestBody;
+}

+ 30 - 0
data-protocol-http/data-protocol-http-biz/src/main/resources/mapper/http/DmpDeviceMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.http.mapper.DmpDeviceMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.http.domain.DmpDevice">
+        <id column="id" property="id" />
+        <result column="device_id" property="deviceId" />
+        <result column="device_name" property="deviceName" />
+        <result column="device_type" property="deviceType" />
+        <result column="product_id" property="productId" />
+        <result column="sim_code" property="simCode" />
+        <result column="imsi_code" property="imsiCode" />
+        <result column="subscribe_flag" property="subscribeFlag" />
+        <result column="node_type" property="nodeType" />
+        <result column="group_id" property="groupId" />
+        <result column="delete_flag" property="deleteFlag" />
+        <result column="created_by" property="createdBy" />
+        <result column="created_time" property="createdTime" />
+        <result column="updated_by" property="updatedBy" />
+        <result column="updated_time" property="updatedTime" />
+        <result column="tenant_id" property="tenantId" />
+        <result column="company_code" property="companyCode" />
+        <result column="install_address" property="installAddress" />
+        <result column="service_status" property="serviceStatus" />
+        <result column="product_code" property="productCode" />
+        <result column="device_uuid" property="deviceUuid" />
+    </resultMap>
+
+</mapper>

BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/controller/web/DmpDeviceController.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/controller/web/TcAepCommandController.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/domain/DmpDevice.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/mapper/DmpDeviceMapper.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/DmpDeviceService.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/TcAepCommandService.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/config/mqtt/MqttBaseConfig.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/config/mqtt/MqttInConfig.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/config/mqtt/MqttOutConfig$MqttGateway.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/config/mqtt/MqttOutConfig.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/enums/TopListener.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/impl/DmpDeviceServiceImpl.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/impl/TcAepCommandServiceImpl.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/listener/MqttListener.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/mqtt/MqttStrategy.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/mqtt/SimpleContext.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/mqtt/control/Control.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/vo/MqttBaseVO.class


BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/vo/TcAepJTPDeviceInfoAlarmRequestVO.class


+ 30 - 0
data-protocol-http/data-protocol-http-biz/target/classes/mapper/http/DmpDeviceMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.http.mapper.DmpDeviceMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.http.domain.DmpDevice">
+        <id column="id" property="id" />
+        <result column="device_id" property="deviceId" />
+        <result column="device_name" property="deviceName" />
+        <result column="device_type" property="deviceType" />
+        <result column="product_id" property="productId" />
+        <result column="sim_code" property="simCode" />
+        <result column="imsi_code" property="imsiCode" />
+        <result column="subscribe_flag" property="subscribeFlag" />
+        <result column="node_type" property="nodeType" />
+        <result column="group_id" property="groupId" />
+        <result column="delete_flag" property="deleteFlag" />
+        <result column="created_by" property="createdBy" />
+        <result column="created_time" property="createdTime" />
+        <result column="updated_by" property="updatedBy" />
+        <result column="updated_time" property="updatedTime" />
+        <result column="tenant_id" property="tenantId" />
+        <result column="company_code" property="companyCode" />
+        <result column="install_address" property="installAddress" />
+        <result column="service_status" property="serviceStatus" />
+        <result column="product_code" property="productCode" />
+        <result column="device_uuid" property="deviceUuid" />
+    </resultMap>
+
+</mapper>

BIN
data-protocol-http/data-protocol-http-biz/target/data-protocol-http-biz.jar


BIN
data-protocol-http/data-protocol-http-biz/target/data-protocol-http-biz.jar.original


+ 5 - 0
data-protocol-http/data-protocol-http-biz/target/maven-archiver/pom.properties

@@ -0,0 +1,5 @@
+#Generated by Maven
+#Fri Jun 07 19:58:26 CST 2024
+version=0.0.1
+groupId=com.usky
+artifactId=data-protocol-http-biz

+ 26 - 0
data-protocol-http/data-protocol-http-biz/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1,26 @@
+com\usky\http\service\config\mqtt\MqttBaseConfig.class
+com\usky\http\service\impl\TcAepCommandServiceImpl.class
+com\usky\http\DataProtocolHttpApplication.class
+com\usky\http\service\vo\TCAepDeviceCommendRequestVO.class
+com\usky\http\service\enums\TopListener.class
+com\usky\http\service\impl\DmpDeviceServiceImpl.class
+com\usky\http\mapper\DmpDeviceMapper.class
+com\usky\http\service\mqtt\control\Control.class
+com\usky\http\mapper\TcAepCommandMapper.class
+com\usky\http\MybatisGenerator$2.class
+com\usky\http\service\config\mqtt\MqttOutConfig.class
+com\usky\http\service\config\mqtt\MqttOutConfig$MqttGateway.class
+com\usky\http\service\DmpDeviceService.class
+com\usky\http\service\vo\MqttBaseVO.class
+com\usky\http\domain\DmpDevice.class
+com\usky\http\domain\TcAepCommand.class
+com\usky\http\service\vo\TcAepJTPDeviceInfoAlarmRequestVO.class
+com\usky\http\MybatisGenerator.class
+com\usky\http\service\TcAepCommandService.class
+com\usky\http\service\mqtt\SimpleContext.class
+com\usky\http\service\listener\MqttListener.class
+com\usky\http\service\mqtt\MqttStrategy.class
+com\usky\http\controller\web\TcAepCommandController.class
+com\usky\http\service\config\mqtt\MqttInConfig.class
+com\usky\http\controller\web\DmpDeviceController.class
+com\usky\http\MybatisGenerator$1.class

+ 17 - 2
data-protocol-http/data-protocol-http-biz/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -1,8 +1,23 @@
-D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\mapper\TcAepCommandMapper.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\DmpDeviceService.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\enums\TopListener.java
 D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\domain\TcAepCommand.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\impl\DmpDeviceServiceImpl.java
 D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\MybatisGenerator.java
-D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\DataProtocolHttpApplication.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\config\mqtt\MqttBaseConfig.java
 D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\vo\TCAepDeviceCommendRequestVO.java
 D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\TcAepCommandService.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\vo\MqttBaseVO.java
 D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\controller\web\TcAepCommandController.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\mapper\TcAepCommandMapper.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\controller\web\DmpDeviceController.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\listener\MqttListener.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\domain\DmpDevice.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\DataProtocolHttpApplication.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\mapper\DmpDeviceMapper.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\config\mqtt\MqttOutConfig.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\config\mqtt\MqttInConfig.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\vo\TcAepJTPDeviceInfoAlarmRequestVO.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\mqtt\MqttStrategy.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\mqtt\SimpleContext.java
 D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\impl\TcAepCommandServiceImpl.java
+D:\zyj\JAVA-PROCESS\usky-data\usky-data\data-protocol-http\data-protocol-http-biz\src\main\java\com\usky\http\service\mqtt\control\Control.java