新增绑定时间字段
This commit is contained in:
@ -9,6 +9,8 @@ import com.fuyuanshen.common.tenant.core.TenantEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 设备表
|
||||
* @Author: WY
|
||||
@ -114,4 +116,6 @@ public class Device extends TenantEntity {
|
||||
private String createByName;
|
||||
|
||||
private Long bindingUserId;
|
||||
|
||||
private Date bindingTime;
|
||||
}
|
||||
|
@ -527,8 +527,9 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
||||
deviceUpdateWrapper.eq("id", device.getId())
|
||||
.set("binding_status", BindingStatusEnum.BOUND.getCode())
|
||||
.set("binding_user_id", userId);
|
||||
;
|
||||
.set("binding_user_id", userId)
|
||||
.set("binding_time", new Date());
|
||||
|
||||
|
||||
return baseMapper.update(null, deviceUpdateWrapper);
|
||||
} else if (mode == CommunicationModeEnum.BLUETOOTH.getValue()) {
|
||||
@ -546,7 +547,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
||||
deviceUpdateWrapper.eq("id", device.getId())
|
||||
.set("binding_status", BindingStatusEnum.BOUND.getCode())
|
||||
.set("binding_user_id", userId);
|
||||
.set("binding_user_id", userId)
|
||||
.set("binding_time", new Date());
|
||||
return baseMapper.update(null, deviceUpdateWrapper);
|
||||
} else {
|
||||
throw new RuntimeException("通讯方式错误");
|
||||
@ -565,7 +567,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
||||
deviceUpdateWrapper.eq("id", device.getId())
|
||||
.set("binding_status", BindingStatusEnum.UNBOUND.getCode())
|
||||
.set("binding_user_id", null);
|
||||
.set("binding_user_id", null)
|
||||
.set("binding_time", null);
|
||||
return baseMapper.update(null, deviceUpdateWrapper);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user