设备解绑
This commit is contained in:
@ -282,6 +282,25 @@ public class DeviceBizService {
|
|||||||
.set("binding_time", null);
|
.set("binding_time", null);
|
||||||
deviceMapper.update(null, deviceUpdateWrapper);
|
deviceMapper.update(null, deviceUpdateWrapper);
|
||||||
}
|
}
|
||||||
|
QueryWrapper<AppDeviceBindRecord> brqWrapper = new QueryWrapper<>();
|
||||||
|
brqWrapper.eq("device_id", device.getId());
|
||||||
|
brqWrapper.eq("binding_user_id", userId);
|
||||||
|
List<AppDeviceBindRecord> appDeviceBindRecordList = appDeviceBindRecordMapper.selectList(brqWrapper);
|
||||||
|
if (CollectionUtil.isNotEmpty(appDeviceBindRecordList)) {
|
||||||
|
appDeviceBindRecordList.forEach(appDeviceBindRecord ->
|
||||||
|
appDeviceBindRecordMapper.deleteById(appDeviceBindRecord.getId()));
|
||||||
|
}
|
||||||
|
AppUserVo appUserVo = appUserMapper.selectVoById(userId);
|
||||||
|
if(appUserVo != null){
|
||||||
|
QueryWrapper<AppDeviceShare> appDeviceShareQueryWrapper = new QueryWrapper<>();
|
||||||
|
appDeviceShareQueryWrapper.eq("device_id", device.getId());
|
||||||
|
appDeviceShareQueryWrapper.eq("phonenumber", appUserVo.getPhonenumber());
|
||||||
|
List<AppDeviceShare> appDeviceShareList = appDeviceShareMapper.selectList(appDeviceShareQueryWrapper);
|
||||||
|
if (CollectionUtil.isNotEmpty(appDeviceShareList)) {
|
||||||
|
appDeviceShareList.forEach(appDeviceShare ->
|
||||||
|
appDeviceShareMapper.deleteById(appDeviceShare.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
QueryWrapper<AppDeviceBindRecord> bindRecordQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<AppDeviceBindRecord> bindRecordQueryWrapper = new QueryWrapper<>();
|
||||||
bindRecordQueryWrapper.eq("device_id", device.getId());
|
bindRecordQueryWrapper.eq("device_id", device.getId());
|
||||||
@ -295,25 +314,17 @@ public class DeviceBizService {
|
|||||||
.set("binding_status", BindingStatusEnum.UNBOUND.getCode())
|
.set("binding_status", BindingStatusEnum.UNBOUND.getCode())
|
||||||
.set("binding_time", null);
|
.set("binding_time", null);
|
||||||
deviceMapper.update(null, deviceUpdateWrapper);
|
deviceMapper.update(null, deviceUpdateWrapper);
|
||||||
}
|
|
||||||
|
|
||||||
QueryWrapper<AppDeviceBindRecord> brqWrapper = new QueryWrapper<>();
|
QueryWrapper<AppDeviceBindRecord> brqWrapper = new QueryWrapper<>();
|
||||||
brqWrapper.eq("device_id", device.getId());
|
brqWrapper.eq("device_id", device.getId());
|
||||||
if(userId != null){
|
List<AppDeviceBindRecord> appDeviceBindRecordList = appDeviceBindRecordMapper.selectList(brqWrapper);
|
||||||
brqWrapper.eq("binding_user_id", userId);
|
if (CollectionUtil.isNotEmpty(appDeviceBindRecordList)) {
|
||||||
}
|
appDeviceBindRecordList.forEach(appDeviceBindRecord ->
|
||||||
|
appDeviceBindRecordMapper.deleteById(appDeviceBindRecord.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
List<AppDeviceBindRecord> appDeviceBindRecordList = appDeviceBindRecordMapper.selectList(brqWrapper);
|
|
||||||
if (CollectionUtil.isNotEmpty(appDeviceBindRecordList)) {
|
|
||||||
appDeviceBindRecordList.forEach(appDeviceBindRecord ->
|
|
||||||
appDeviceBindRecordMapper.deleteById(appDeviceBindRecord.getId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
AppUserVo appUserVo = appUserMapper.selectVoById(userId);
|
|
||||||
if(appUserVo != null){
|
|
||||||
QueryWrapper<AppDeviceShare> appDeviceShareQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<AppDeviceShare> appDeviceShareQueryWrapper = new QueryWrapper<>();
|
||||||
appDeviceShareQueryWrapper.eq("device_id", device.getId());
|
appDeviceShareQueryWrapper.eq("device_id", device.getId());
|
||||||
appDeviceShareQueryWrapper.eq("phonenumber", appUserVo.getPhonenumber());
|
|
||||||
List<AppDeviceShare> appDeviceShareList = appDeviceShareMapper.selectList(appDeviceShareQueryWrapper);
|
List<AppDeviceShare> appDeviceShareList = appDeviceShareMapper.selectList(appDeviceShareQueryWrapper);
|
||||||
if (CollectionUtil.isNotEmpty(appDeviceShareList)) {
|
if (CollectionUtil.isNotEmpty(appDeviceShareList)) {
|
||||||
appDeviceShareList.forEach(appDeviceShare ->
|
appDeviceShareList.forEach(appDeviceShare ->
|
||||||
|
|||||||
Reference in New Issue
Block a user