1
0

绑定优化

This commit is contained in:
2025-07-12 09:54:08 +08:00
parent 24f0caacd5
commit fcd17634dc

View File

@ -525,7 +525,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
throw new RuntimeException("设备已绑定"); throw new RuntimeException("设备已绑定");
} }
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>(); UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
deviceUpdateWrapper.eq("id", device.getId()) deviceUpdateWrapper.eq("device_imei", deviceImei)
.set("binding_status", BindingStatusEnum.BOUND.getCode()) .set("binding_status", BindingStatusEnum.BOUND.getCode())
.set("binding_user_id", userId); .set("binding_user_id", userId);
; ;
@ -544,7 +544,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
throw new RuntimeException("设备已绑定"); throw new RuntimeException("设备已绑定");
} }
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>(); UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
deviceUpdateWrapper.eq("id", device.getId()) deviceUpdateWrapper.eq("device_mac", deviceMac)
.set("binding_status", BindingStatusEnum.BOUND.getCode()) .set("binding_status", BindingStatusEnum.BOUND.getCode())
.set("binding_user_id", userId); .set("binding_user_id", userId);
return baseMapper.update(null, deviceUpdateWrapper); return baseMapper.update(null, deviceUpdateWrapper);