|
|
|
@ -154,9 +154,15 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 控制设备启动停止 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
* @param deviceId 主键 |
|
|
|
|
* @param runStatus 状态 |
|
|
|
|
* @return 条数 |
|
|
|
|
======= |
|
|
|
|
* @param deviceId |
|
|
|
|
* @param runStatus |
|
|
|
|
* @return |
|
|
|
|
>>>>>>> d15c6d60ec068ceda12ba3aa1cf4c980940216a5 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public int controlDeviceStartAndStop(Integer deviceId, Integer runStatus, String controlBy, Integer controlMethod) { |
|
|
|
@ -175,6 +181,10 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { |
|
|
|
|
psdcControlLogMapper.insert(new PsdcControlLog(deviceId, null, null, "设备启停", value, controlMethod, 3, "未找到该设备", controlBy)); |
|
|
|
|
throw new ControlException("控制失败,未找到该设备"); |
|
|
|
|
} |
|
|
|
|
if (psdcDevice.getIsControl() != 2 ){ |
|
|
|
|
throw new ControlException("该设备无法控制,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO 发送MQTT指令
|
|
|
|
|
// psdcControlLogMapper.insert(new PsdcControlLog(deviceId,psdcDevice.getDeviceName(),psdcDevice.getDeviceSn(),"设备启停",value,controlMethod,3,"手动控制,等待终端响应超时",controlBy));
|
|
|
|
@ -198,6 +208,9 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { |
|
|
|
|
psdcControlLogMapper.insert(new PsdcControlLog(deviceId, null, null, "设定温度", null, controlMethod, 3, "未找到该设备", controlBy)); |
|
|
|
|
throw new ControlException("控制失败,未找到该设备"); |
|
|
|
|
} |
|
|
|
|
if (psdcDevice.getIsControl() != 2 ){ |
|
|
|
|
throw new ControlException("该设备无法控制,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0); |
|
|
|
|
|
|
|
|
@ -243,6 +256,7 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 发送MQTT指令
|
|
|
|
|
// psdcControlLogMapper.insert(new PsdcControlLog(deviceId,psdcDevice.getDeviceName(),psdcDevice.getDeviceSn(),controlContext,value,controlMethod,2,"控制成功",controlBy));
|
|
|
|
|
// psdcControlLogMapper.insert(new PsdcControlLog(deviceId,psdcDevice.getDeviceName(),psdcDevice.getDeviceSn(),controlContext,value,controlMethod,3,"等待终端响应超时",controlBy));
|
|
|
|
|