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); }