lihui001 3 years ago
parent
commit
514964ce71

+ 4 - 0
zoniot-water/zoniot-water-core/src/main/java/com/bz/zoneiot/water/core/entity/BaseEntity.java

@@ -1,6 +1,7 @@
 package com.bz.zoneiot.water.core.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -26,12 +27,15 @@ public class BaseEntity implements Serializable {
     private Long id;
 
     @ApiModelProperty(value = "租户标识")
+    @TableField(exist = false)
     private String tenantId;
 
     @ApiModelProperty(value = "所属公司ID")
+    @TableField(exist = false)
     private Integer companyOrgId;
 
     @ApiModelProperty(value = "所属部门ID")
+    @TableField(exist = false)
     private Integer deptOrgId;
 
     @ApiModelProperty(value = "创建日期")

+ 5 - 5
zoniot-water/zoniot-water-core/src/main/java/com/bz/zoneiot/water/core/mapper/OnlineMonitorMapper.xml

@@ -88,7 +88,7 @@
     <sql id="sceneDeviceJoins">
         inner join sms_scene_type t3 on t3.id = t1.scene_type_id and t3. status = 1
         left join sms_device_scene t2 on t2.parent_scene_id=t1.id and t2. status = 1
-        left join sms_device t4 on t2.device_id=t4.id and t4. status = 1 and t4. enable_state = 1
+        left join sms_device t4 on t2.device_id=t4.id and t4. status = 1
         left join sms_device_parm t5 on t5.scene_id = t2.scene_id and t5.device_id=t2.device_id and t5. status = 1
         <if test="type == 3 ">
             and t5.is_suspension = 1
@@ -135,7 +135,7 @@
     <sql id="deviceInnerJoins">
         inner join sms_scene_type t3 on t1.scene_type_id=t3.id and t3. status = 1
         inner join sms_device_scene t2 on t2.parent_scene_id=t1.id and t2. status = 1
-        inner join sms_device t6 on t2.device_id=t6.id and t6. status = 1 and t6.enable_state = 1
+        inner join sms_device t6 on t2.device_id=t6.id and t6. status = 1
         inner join sms_scene t4 on t2.scene_id=t4.id and t4. status = 1
         inner join sms_scene_type t5 on t4.scene_type_id=t5.id and t5. status = 1
     </sql>
@@ -143,7 +143,7 @@
     <sql id="deviceLeftJoins">
         inner join sms_scene_type t3 on t1.scene_type_id=t3.id and t3. status = 1
         left join sms_device_scene t2 on t2.parent_scene_id=t1.id and t2. status = 1
-        left join sms_device t6 on t2.device_id=t6.id and t6. status = 1 and t6.enable_state = 1
+        left join sms_device t6 on t2.device_id=t6.id and t6. status = 1
         left join sms_scene t4 on t2.scene_id=t4.id and t4. status = 1
         left join sms_scene_type t5 on t4.scene_type_id=t5.id and t5. status = 1 and t5.scene_type_name = #{sceneTypeName}
     </sql>
@@ -318,7 +318,7 @@
         from sms_scene t1
         inner join sms_scene_type t3 on t3.id = t1.scene_type_id and t3. status = 1
         inner join sms_alarm_details t6 on t1.id=t6.parent_scene_id and t6.`status`=1
-        inner join sms_device t4 on t4.id=t6.device_id and t4.`status`=1 and t4. enable_state = 1
+        inner join sms_device t4 on t4.id=t6.device_id and t4.`status`=1
         where t1.parent_scene_id = 0 and t1. status = 1 and t1. enable_state = 1 and t1.id = #{id}
         <if test="sceneIds != null and sceneIds.size() > 0">
             and t1.id  in
@@ -852,7 +852,7 @@
         from sms_scene t1
         inner join sms_scene_type t3 on t3.id = t1.scene_type_id and t3. status = 1
         inner join sms_alarm_details t6 on t1.id=t6.parent_scene_id and t6.`status`=1
-        inner join sms_device t4 on t4.id=t6.device_id and t4.`status`=1 and t4. enable_state = 1
+        inner join sms_device t4 on t4.id=t6.device_id and t4.`status`=1
         where t1.parent_scene_id = 0 and t1. status = 1 and t1. enable_state = 1 and t1.id = #{id}
         <if test="sceneIds != null and sceneIds.size() > 0">
             and t1.id  in

+ 4 - 4
zoniot-water/zoniot-water-web/src/main/java/com/bz/zoneiot/water/web/service/impl/OnlineMonitorImpl.java

@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.io.*;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
@@ -523,15 +524,14 @@ public class OnlineMonitorImpl implements OnlineMonitorService {
     }
 
     private MonitorDataEntity getCacheData(String key){
-        String str = redisUtils.get(("sms_water_" + key));
-        if (StringUtil.isEmpty(str)) {
+        byte[] bytes = redisUtils.get(("sms_water_" + key).getBytes());
+        if (bytes == null) {
             return null;
         }
-        return (MonitorDataEntity)ByteArrayUtils.bytesToObject(str.getBytes()).get();
+        return (MonitorDataEntity)ByteArrayUtils.bytesToObject(bytes).get();
     }
 
 
-
     /**
     * 获取在线数据及计算数据
     * @author Andy