|
|
@@ -446,7 +446,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
updateChannelInfo(subDeviceInfo, channelInfo, hostInfo);
|
|
|
updateChnnelList.add(channelInfo);
|
|
|
}
|
|
|
- // updateCache(channelInfo, 2);
|
|
|
+ // updateCache(channelInfo, 2);
|
|
|
}
|
|
|
updateDeviceSyncStatus(hostInfo.getId(), DeviceSyncStatus.SYNC_SUCCESS);
|
|
|
batchDealIotDeviceInfo(Lists.newLinkedList(), addChnnelList, true);
|
|
|
@@ -1010,12 +1010,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
RedisDelayedQueueUtil.addDelayQueue(deviceInfo.getId(), time, RedisDelayQueueEnum.DEVICE_SYNC_STATUS_MONITOR.getCode());
|
|
|
}
|
|
|
|
|
|
- private JSONObject getDvsJson(IotDeviceInfo deviceInfo) {
|
|
|
- final IotDeviceInfoExtend extend = iIotDeviceInfoExtendService.selectByDeviceId(deviceInfo.getId());
|
|
|
- return deviceInfoToJSB(deviceInfo, extend);
|
|
|
- }
|
|
|
-
|
|
|
- private JSONObject deviceInfoToJSB(IotDeviceInfo iotDeviceInfo, IotDeviceInfoExtend extend) {
|
|
|
+ private JSONObject getDvsJson(IotDeviceInfo iotDeviceInfo) {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("deviceId", iotDeviceInfo.getId());
|
|
|
jsonObject.put("deviceType", BaseDeviceTypeEnum.Dvs.name());
|
|
|
@@ -1026,7 +1021,17 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
jsonObject.put("deviceCode", iotDeviceInfo.getDeviceCode());
|
|
|
jsonObject.put("deviceName", iotDeviceInfo.getDeviceName());
|
|
|
jsonObject.put("enable", iotDeviceInfo.getEnable());
|
|
|
+ final IotDeviceInfoExtend extend = iIotDeviceInfoExtendService.selectByDeviceId(iotDeviceInfo.getId());
|
|
|
jsonObject.put("extend", extend);
|
|
|
+ List<IotDeviceInfo> childrenInfos = baseMapper.selectChannelList(iotDeviceInfo.getIotToken(), iotDeviceInfo.getDeviceCode());
|
|
|
+ List<JSONObject> list = childrenInfos.stream().map(r -> {
|
|
|
+ final JSONObject object = new JSONObject();
|
|
|
+ object.put("channelName", r.getDeviceName());
|
|
|
+ object.put("channelCode", r.getDeviceCode());
|
|
|
+ object.put("enable", r.getEnable());
|
|
|
+ return object;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ jsonObject.put("channelList", list);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|