Kaynağa Gözat

数据报警问题

lihui007 3 yıl önce
ebeveyn
işleme
b18074d6d4

+ 5 - 1
sms_water/src/main/java/com/huaxu/quartz/job/MonitorDataReportByDayJob.java

@@ -7,6 +7,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -32,7 +34,7 @@ public  class MonitorDataReportByDayJob implements Job, Serializable {
     public void execute(JobExecutionContext context)  {
         try {
             log.info("日报报任务开始执行");
-            monitorDataService.getMonitorDataReportByHour();
+             monitorDataService.getMonitorDataReportByHour();
             dataAlarmHourJobService.execute();
             log.info("日报任务执行结束");
         } catch (Exception e) {
@@ -40,4 +42,6 @@ public  class MonitorDataReportByDayJob implements Job, Serializable {
             log.info("日报任务执行异常,{}", e.getMessage());
         }
     }
+
+
 }

+ 2 - 2
sms_water/src/main/java/com/huaxu/vo/DataAlarmManageVo.java

@@ -66,8 +66,8 @@ public class DataAlarmManageVo extends DataAlarmSetting implements Serializable
     public String getMd5Query(){
         StringBuffer buffer = new StringBuffer();
         buffer.append(super.getBeSceneId()).append(super.getBeDeviceId()).append(super.getBeAttributeId())
-                .append(super.getBeType()).append(super.getComputeRules()).append(super.getToSceneId()).append(super.getToDeviceId())
-                .append(super.getToAttributeId()).append(super.getToType()).append(super.getAlarmRules()).append(super.getAlarmValue());
+                .append(super.getBeType()).append(this.getComputeRules()).append(super.getToSceneId()).append(super.getToDeviceId())
+                .append(super.getToAttributeId()).append(super.getToType()).append(this.getAlarmRules()).append(this.getAlarmValue());
         return Md5Util.hash(buffer.toString());
     }
 

+ 2 - 2
sms_water/src/main/resources/mapper/DataAlarmAnalysisMapper.xml

@@ -21,7 +21,7 @@
             s.ADDRESS as "beAddress",s.POINT_X as "bePointX",s.POINT_Y as "bePointY",t2.UNIT as beUnit,
             mm.to_scene_name,mm.to_device_name,mm.to_attribute_name,mm.toAddress,mm.toPointX,mm.toPointY,mm.toUnit
         from
-            sms_data_alarm_detail  a
+            sms_data_alarm_analysis  a
         INNER JOIN sms_scene s on s.id = a.be_scene_id and s.status = 1
         INNER JOIN sms_device t1 on a.be_device_id = t1.id and t1.status = 1
         INNER JOIN sms_device_attribute t2 on a.be_attribute_id = t2.id  and t2.status = 1
@@ -29,7 +29,7 @@
             select m.id, s.SCENE_NAME as to_scene_name, t1.DEVICE_NAME as to_device_name, t2.name as to_attribute_name,
             s.ADDRESS as "toAddress",s.POINT_X as "toPointX",s.POINT_Y as "toPointY",t2.UNIT as toUnit
             from
-            sms_data_alarm_detail  m
+                sms_data_alarm_analysis  m
             INNER JOIN sms_scene s on s.id = m.to_scene_id and s.status = 1
             INNER JOIN sms_device t1 on m.to_device_id = t1.id and t1.status = 1
             INNER JOIN sms_device_attribute t2 on m.to_attribute_id=t2.id  and t2.status =1

+ 1 - 0
sms_water/src/main/resources/mapper/DataAlarmManageMapper.xml

@@ -147,6 +147,7 @@
         ) mm on mm.id = a.id
         where
         a.be_type = #{type} and a.to_type =#{type}
+        and a.status = 1
     </select>
 
 </mapper>