|
|
|
@ -49,19 +49,14 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据用户id查询设备列表 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
* @return 设备列表 |
|
|
|
|
======= |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
>>>>>>> e7257650302fdf30d685bfae8df3cc0405bb51f6 |
|
|
|
|
*/ |
|
|
|
|
public List<PsdcDevice> queryByUserId() { |
|
|
|
|
return psdcDeviceMapper.queryByUserId(SecurityUtils.getUserId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<DeviceStatusVo> queryDeviceStatus() { |
|
|
|
|
List<PsdcDevice> psdcDevices = psdcDeviceMapper.queryByUserId(SecurityUtils.getUserId()); |
|
|
|
|
List<PsdcDevice> psdcDevices = psdcDeviceMapper.controlQueryByUserId(SecurityUtils.getUserId()); |
|
|
|
|
return psdcDevices.stream().map(psdcDevice -> { |
|
|
|
|
DeviceStatusVo deviceStatusVo = new DeviceStatusVo(); |
|
|
|
|
BeanUtils.copyProperties(psdcDevice, deviceStatusVo); |
|
|
|
@ -159,16 +154,9 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 控制设备启动停止 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
* @param deviceId 主键 |
|
|
|
|
* @param runStatus 状态 |
|
|
|
|
* @return 条数 |
|
|
|
|
======= |
|
|
|
|
* |
|
|
|
|
* @param deviceId |
|
|
|
|
* @param runStatus |
|
|
|
|
* @return |
|
|
|
|
>>>>>>> e7257650302fdf30d685bfae8df3cc0405bb51f6 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public int controlDeviceStartAndStop(Integer deviceId, Integer runStatus, String controlBy, Integer controlMethod) { |
|
|
|
@ -187,6 +175,7 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { |
|
|
|
|
psdcControlLogMapper.insert(new PsdcControlLog(deviceId, null, null, "设备启停", value, controlMethod, 3, "未找到该设备", controlBy)); |
|
|
|
|
throw new ControlException("控制失败,未找到该设备"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO 发送MQTT指令
|
|
|
|
|
// psdcControlLogMapper.insert(new PsdcControlLog(deviceId,psdcDevice.getDeviceName(),psdcDevice.getDeviceSn(),"设备启停",value,controlMethod,3,"手动控制,等待终端响应超时",controlBy));
|
|
|
|
|