Browse Source

解决大屏报错以及其他问题

fuyuhchuan 1 year ago
parent
commit
372b83d7f4

+ 84 - 84
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/config/mqtt/MqttOutConfig.java

@@ -1,84 +1,84 @@
-package com.usky.fire.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;
-
-@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
-     */
-    @Bean(name = CHANNEL_NAME_OUT)
-    public MessageChannel mqttOutboundChannel() {
-        return new DirectChannel();
-    }
-
-    /**
-     * 发送消息和消费消息Channel可以使用相同MqttPahoClientFactory
-     *
-     * @return
-     */
-    @Bean(name = MESSAGE_NAME)
-    @ServiceActivator(inputChannel = CHANNEL_NAME_OUT)
-    public MessageHandler outbound() {
-        // 在这里进行mqttOutboundChannel的相关设置
-        String clientId = "h-backend-mqtt-in-" + 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);
-    }
-}
+//package com.usky.fire.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;
+//
+//@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
+//     */
+//    @Bean(name = CHANNEL_NAME_OUT)
+//    public MessageChannel mqttOutboundChannel() {
+//        return new DirectChannel();
+//    }
+//
+//    /**
+//     * 发送消息和消费消息Channel可以使用相同MqttPahoClientFactory
+//     *
+//     * @return
+//     */
+//    @Bean(name = MESSAGE_NAME)
+//    @ServiceActivator(inputChannel = CHANNEL_NAME_OUT)
+//    public MessageHandler outbound() {
+//        // 在这里进行mqttOutboundChannel的相关设置
+//        String clientId = "h-backend-mqtt-in-" + 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);
+//    }
+//}

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseDeviceServiceImpl.java

@@ -73,7 +73,7 @@ public class BaseDeviceServiceImpl extends AbstractCrudService<BaseDeviceMapper,
         queryWrapper1.select("device_type as deviceTypeCode","device_name as deviceTypeName","count(*) as deviceCount")
                 .eq("enable",1)
                 .in("device_type","45","332","358","359","376","395","401","420","425","426","427","428","429","433","434")
-                .groupBy("device_type");
+                .groupBy("device_type","device_name");
         List<Map<String,Object>> map = this.listMaps(queryWrapper1);
         if(map.size() > 0){
             List<BaseDeviceTypeVO> list1 = new ArrayList<>();

+ 4 - 4
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseGgpFacilityServiceImpl.java

@@ -91,7 +91,7 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
         List<BaseGgpFacilityStatisticVO> list = new ArrayList<>();
         QueryWrapper<BaseGgpFacility> queryWrapper = Wrappers.query();
         if(baseGgpFacilityVO.getStatisticType().equals("street")){
-            queryWrapper.select("street_town as streetTown","count(*) as count")
+            queryWrapper.select("street_town as streetTown","count(*) as count1")
                     .in("facility_type",baseGgpFacilityVO.getFacilityType())
                     .groupBy("street_town");
             List<Map<String,Object>> maps = this.listMaps(queryWrapper);
@@ -99,12 +99,12 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
                 for (int i = 0; i < maps.size(); i++) {
                     BaseGgpFacilityStatisticVO statisticVO = new BaseGgpFacilityStatisticVO();
                     statisticVO.setStreetTown(maps.get(i).get("streetTown").toString());
-                    statisticVO.setCount(Integer.parseInt(maps.get(i).get("count").toString()));
+                    statisticVO.setCount(Integer.parseInt(maps.get(i).get("count1").toString()));
                     list.add(statisticVO);
                 }
             }
         }else if(baseGgpFacilityVO.getStatisticType().equals("facilityType")){
-            queryWrapper.select("facility_type as facilityType","count(*) as count")
+            queryWrapper.select("facility_type as facilityType","count(*) as count2")
                     .in("facility_type",baseGgpFacilityVO.getFacilityType())
                     .groupBy("facility_type");
             List<Map<String,Object>> maps = this.listMaps(queryWrapper);
@@ -112,7 +112,7 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
                 for (int i = 0; i < maps.size(); i++) {
                     BaseGgpFacilityStatisticVO statisticVO = new BaseGgpFacilityStatisticVO();
                     statisticVO.setFacilityType(Integer.parseInt(maps.get(i).get("facilityType").toString()));
-                    statisticVO.setCount(Integer.parseInt(maps.get(i).get("count").toString()));
+                    statisticVO.setCount(Integer.parseInt(maps.get(i).get("count2").toString()));
                     list.add(statisticVO);
                 }
             }

