Merge remote-tracking branch 'origin/6170' into 6170

This commit is contained in:
2025-09-11 14:43:02 +08:00
3 changed files with 8 additions and 2 deletions

View File

@ -181,12 +181,14 @@ public class DeviceBizService {
QueryWrapper<AppDeviceBindRecord> bindRecordQueryWrapper = new QueryWrapper<>();
bindRecordQueryWrapper.eq("device_id", device.getId());
bindRecordQueryWrapper.eq("communication_mode", 0);
AppDeviceBindRecord appDeviceBindRecord = appDeviceBindRecordMapper.selectOne(bindRecordQueryWrapper);
if (appDeviceBindRecord != null) {
UpdateWrapper<AppDeviceBindRecord> deviceUpdateWrapper = new UpdateWrapper<>();
deviceUpdateWrapper.eq("device_id", device.getId())
.set("binding_status", BindingStatusEnum.BOUND.getCode())
.set("binding_user_id", userId)
.set("communication_mode", 0)
.set("update_time", new Date())
.set("binding_time", new Date());
return appDeviceBindRecordMapper.update(null, deviceUpdateWrapper);
@ -195,6 +197,7 @@ public class DeviceBizService {
bindRecord.setDeviceId(device.getId());
bindRecord.setBindingUserId(userId);
bindRecord.setBindingTime(new Date());
bindRecord.setCommunicationMode(0);
bindRecord.setCreateBy(userId);
appDeviceBindRecordMapper.insert(bindRecord);
}
@ -224,6 +227,7 @@ public class DeviceBizService {
deviceUpdateWrapper.eq("device_id", device.getId())
.eq("binding_user_id", userId)
.set("binding_user_id", userId)
.set("communication_mode", 1)
.set("binding_time", new Date());
return appDeviceBindRecordMapper.update(null, deviceUpdateWrapper);
} else {
@ -231,6 +235,7 @@ public class DeviceBizService {
bindRecord.setDeviceId(device.getId());
bindRecord.setBindingUserId(userId);
bindRecord.setBindingTime(new Date());
bindRecord.setCommunicationMode(1);
bindRecord.setCreateBy(userId);
appDeviceBindRecordMapper.insert(bindRecord);
}