mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
设置和操作添加设备不在线提示
This commit is contained in:
parent
2e71759c63
commit
13e7150f48
@ -202,6 +202,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
||||
@Override
|
||||
public String operate(EqDeviceCmdBo bo) {
|
||||
String cmd = "";
|
||||
if (checkOnline(bo.getEquipmentCode())) throw new RuntimeException("设备不在线");
|
||||
int operateType = bo.getOperateType();
|
||||
switch (operateType){
|
||||
case 1: cmd = DeviceCtlCmd.OPT_OPEN_GARAGE; break;//开门
|
||||
@ -230,6 +231,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
||||
@Override
|
||||
public String setting(EqDeviceSetBo bo) {
|
||||
String cmd = "";
|
||||
if (checkOnline(bo.getEquipmentCode())) throw new RuntimeException("设备不在线");
|
||||
int operateType = bo.getOperateType();
|
||||
switch (operateType){
|
||||
case 1: cmd = DeviceSetCmd.AutomaticDoorClosingSwitch_false; break;//自动关门功能开关 关
|
||||
@ -257,6 +259,11 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
||||
return iotService.httpCtlPostSend(bo.getEquipmentCode(),cmd);
|
||||
}
|
||||
|
||||
public boolean checkOnline(String equipmentCode){
|
||||
DeviceServerMsgDto serverMsg = iotService.httpServerGetSend(equipmentCode);
|
||||
return serverMsg.getLineStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EqEquipmentDetailVo getDeviceMsg(EqAppHomeBo bo) {
|
||||
log.info("OpenStatusText开合状态:{},{}",MessageUtils.message("openStatus.name0"),MessageUtils.message("openStatus.name1"));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user