Merge branch 'main' into prod

This commit is contained in:
2025-07-21 08:40:34 +08:00
7 changed files with 36 additions and 7 deletions

View File

@ -95,7 +95,10 @@ public class AppDeviceShareService {
return code.equals(smsCode); return code.equals(smsCode);
} }
public int deviceShare(AppDeviceShareBo bo) { public int deviceShare(AppDeviceShareBo bo) {
validateSmsCode(AppLoginHelper.getTenantId(), bo.getPhonenumber(), bo.getSmsCode()); boolean flag = validateSmsCode(AppLoginHelper.getTenantId(), bo.getPhonenumber(), bo.getSmsCode());
if(!flag){
throw new ServiceException("验证码错误");
}
Device device = deviceMapper.selectById(bo.getDeviceId()); Device device = deviceMapper.selectById(bo.getDeviceId());
if(device==null){ if(device==null){

View File

@ -121,6 +121,9 @@ public class Device extends TenantEntity {
private Long bindingUserId; private Long bindingUserId;
/**
* 绑定时间
*/
private Date bindingTime; private Date bindingTime;
private String sendMsg; private String sendMsg;

View File

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

View File

@ -85,6 +85,14 @@ public interface DeviceService extends IService<Device> {
*/ */
void unbindDevice(DeviceForm deviceForm); void unbindDevice(DeviceForm deviceForm);
/**
* WEB端查看APP客户设备绑定
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery); TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery);
int bindDevice(AppDeviceBo bo); 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 @Override
public TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery) { public TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery) {
if (bo.getBindingUserId() == null) { 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>() List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>()
.eq("device_type", deviceTypeGrant.getDeviceTypeId())); .eq("device_type", deviceTypeGrant.getDeviceTypeId()));
if (CollectionUtil.isNotEmpty(devices)) { if (CollectionUtil.isNotEmpty(devices)) {
throw new RuntimeException("该设备类型已绑定设备,无法删除"); throw new RuntimeException("该设备类型已绑定设备,无法删除");
} }
deviceTypeId.add(deviceTypeGrant.getDeviceTypeId()); deviceTypeId.add(deviceTypeGrant.getDeviceTypeId());
} }

View File

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