From c6d12c9c68f82410a5e1fc7644aa2d49ba9d71d4 Mon Sep 17 00:00:00 2001 From: pengjie <2413927716@qq.com> Date: Wed, 24 Jun 2026 11:00:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(watch):=20=E6=B7=BB=E5=8A=A0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=97=B6=E6=A0=A1=E9=AA=8CwatchNo=E5=94=AF=E4=B8=80?= =?UTF-8?q?=E6=80=A7=EF=BC=8C=E9=81=BF=E5=85=8D=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E7=BA=A6=E6=9D=9F=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/renkang/watch/controller/WatchDeviceController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/controller/WatchDeviceController.java b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/controller/WatchDeviceController.java index c0be757..3ff9d19 100644 --- a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/controller/WatchDeviceController.java +++ b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/controller/WatchDeviceController.java @@ -295,6 +295,12 @@ public class WatchDeviceController extends JeecgController add(@RequestBody WatchDevice watchDevice) { + // 校验设备编码是否已存在 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WatchDevice::getWatchNo, watchDevice.getWatchNo()); + if (watchDeviceService.count(queryWrapper) > 0) { + return Result.error("设备编码已存在,请勿重复添加"); + } // 删除开关 LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.eq(WatchDeviceSwitch::getWatchNo, watchDevice.getWatchNo());