Commit 31253801 authored by 马33's avatar 马33

修改bug

parent c5a340b5
......@@ -73,6 +73,12 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
public Boolean terminalDevieBind(TerminalDevieBindDTO terminalDevieBindDTO) {
String sn = terminalDevieBindDTO.getSn();
String snBind = terminalDevieBindDTO.getSnBind();
LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Device::getSnBind, snBind).last("limit 1");
Device deviceTemp = deviceMapper.selectOne(wrapper);
if (deviceTemp != null) {
throw new IotLicenseException(403, "该设备已绑定了" + deviceTemp.getSn());
}
LambdaQueryWrapper<Device> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Device::getSn, sn).last("limit 1");
Device device = deviceMapper.selectOne(queryWrapper);
......
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