|
@@ -2,6 +2,7 @@ package com.zfjg.manage.service.impl.device;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.zfjg.common.core.constant.MapKeyConstants;
|
|
|
import com.zfjg.common.core.domain.R;
|
|
@@ -126,7 +127,13 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|
|
// bindDevice.setUsePersonName(null);
|
|
|
// bindDevice.setBindStatus(BindStatusEnum.UN_ACTIVE.getValue());
|
|
|
// deviceMapper.updateById(bindDevice);
|
|
|
- deviceMapper.unBind(bindDevice.getId());
|
|
|
+// deviceMapper.unBind(bindDevice.getId());
|
|
|
+ deviceMapper.update(Wrappers.<Device>lambdaUpdate()
|
|
|
+ .set(Device::getUsePersonId, null)
|
|
|
+ .set(Device::getUsePersonName, null)
|
|
|
+ .set(Device::getBindStatus, BindStatusEnum.UN_ACTIVE.getValue())
|
|
|
+ .eq(Device::getId, bindDevice.getId())
|
|
|
+ );
|
|
|
//记录解绑记录
|
|
|
LambdaQueryWrapper<DeviceBoundHis> deviceBoundHisMapperWrapper = new LambdaQueryWrapper<>();
|
|
|
deviceBoundHisMapperWrapper.eq(DeviceBoundHis::getDeviceId,id).eq(DeviceBoundHis::getUsePersonId, finalUserId)
|