Преглед изворни кода

数据看板告警数据获取

lengfaqiang пре 2 година
родитељ
комит
6190587f78

+ 3 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/mqtt/MqttConfig.java

@@ -94,6 +94,7 @@ public class MqttConfig {
 
     /**
      * 新建MqttConnectionOptionsBean  MQTT连接器选项
+     *
      * @return
      */
     @Bean
@@ -207,13 +208,13 @@ public class MqttConfig {
     @Bean
     @ServiceActivator(inputChannel = CHANNEL_NAME_IN)
     public MessageHandler handler() {
+        System.out.println("mqtt是否消费:" + isConsume);
         return message -> {
-            if ("false".equals(isConsume)){
+            if ("false".equals(isConsume)) {
                 return;
             }
             String topic = message.getHeaders().get("mqtt_receivedTopic").toString();
             String payload = message.getPayload().toString();
-//            mqttCallbackHandler.handle(topic, payload);
             mqttApiHandler.handle(topic, payload);
         };
     }

+ 7 - 3
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java

@@ -1489,8 +1489,12 @@ public class ProjectService {
                             if (objects.contains(alarmStatus)) {
                                 for (KwsThreshold threshold : thresholds) {
                                     if (alarmStatus.equals(String.valueOf(threshold.getLevel()))) {
-                                        List<KwsAlarmDetail> alarmDetails = alarmDetailMapper.selectList(new LambdaQueryWrapper<KwsAlarmDetail>()
-                                                .eq(KwsAlarmDetail::getPid, threshold.getId()));
+                                        List<KwsAlarmDetail> alarmDetails = alarmDetailMapper.selectList(
+                                                new LambdaQueryWrapper<KwsAlarmDetail>()
+                                                .eq(KwsAlarmDetail::getPid, threshold.getId())
+                                                .eq(KwsAlarmDetail::getStatus, 0)
+                                                .eq(KwsAlarmDetail::getDelFlag, 0)
+                                        );
                                         if (!CollectionUtils.isEmpty(alarmDetails) && alarmDetails.size() > 0) {
                                             thresholdId = alarmDetails.get(0).getAlarmId().toString();
                                         }
@@ -1567,7 +1571,7 @@ public class ProjectService {
                         .eq(KwsDeviceRelation::getId, Long.parseLong(deviceRelationId))
         );
 
-        /**删除所存在的关联设备组网关系*/
+        /**删除所存在的项目设备关联关系*/
         projectDeviceMapper.update(null,
                 new LambdaUpdateWrapper<KwsProjectDevice>()
                         .set(KwsProjectDevice::getDelFlag, 1)

+ 0 - 3
slope-modules/slope-detection/src/main/resources/bootstrap-lfdc.yml

@@ -1,7 +1,6 @@
 spring:
   datasource:
     dynamic:
-      # seata: true
       primary: master #设置默认的数据源或者数据源组,默认值即为master
       strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
       datasource:
@@ -78,8 +77,6 @@ OkHttpClit:
 #ENMQX_API_HOST=http://10.10.10.108:18083
 #ENMQX_API_USERNAME=7dd9f635e3eddfca
 #ENMQX_API_PASSWORD=Z9A7kzHsICN5QRG9B8NTodceliwgh9AD9Bg6v4l9CXF1wL1B
-sms:
-  url: http://10.10.10.223:8830/msg_api/push
 
 
 #oss上传