+ 2 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemGridMemberServiceImpl.java

@@ -99,7 +99,7 @@ public class DemGridMemberServiceImpl extends AbstractCrudService<DemGridMemberM
             }
             if (CollectionUtils.isNotEmpty(demGridMemderVicesList)) {
                 QueryWrapper<DemGridMember> queryWrapper1 = Wrappers.query();
-                queryWrapper1.select("senior_grid as seniorGrid","count(*) as count")
+                queryWrapper1.select("senior_grid as seniorGrid","count(*) as count1")
                         .groupBy("senior_grid");
                 List<Map<String,Object>> map = this.listMaps(queryWrapper1);
 
@@ -117,7 +117,7 @@ public class DemGridMemberServiceImpl extends AbstractCrudService<DemGridMemberM
                     if(map.size() > 0){
                         for (int j = 0; j < map.size(); j++) {
                             if(list.get(i).getId().equals(Integer.parseInt(map.get(j).get("seniorGrid").toString()))){
-                                list.get(i).setNum(Integer.parseInt(map.get(j).get("count").toString()));
+                                list.get(i).setNum(Integer.parseInt(map.get(j).get("count1").toString()));
                             }
                         }
                     }

+ 110 - 110
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/listener/MqttListener.java

@@ -1,110 +1,110 @@
-package com.usky.fire.service.listener;
-
-
-import com.usky.fire.service.config.mqtt.MqttInConfig;
-import com.usky.fire.service.enums.TopListener;
-import com.usky.fire.service.mqtt.SimpleContext;
-import com.usky.fire.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 (TopListener.MH_WATER_INFO.getCode().equals(topic)) {
-                    mqttBaseVO.setDescribe("cy");
-                    mqttBaseVO.setData(payload);
-                } else if (TopListener.MH_WATER_ALERT.getCode().equals(topic)) {
-                    mqttBaseVO.setDescribe("cy");
-                    mqttBaseVO.setData(payload);
-                } else if (TopListener.MH_WATER_STATISTICS.getCode().equals(topic)) {
-                    mqttBaseVO.setDescribe("cy");
-                    mqttBaseVO.setData(payload);
-                } else if (TopListener.DEVICE_DETAIL.getCode().equals(topic)) {
-                    mqttBaseVO.setDescribe("mhwater");
-                    mqttBaseVO.setData(payload);
-                } else if (TopListener.DEVICE_INFO.getCode().equals(topic)) {
-                    mqttBaseVO.setDescribe("mhwater");
-                    mqttBaseVO.setData(payload);
-                } else if (TopListener.DEVICE_ALERT.getCode().equals(topic)) {
-                    mqttBaseVO.setDescribe("mhwater");
-                    mqttBaseVO.setData(payload);
-                } else if (TopListener.DEVICE_AJ.getCode().equals(topic)) {
-                    mqttBaseVO.setDescribe("mhwater");
-                    mqttBaseVO.setData(payload);
-                } else 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);
-            }
-        };
-    }
-}
+//package com.usky.fire.service.listener;
+//
+//
+//import com.usky.fire.service.config.mqtt.MqttInConfig;
+//import com.usky.fire.service.enums.TopListener;
+//import com.usky.fire.service.mqtt.SimpleContext;
+//import com.usky.fire.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 (TopListener.MH_WATER_INFO.getCode().equals(topic)) {
+//                    mqttBaseVO.setDescribe("cy");
+//                    mqttBaseVO.setData(payload);
+//                } else if (TopListener.MH_WATER_ALERT.getCode().equals(topic)) {
+//                    mqttBaseVO.setDescribe("cy");
+//                    mqttBaseVO.setData(payload);
+//                } else if (TopListener.MH_WATER_STATISTICS.getCode().equals(topic)) {
+//                    mqttBaseVO.setDescribe("cy");
+//                    mqttBaseVO.setData(payload);
+//                } else if (TopListener.DEVICE_DETAIL.getCode().equals(topic)) {
+//                    mqttBaseVO.setDescribe("mhwater");
+//                    mqttBaseVO.setData(payload);
+//                } else if (TopListener.DEVICE_INFO.getCode().equals(topic)) {
+//                    mqttBaseVO.setDescribe("mhwater");
+//                    mqttBaseVO.setData(payload);
+//                } else if (TopListener.DEVICE_ALERT.getCode().equals(topic)) {
+//                    mqttBaseVO.setDescribe("mhwater");
+//                    mqttBaseVO.setData(payload);
+//                } else if (TopListener.DEVICE_AJ.getCode().equals(topic)) {
+//                    mqttBaseVO.setDescribe("mhwater");
+//                    mqttBaseVO.setData(payload);
+//                } else 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);
+//            }
+//        };
+//    }
+//}

