From 450497f7107de8759435ea9270718583f4d25c47 Mon Sep 17 00:00:00 2001 From: wany <13995595726@qq.com> Date: Thu, 8 Aug 2024 17:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=BC=96=E8=BE=91=E6=97=B6=E6=A0=A1=E9=AA=8C=E8=A7=84?= =?UTF-8?q?=E5=88=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/xyt/controller/OsmoticWarnRuleController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gunshi/project/xyt/controller/OsmoticWarnRuleController.java b/src/main/java/com/gunshi/project/xyt/controller/OsmoticWarnRuleController.java index 77ca9bd..5f56550 100644 --- a/src/main/java/com/gunshi/project/xyt/controller/OsmoticWarnRuleController.java +++ b/src/main/java/com/gunshi/project/xyt/controller/OsmoticWarnRuleController.java @@ -47,18 +47,22 @@ public class OsmoticWarnRuleController { Long id = dto.getId(); LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); queryWrapper.eq(OsmoticWarnRule::getStationCode,dto.getStationCode()) - .eq(OsmoticWarnRule::getType,dto.getType()); + .eq(OsmoticWarnRule::getLevel,dto.getLevel()); + if(dto.getType() == 3){ + queryWrapper.eq(OsmoticWarnRule::getDirection,dto.getDirection()); + } if(id != null){ queryWrapper.ne(OsmoticWarnRule::getId,id); } if(service.count(queryWrapper ) > 0){ - throw new IllegalArgumentException("该站点已存在该类型的告警"); + throw new IllegalArgumentException("该测点已存在该类型的告警"); } } @Operation(summary = "修改") @PostMapping("/update") public R update(@Validated(Update.class) @RequestBody OsmoticWarnRule dto) { + checkParam(dto); boolean result = service.updateById(dto); return R.ok(result ? dto : null); }