diff --git a/psdc-business/src/main/java/com/psdc/service/impl/PsdcDeviceServiceImpl.java b/psdc-business/src/main/java/com/psdc/service/impl/PsdcDeviceServiceImpl.java index 578e56b..18503f4 100644 --- a/psdc-business/src/main/java/com/psdc/service/impl/PsdcDeviceServiceImpl.java +++ b/psdc-business/src/main/java/com/psdc/service/impl/PsdcDeviceServiceImpl.java @@ -302,7 +302,7 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { // TODO 发送MQTT指令 // psdcControlLogMapper.insert(new PsdcControlLog(deviceId,psdcDevice.getDeviceName(),psdcDevice.getDeviceSn(),controlContext,controlValue,controlMethod,2,"控制成功",controlBy)); // psdcControlLogMapper.insert(new PsdcControlLog(deviceId,psdcDevice.getDeviceName(),psdcDevice.getDeviceSn(),controlContext,controlValue,controlMethod,3,"等待终端响应超时",controlBy)); - //发送成功 + // 发送成功 psdcControlLogMapper.insert(new PsdcControlLog(deviceId, psdcDevice.getDeviceName(), psdcDevice.getDeviceSn(), controlContext, controlValue, controlMethod, 2, "控制成功", controlBy)); atomicInteger.incrementAndGet(); @@ -336,10 +336,10 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService { } - //TODO 发送MQTT指令 + // 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)); - //发送成功 + // 发送成功 return psdcControlLogMapper.insert(new PsdcControlLog(deviceId, psdcDevice.getDeviceName(), psdcDevice.getDeviceSn(), controlContext, value, controlMethod, 2, "控制成功", controlBy)); diff --git a/psdc-business/src/main/java/com/psdc/service/impl/PsdcSceneServiceImpl.java b/psdc-business/src/main/java/com/psdc/service/impl/PsdcSceneServiceImpl.java index b1ca67a..9df5103 100644 --- a/psdc-business/src/main/java/com/psdc/service/impl/PsdcSceneServiceImpl.java +++ b/psdc-business/src/main/java/com/psdc/service/impl/PsdcSceneServiceImpl.java @@ -199,7 +199,9 @@ public class PsdcSceneServiceImpl implements IPsdcSceneService { DeviceVo deviceVo = new DeviceVo(); for (int i = 0; i < listByCode.size(); i++) { SceneVo sv = listByCode.get(i); + // System.out.println("序号 = " + i + ", 元素" + sv + "\n"); if (deviceId == sv.getDeviceId()) { + // System.out.println("上行: " + i + "\n"); deviceVo.setDeviceId(sv.getDeviceId()); deviceVo.setDeviceName(sv.getDeviceName()); deviceVo.setDeviceSn(sv.getDeviceSn()); @@ -214,10 +216,12 @@ public class PsdcSceneServiceImpl implements IPsdcSceneService { deviceVo.setTemp(sv.getSceneValue()); break; } - if (1 == listByCode.size()){ + if (1 == listByCode.size() || i == listByCode.size() - 1){ ary.add(deviceVo); } + } else { + // System.out.println("下发: " + i + "\n"); ary.add(deviceVo); deviceId = sv.getDeviceId(); deviceVo = new DeviceVo(); @@ -248,9 +252,11 @@ public class PsdcSceneServiceImpl implements IPsdcSceneService { } } } + // System.out.println("终端元素 = " + ary + "\n"); } psr.setDeviceVos(ary); } + // System.out.println("集合:" + sceneRes + "\n"); return sceneRes; }