Commit 42bb9085 authored by 马33's avatar 马33

限制绑定接口

parent a1549859
......@@ -77,6 +77,9 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
queryWrapper.eq(Device::getSn, sn).last("limit 1");
Device device = deviceMapper.selectOne(queryWrapper);
if (device != null) {
if (!StringUtils.isEmpty(device.getSnBind())) {
throw new IotLicenseException(403, "sn已被绑定");
}
device.setSnBind(snBind);
device.setStatus(1);
device.setUpdateTime(new Date());
......
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