APP客户设备绑定-绑定时间

This commit is contained in:
2025-07-19 14:22:36 +08:00
parent 3feafc2cd9
commit a7340c744e
6 changed files with 32 additions and 6 deletions

View File

@ -121,5 +121,8 @@ public class Device extends TenantEntity {
private Long bindingUserId;
/**
* 绑定时间
*/
private Date bindingTime;
}

View File

@ -1,10 +1,12 @@
package com.fuyuanshen.equipment.domain.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class AppDeviceVo {
public class AppDeviceVo implements Serializable {
private Long id;
@ -39,7 +41,7 @@ public class AppDeviceVo {
private String typeName;
/**
* 蓝牙名称
* 蓝牙名称
*/
private String bluetoothName;
@ -49,4 +51,10 @@ public class AppDeviceVo {
* 1 正常
*/
private Integer deviceStatus;
/**
* 绑定时间
*/
private Date bindingTime;
}

View File

@ -85,6 +85,14 @@ public interface DeviceService extends IService<Device> {
*/
void unbindDevice(DeviceForm deviceForm);
/**
* WEB端查看APP客户设备绑定
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery);
int bindDevice(AppDeviceBo bo);

View File

@ -470,7 +470,13 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
}
/**
* WEB端查看APP客户设备绑定
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery) {
if (bo.getBindingUserId() == null) {

View File

@ -179,7 +179,7 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>()
.eq("device_type", deviceTypeGrant.getDeviceTypeId()));
if (CollectionUtil.isNotEmpty(devices)) {
throw new RuntimeException("该设备类型已绑定设备,无法删除");
throw new RuntimeException("该设备类型已绑定设备,无法删除");
}
deviceTypeId.add(deviceTypeGrant.getDeviceTypeId());
}

View File

@ -138,7 +138,8 @@
d.device_pic,
dt.type_name,
dt.communication_mode,
d.bluetooth_name
d.bluetooth_name,
d.binding_time
from device d
inner join device_type dt on d.device_type = dt.id
where d.binding_user_id = #{criteria.bindingUserId}