From 63e7ee4de83e1dfd0d4db6113ca07fe544155c14 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期五, 06 十月 2023 10:58:40 +0800
Subject: [PATCH] 增加批量恢复报警过滤接口
---
ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java | 9 +++++++++
ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java | 7 +++----
ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java | 8 +++++++-
ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml | 7 +++++++
ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java | 9 ++++++++-
5 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java b/ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java
index 892ab0b..2208a0e 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java
@@ -105,11 +105,10 @@
@ApiOperation("鎭㈠鎶ヨ杩囨护")
@PreAuthorize("@ss.hasPermi('alarm:filter:edit')")
@Log(title = "鎭㈠鎶ヨ杩囨护", businessType = BusinessType.UPDATE)
- @PutMapping("/recovery")
- public AjaxResult recovery(@RequestBody ArdAlarmFilter ardAlarmFilter)
+ @PutMapping("/recovery/{ids}")
+ public AjaxResult recovery(@PathVariable String[] ids)
{
- ardAlarmFilter.setEndTime(DateUtils.covertTime(new Date()));
- return toAjax(ardAlarmFilterService.updateArdAlarmFilter(ardAlarmFilter));
+ return toAjax(ardAlarmFilterService.RecoveryArdAlarmFilter(ids));
}
/**
* 鍒犻櫎鎶ヨ杩囨护
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java
index c3c12cd..5481085 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java
@@ -1,7 +1,9 @@
package com.ruoyi.alarm.filter.mapper;
+import java.util.Date;
import java.util.List;
import com.ruoyi.alarm.filter.domain.ArdAlarmFilter;
+import org.apache.ibatis.annotations.Param;
/**
* 鎶ヨ杩囨护Mapper鎺ュ彛
@@ -58,4 +60,11 @@
* @return 缁撴灉
*/
public int deleteArdAlarmFilterByIds(String[] ids);
+ /**
+ * 鎵归噺鎭㈠鎶ヨ杩囨护
+ *
+ * @param ids 闇�瑕佹仮澶嶇殑鏁版嵁涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int batchRecoveryArdAlarmFilterByIds(String[] ids);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java b/ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java
index a3de5bb..6138b38 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java
@@ -42,7 +42,13 @@
* @return 缁撴灉
*/
public int updateArdAlarmFilter(ArdAlarmFilter ardAlarmFilter);
-
+ /**
+ * 鎵归噺鎭㈠鎶ヨ杩囨护
+ *
+ * @param ids 闇�瑕佹仮澶嶇殑鎶ヨ杩囨护涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int RecoveryArdAlarmFilter(String[] ids);
/**
* 鎵归噺鍒犻櫎鎶ヨ杩囨护
*
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java
index f105536..adaf6f8 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java
@@ -17,6 +17,8 @@
import com.ruoyi.alarm.filter.domain.ArdAlarmFilter;
import com.ruoyi.alarm.filter.service.IArdAlarmFilterService;
+import javax.annotation.Resource;
+
/**
* 鎶ヨ杩囨护Service涓氬姟灞傚鐞�
*
@@ -25,7 +27,7 @@
*/
@Service
public class ArdAlarmFilterServiceImpl implements IArdAlarmFilterService {
- @Autowired
+ @Resource
private ArdAlarmFilterMapper ardAlarmFilterMapper;
/**
@@ -80,6 +82,11 @@
return ardAlarmFilterMapper.updateArdAlarmFilter(ardAlarmFilter);
}
+ @Override
+ public int RecoveryArdAlarmFilter(String[] ids) {
+ return ardAlarmFilterMapper.batchRecoveryArdAlarmFilterByIds(ids);
+ }
+
/**
* 鎵归噺鍒犻櫎鎶ヨ杩囨护
*
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml
index 2a5e9c2..50a42b1 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml
@@ -102,4 +102,11 @@
#{id}
</foreach>
</delete>
+ <update id="batchRecoveryArdAlarmFilterByIds" parameterType="String">
+ update ard_alarm_filter set end_time=now()::timestamp(0)
+ where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </update>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3