mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 09:55:16 +08:00
修改绑定设备时返回设备id
This commit is contained in:
parent
a1b3d69ff1
commit
351ce4526b
@ -70,7 +70,7 @@ public class EqDeviceController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/bindDevice")
|
@GetMapping("/bindDevice")
|
||||||
public R<Boolean> bindDevice(EqAppHomeBo bo){
|
public R<Long> bindDevice(EqAppHomeBo bo){
|
||||||
String equipmentCode = bo.getEquipmentCode();
|
String equipmentCode = bo.getEquipmentCode();
|
||||||
if (equipmentCode == null) throw new ServiceException("设备编码不能为空");
|
if (equipmentCode == null) throw new ServiceException("设备编码不能为空");
|
||||||
if (bo.getUserId() == null) throw new ServiceException("用户ID不能为空");//分享用户要使用家庭主体的用户id
|
if (bo.getUserId() == null) throw new ServiceException("用户ID不能为空");//分享用户要使用家庭主体的用户id
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class EqShowUserEquipmentController extends BaseController {
|
|||||||
String equipmentCode = bo.getEquipmentCode();
|
String equipmentCode = bo.getEquipmentCode();
|
||||||
if (equipmentCode == null) throw new ServiceException("设备编码不能为空");
|
if (equipmentCode == null) throw new ServiceException("设备编码不能为空");
|
||||||
if (bo.getUserId() == null) throw new ServiceException("用户ID不能为空");//分享用户要使用家庭主体的用户id
|
if (bo.getUserId() == null) throw new ServiceException("用户ID不能为空");//分享用户要使用家庭主体的用户id
|
||||||
return R.ok(eqEquipmentService.bindDevice(bo));
|
return R.ok(eqEquipmentService.bindDevice(bo) != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -80,10 +80,11 @@ public interface IEqEquipmentService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定设备
|
* 绑定设备
|
||||||
|
*
|
||||||
* @param bo
|
* @param bo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean bindDevice(EqAppHomeBo bo);
|
Long bindDevice(EqAppHomeBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量更新
|
* 批量更新
|
||||||
|
|||||||
@ -302,7 +302,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean bindDevice(EqAppHomeBo bo) {
|
public Long bindDevice(EqAppHomeBo bo) {
|
||||||
|
|
||||||
String equipmentCode = bo.getEquipmentCode(); //这里的设备编码改成了设备mac地址
|
String equipmentCode = bo.getEquipmentCode(); //这里的设备编码改成了设备mac地址
|
||||||
//通过设备mac地址查询设备编码
|
//通过设备mac地址查询设备编码
|
||||||
@ -363,7 +363,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
|||||||
}else{
|
}else{
|
||||||
baseMapper.insert(add);
|
baseMapper.insert(add);
|
||||||
}
|
}
|
||||||
return true;
|
return add.getEquipmentId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user