Przeglądaj źródła

Merge remote-tracking branch 'origin/20210716' into 20210716

lin 3 lat temu
rodzic
commit
fb1ad7bd91

+ 2 - 2
zoniot-water/zoniot-water-core/src/main/java/com/bz/zoneiot/water/core/mapper/AlarmTypeDetailMapper.xml

@@ -67,10 +67,10 @@
             <if test="dto.alarmCategory != null and dto.alarmCategory!=''" >
                 and sat.alarm_category = #{dto.alarmCategory}
             </if>
-            <if test="dto.startTime != null">
+            <if test="dto.startTime != null and dto.startTime != ''">
                 and sad.alarm_start_time >=#{dto.startTime}
             </if>
-            <if test="dto.endTime != null">
+            <if test="dto.endTime != null and dto.endTime != ''">
                 and sad.alarm_end_time &lt;= #{dto.endTime}
             </if>
             <if test="dto.state != null">

+ 1 - 1
zoniot-water/zoniot-water-core/src/main/java/com/bz/zoneiot/water/core/mapper/DeviceAttributeMapper.xml

@@ -42,7 +42,7 @@
         <include refid="deviceAttributeColumns"/>
         FROM sms_device_attribute a
 
-        WHERE a.id = #{id}
+        WHERE a.id = #{id} AND status=1
     </select>
 
     <!--  根据获取实体List   -->

+ 5 - 2
zoniot-water/zoniot-water-web/src/main/java/com/bz/zoneiot/water/web/controller/MonitorInfoController.java

@@ -2,6 +2,7 @@ package com.bz.zoneiot.water.web.controller;
 
 import com.bz.zoneiot.core.common.enums.RespCodeEnum;
 import com.bz.zoneiot.core.common.pojo.AjaxMessage;
+import com.bz.zoneiot.core.mongo.utils.StringUtil;
 import com.bz.zoneiot.core.oauth2.pojo.LoginUser;
 import com.bz.zoneiot.core.oauth2.util.UserUtil;
 import com.bz.zoneiot.core.utils.BigDecimalUtils;
@@ -207,7 +208,7 @@ public class MonitorInfoController {
                         }
                     }
                 } else {
-                    DeviceAttributeEntity deviceAttributeEntity = deviceAttributeService.getById(item.getAttributeId());
+                    DeviceAttributeEntity deviceAttributeEntity = deviceAttributeService.findDeviceAttributeById(item.getAttributeId());
                     String unit = "";
                     if (deviceAttributeEntity != null && deviceAttributeEntity.getUnit() != null) {
                         unit = deviceAttributeEntity.getUnit();
@@ -219,7 +220,9 @@ public class MonitorInfoController {
         // 判断是否报警
         if (mapAlarm.containsKey(item.getAttributeId().intValue())) {
             item.setIsAlarm(1);
-            item.setMonitorValue(item.getMonitorValue() + "(" + mapAlarm.get(item.getAttributeId().intValue()).getAlarmRange() + ")");
+            String range = mapAlarm.get(item.getAttributeId().intValue()).getAlarmRange();
+            String   str = StringUtil.isEmpty(range) ? "" : "(" +range +")";
+            item.setMonitorValue(item.getMonitorValue() + str);
         } else {
             item.setIsAlarm(0);
         }

+ 1 - 0
zoniot-water/zoniot-water-web/src/main/resources/bootstrap-sit.yml

@@ -5,6 +5,7 @@ spring:
     active: sit
   cloud:
     nacos:
+
       config:
         namespace: 33c2968d-5b0c-4da2-bfd7-af8ef5a8f669
         server-addr: 10.0.0.63:8848