+ 15 - 14
service-fire/service-fire-biz/src/main/resources/application.yml

@@ -15,16 +15,14 @@ mybatis-plus:
     mapperRegistryCache: true
   mapper-locations: classpath*:mapper/**/*.xml
 server:
-  port: 9891
-  servlet:
-    context-path: /agbox-energy
-  application:
-    # 应用名称
-    name: usky-fire
+  port: 9888
   compression:
     enabled: true
     mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
 spring:
+  application:
+    # 应用名称
+    name: service-fire
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   cache:
@@ -44,6 +42,9 @@ spring:
     dynamic:
       datasource:
         master:
+#          url: jdbc:mysql://172.16.120.165:3306/usky-fire?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&queryTimeout=2400
+#          username: usky
+#          password: Yt#75Usky
           driver-class-name: dm.jdbc.driver.DmDriver
           password: Yt#75Usky
           url: jdbc:dm://localhost:5237/SYSDBA?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8
@@ -96,14 +97,14 @@ spring:
     multipart:
       max-file-size: 10MB
       max-request-size: 15MB
-mqtt:
-  completionTimeout: 5000
-  enabled: false
-  keep-alive-interval: 60
-  password: usky
-  sub-topics: mh/water/info,mh/water/alert,mh/water/statistics,device/info,device/alert,device/detail,device/aj
-  url: tcp://47.98.201.73:1883
-  username: usky
+#mqtt:
+#  completionTimeout: 5000
+#  enabled: false
+#  keep-alive-interval: 60
+#  password: usky
+#  sub-topics: mh/water/info,mh/water/alert,mh/water/statistics,device/info,device/alert,device/detail,device/aj
+#  url: tcp://47.98.201.73:1883
+#  username: usky
    
 mhwater:
   path: http://180.169.15.121:1680

+ 18 - 12
service-fire/service-fire-biz/src/main/resources/mapper/fire/ReportConfigMapper.xml

@@ -14,31 +14,37 @@
         <result column="tenant_id" property="tenantId" />
     </resultMap>
     <select id="configNumList1" resultType="com.usky.fire.service.vo.ReportConfigVO">
-        SELECT d.id,d.report_name as reportName,IF(report_id IS NULL,0,COUNT(*)) AS
-        indexNum1
-        FROM report_config d
-        LEFT JOIN report_index_config e ON e.report_id = d.id
+        SELECT /*+ GROUP_OPT_FLAG(1)*/
+        d.id,
+        d.report_name AS reportName,
+        COUNT(e.report_id) AS indexNum1
+        FROM
+        report_config d
+        LEFT JOIN
+        report_index_config e ON e.report_id = d.id
         <where>
             <if test="tenantId != null and tenantId != ''">
-                and d.tenant_id = #{tenantId}
+                AND d.tenant_id = #{tenantId}
             </if>
-            and d.delete_flag = 0
+            AND d.delete_flag = 0
         </where>
-        GROUP BY d.id
+        GROUP BY
+        d.id,d.report_name
     </select>
     <select id="configNumList" resultType="com.usky.fire.service.vo.ReportConfigVO">
-        SELECT d.id,IF(report_id IS NULL,0,COUNT(*)) AS
-        indexNum1
+        SELECT /*+ GROUP_OPT_FLAG(1)*/
+        d.id,
+        COALESCE(e.report_id, 0) AS indexNum
         FROM report_config d
         LEFT JOIN report_index_config e ON e.report_id = d.id
         <where>
             <if test="tenantId != null and tenantId != ''">
-                and d.tenant_id = #{tenantId}
+                AND d.tenant_id = #{tenantId}
             </if>
             <if test="indexGrade != null and indexGrade != ''">
-                and e.index_grade = #{indexGrade}
+                AND e.index_grade = #{indexGrade}
             </if>
-            and d.delete_flag = 0
+            AND d.delete_flag = 0
         </where>
         GROUP BY d.id
     </select>