|
@@ -47,6 +47,14 @@ public class IotAlarmSettingController {
|
|
|
return success(iotAlarmSettingService.createIotAlarmSetting(createReqVO));
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/batch/update")
|
|
|
+ @Operation(summary = "创建告警设置")
|
|
|
+ @PreAuthorize("@ss.hasPermission('rq:iot-alarm-setting:create')")
|
|
|
+ public CommonResult<String> batchUpdateIotAlarmSetting(@Valid @RequestBody List<IotAlarmSettingSaveReqVO> alarms) {
|
|
|
+ alarms.forEach(alarm -> iotAlarmSettingService.updateIotAlarmSetting(alarm));
|
|
|
+ return success("完成");
|
|
|
+ }
|
|
|
+
|
|
|
@PutMapping("/update")
|
|
|
@Operation(summary = "更新告警设置")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-alarm-setting:update')")
|
|
@@ -73,11 +81,11 @@ public class IotAlarmSettingController {
|
|
|
return success(BeanUtils.toBean(iotAlarmSetting, IotAlarmSettingRespVO.class));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/page")
|
|
|
+ @GetMapping("/page/{if}")
|
|
|
@Operation(summary = "获得告警设置分页")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-alarm-setting:query')")
|
|
|
- public CommonResult<PageResult<IotAlarmSettingRespVO>> getIotAlarmSettingPage(@Valid IotAlarmSettingPageReqVO pageReqVO) {
|
|
|
- PageResult<IotAlarmSettingDO> pageResult = iotAlarmSettingService.getIotAlarmSettingPage(pageReqVO);
|
|
|
+ public CommonResult<PageResult<IotAlarmSettingRespVO>> getIotAlarmSettingPage(@Valid IotAlarmSettingPageReqVO pageReqVO, @PathVariable("if") String ifDevice) {
|
|
|
+ PageResult<IotAlarmSettingDO> pageResult = iotAlarmSettingService.getIotAlarmSettingPage(pageReqVO, ifDevice);
|
|
|
return success(BeanUtils.toBean(pageResult, IotAlarmSettingRespVO.class));
|
|
|
}
|
|
|
|
|
@@ -88,7 +96,7 @@ public class IotAlarmSettingController {
|
|
|
public void exportIotAlarmSettingExcel(@Valid IotAlarmSettingPageReqVO pageReqVO,
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
- List<IotAlarmSettingDO> list = iotAlarmSettingService.getIotAlarmSettingPage(pageReqVO).getList();
|
|
|
+ List<IotAlarmSettingDO> list = iotAlarmSettingService.getIotAlarmSettingPage(pageReqVO,"1").getList();
|
|
|
// 导出 Excel
|
|
|
ExcelUtils.write(response, "告警设置.xls", "数据", IotAlarmSettingRespVO.class,
|
|
|
BeanUtils.toBean(list, IotAlarmSettingRespVO.class));
|