|
|
@@ -19,6 +19,7 @@ import com.ruoyi.common.log.enums.BusinessType;
|
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
|
|
import com.ruoyi.ems.domain.Alarm;
|
|
|
+import com.ruoyi.ems.domain.AlarmHandle;
|
|
|
import com.ruoyi.ems.service.IAlarmService;
|
|
|
import com.ruoyi.ems.service.alarm.AlarmProcessService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -136,9 +137,9 @@ public class AlarmController extends BaseController {
|
|
|
@PutMapping("/confirm/{alarmId}")
|
|
|
@ApiOperation("确认告警")
|
|
|
public AjaxResult confirm(@PathVariable("alarmId") String alarmId,
|
|
|
- @RequestParam(value = "remark", required = false) String remark) {
|
|
|
+ @RequestBody AlarmHandle handle) {
|
|
|
String operator = SecurityUtils.getUsername();
|
|
|
- processService.confirmAlarm(alarmId, operator, remark);
|
|
|
+ processService.confirmAlarm(alarmId, operator, handle.getRemark());
|
|
|
return success();
|
|
|
}
|
|
|
|
|
|
@@ -150,10 +151,9 @@ public class AlarmController extends BaseController {
|
|
|
@PutMapping("/handle/{alarmId}")
|
|
|
@ApiOperation("处置告警")
|
|
|
public AjaxResult handle(@PathVariable("alarmId") String alarmId,
|
|
|
- @RequestParam("handleContent") String handleContent,
|
|
|
- @RequestParam(value = "handleResult", required = false) String handleResult) {
|
|
|
+ @RequestBody AlarmHandle handle) {
|
|
|
String operator = SecurityUtils.getUsername();
|
|
|
- processService.handleAlarm(alarmId, handleContent, handleResult, operator);
|
|
|
+ processService.handleAlarm(alarmId, handle.getHandleContent(), handle.getHandleResult(), operator);
|
|
|
return success();
|
|
|
}
|
|
|
|
|
|
@@ -165,9 +165,9 @@ public class AlarmController extends BaseController {
|
|
|
@PutMapping("/resolve/{alarmId}")
|
|
|
@ApiOperation("解决告警")
|
|
|
public AjaxResult resolve(@PathVariable("alarmId") String alarmId,
|
|
|
- @RequestParam(value = "resolveRemark", required = false) String resolveRemark) {
|
|
|
+ @RequestBody Alarm alarm) {
|
|
|
String operator = SecurityUtils.getUsername();
|
|
|
- processService.resolveAlarm(alarmId, resolveRemark, operator);
|
|
|
+ processService.resolveAlarm(alarmId, alarm.getResolveRemark(), operator);
|
|
|
return success();
|
|
|
}
|
|
|
|
|
|
@@ -178,10 +178,10 @@ public class AlarmController extends BaseController {
|
|
|
@Log(title = "告警管理", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping("/close/{alarmId}")
|
|
|
@ApiOperation("关闭告警")
|
|
|
- public AjaxResult close(@PathVariable("alarmId") String alarmId,
|
|
|
- @RequestParam(value = "reason", required = false) String reason) {
|
|
|
+ public AjaxResult close(@PathVariable("alarmId") String alarmId, @RequestBody Alarm alarm) {
|
|
|
String operator = SecurityUtils.getUsername();
|
|
|
- processService.closeAlarm(alarmId, reason, operator);
|
|
|
+ // 从实体中获取 reason
|
|
|
+ processService.closeAlarm(alarmId, alarm.getResolveRemark(), operator);
|
|
|
return success();
|
|
|
}
|
|
|
|