From 5657c73867abd88523168448563337e5dc395ec7 Mon Sep 17 00:00:00 2001 From: daiyongfei <974332738@qq.com> Date: Sat, 26 Jul 2025 09:17:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=BE=E5=A4=87:=E8=93=9D?= =?UTF-8?q?=E7=89=99=E5=90=8D=E7=A7=B0=20=E5=BF=85=E5=A1=AB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fuyuanshen/equipment/service/impl/DeviceServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/service/impl/DeviceServiceImpl.java b/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/service/impl/DeviceServiceImpl.java index 850c680..92ba94a 100644 --- a/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/service/impl/DeviceServiceImpl.java +++ b/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/service/impl/DeviceServiceImpl.java @@ -148,6 +148,10 @@ public class DeviceServiceImpl extends ServiceImpl impleme @Transactional(rollbackFor = Exception.class) public void addDevice(DeviceForm deviceForm) throws Exception { + if (deviceForm.getDeviceMac() != null && deviceForm.getBluetoothName() == null) { + throw new BadRequestException("请填写蓝牙名称!!!"); + } + Device device1 = deviceMapper.selectOne(new QueryWrapper().eq("device_mac", deviceForm.getDeviceMac())); if (device1 != null) { throw new BadRequestException("设备MAC已存在!!!"); @@ -178,6 +182,7 @@ public class DeviceServiceImpl extends ServiceImpl impleme // 转换对象并插入数据库 Device device = new Device(); + BeanUtil.copyProperties(deviceForm, device, true); device.setDeviceNo(createDeviceNo()); LoginUser loginUser = LoginHelper.getLoginUser();