From 3885a4ec3acdfbf2b2d5f82f38e3aa506cda0430 Mon Sep 17 00:00:00 2001 From: xiaojinfei <378266566@qq.com> Date: Fri, 9 Jan 2026 11:49:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=A2=84=E8=AD=A6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alert/controller/admin/warn/vo/WarnSaveReqVO.java | 4 ++-- .../alert/controller/admin/warn/warnController.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/controller/admin/warn/vo/WarnSaveReqVO.java b/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/controller/admin/warn/vo/WarnSaveReqVO.java index c275594..5c0aa8a 100644 --- a/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/controller/admin/warn/vo/WarnSaveReqVO.java +++ b/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/controller/admin/warn/vo/WarnSaveReqVO.java @@ -14,7 +14,7 @@ import java.util.List; @Data public class WarnSaveReqVO { @Schema(description = "预警编号", example = "1") - @NotNull(message = "预警编号不能为空") +// @NotNull(message = "预警编号不能为空") private Long warnId; @Schema(description = "实例编号", example = "1") @@ -51,7 +51,7 @@ public class WarnSaveReqVO { @Schema(description = "规则点号还是模型点号", example = "1") // @NotNull(message = "单位不能为空") - private String pointOrModel; + private String pointOrModel="POINT"; private Long timeDurationThreshold; diff --git a/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/controller/admin/warn/warnController.java b/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/controller/admin/warn/warnController.java index 952c2c2..73b1646 100644 --- a/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/controller/admin/warn/warnController.java +++ b/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/controller/admin/warn/warnController.java @@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.alert.dal.dataobject.warn.AlarmLevelDO; import cn.iocoder.yudao.module.alert.dal.dataobject.warn.WarnDO; import cn.iocoder.yudao.module.alert.service.instant.InstantService; import cn.iocoder.yudao.module.alert.service.warn.WarnService; +import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeSaveReqVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; @@ -60,6 +61,15 @@ public class warnController { return success(BeanUtils.toBean(warn, WarnRespVO.class)); } + + @PostMapping("/create") + @Operation(summary = "创建预警") +// @PreAuthorize("@ss.hasPermission('system:notice:create')") + public CommonResult createWarn(@Valid @RequestBody WarnSaveReqVO createReqVO) { + Long warnId = warnService.createWarn(createReqVO); + return success(warnId); + } + @PutMapping("/update") @Operation(summary = "修改预警") // @PreAuthorize("@ss.hasPermission('run:warn:update')") From 29e1140830d5c17cf98c01c957fd55b34c714d98 Mon Sep 17 00:00:00 2001 From: xiaojinfei <378266566@qq.com> Date: Fri, 9 Jan 2026 11:58:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:pointormodel=E5=A2=9E=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=EF=BC=8C=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/alert/service/instant/InstantServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/service/instant/InstantServiceImpl.java b/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/service/instant/InstantServiceImpl.java index 61aaf1f..337a18b 100644 --- a/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/service/instant/InstantServiceImpl.java +++ b/yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/service/instant/InstantServiceImpl.java @@ -277,7 +277,7 @@ public class InstantServiceImpl implements InstantService { // warn.setId(insertId); //设置实例id warnSaveReqVO.setMpId(instant.getMpId()); - warnSaveReqVO.setPointOrModel("POINT"); +// warnSaveReqVO.setPointOrModel("POINT"); warnSaveReqVO.setPointId(createReqVO.getInputInfo().get(i)); warnSaveReqVO.setPointName(createReqVO.getInputName().get(i)); warnSaveReqVO.setGzpName(createReqVO.getInputName().get(i)); @@ -311,7 +311,7 @@ public class InstantServiceImpl implements InstantService { // warn.setId(insertId); //设置实例id warnSaveReqVO.setMpId(instant.getMpId()); - warnSaveReqVO.setPointOrModel("POINT"); +// warnSaveReqVO.setPointOrModel("POINT"); warnSaveReqVO.setPointId(createReqVO.getInputInfo().get(reportObj.getAssess().get(j).getIndex())); warnSaveReqVO.setPointName(createReqVO.getInputName().get(reportObj.getAssess().get(j).getIndex()));