Commit 523a2f6f authored by ma's avatar ma

限制SN唯一

parent 40ab819f
...@@ -163,9 +163,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -163,9 +163,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
lambdaQueryWrapper.eq(Device::getSn, sn).last("limit 1"); lambdaQueryWrapper.eq(Device::getSn, sn).last("limit 1");
Device device1 = deviceMapper.selectOne(lambdaQueryWrapper); Device device1 = deviceMapper.selectOne(lambdaQueryWrapper);
if (device1 != null) { if (device1 != null) {
if (deviceId.equals(device1.getDeviceId())) { if (!deviceId.equals(device1.getDeviceId())) {
return BaseResult.success();
} else {
return BaseResult.failed().setMsgValue("SN已被绑定"); return BaseResult.failed().setMsgValue("SN已被绑定");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment