diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordAlarmController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordAlarmController.java index ff15ba6..b34175b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordAlarmController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordAlarmController.java @@ -115,6 +115,29 @@ public class RecordAlarmController extends BaseController return toAjax(recordAlarmService.updateRecordAlarm(recordAlarm)); } + @PostMapping("/batchProcessing") + @ResponseBody + public AjaxResult batchProcessing(String alarmuid,String disposeMode,String alarmReason){ + boolean success = false; + List strings = JSONArray.parseArray(alarmuid, String.class); + + try{ + for (String string : strings) { + RecordAlarm recordAlarm =new RecordAlarm(); + recordAlarm.setAlarmuid(string); + recordAlarm.setDisposeFlag(1L); + recordAlarm.setDisposeMode(disposeMode); + recordAlarm.setAlarmReason(alarmReason); + int i = recordAlarmService.updateRecordAlarm(recordAlarm); + } + success = true; + }catch (Exception ex){ + success = false; + } + + return toAjax(success); + } + /** * 删除异常数据记录 */ diff --git a/ruoyi-admin/src/main/resources/templates/record/recordAlarm/recordAlarm.html b/ruoyi-admin/src/main/resources/templates/record/recordAlarm/recordAlarm.html index 999aa3d..e7f1a7d 100644 --- a/ruoyi-admin/src/main/resources/templates/record/recordAlarm/recordAlarm.html +++ b/ruoyi-admin/src/main/resources/templates/record/recordAlarm/recordAlarm.html @@ -40,8 +40,19 @@
  • + + +
  • +
  • - + + - +
  •  搜索 @@ -78,9 +89,11 @@ + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordAlarm.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordAlarm.java index 9930631..220d6ed 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordAlarm.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordAlarm.java @@ -51,6 +51,10 @@ public class RecordAlarm extends BaseEntity /** 告警原因 */ private String alarmReason; + private String beginCollectTime; + + private String endCollectTime; + public void setSensorId(String sensorId) { this.sensorId = sensorId; @@ -138,6 +142,22 @@ public class RecordAlarm extends BaseEntity this.alarmuid = alarmuid; } + public String getBeginCollectTime() { + return beginCollectTime; + } + + public void setBeginCollectTime(String beginCollectTime) { + this.beginCollectTime = beginCollectTime; + } + + public String getEndCollectTime() { + return endCollectTime; + } + + public void setEndCollectTime(String endCollectTime) { + this.endCollectTime = endCollectTime; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-system/src/main/resources/mapper/system/RecordAlarmMapper.xml b/ruoyi-system/src/main/resources/mapper/system/RecordAlarmMapper.xml index 6a1000e..926a374 100644 --- a/ruoyi-system/src/main/resources/mapper/system/RecordAlarmMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/RecordAlarmMapper.xml @@ -44,11 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and Sensor_Id = #{sensorId} + and Dispose_Flag = #{disposeFlag} and AlarmType_Id = #{alarmtypeId} and Min_Value = #{minValue} and Alarm_Value = #{alarmValue} and Max_Value = #{maxValue} - and Collect_Time = #{collectTime} + and Collect_Time between #{beginCollectTime} and #{endCollectTime} @@ -84,11 +85,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update record_alarm - Dispose_Flag = #{disposeFlag}, Dispose_Mode = #{disposeMode}, Alarm_Reason = #{alarmReason},