Commit e4d2bc68 by huangjy

feat:设备同步问题

parent c5e9c399
......@@ -147,8 +147,9 @@ public class IotOrgService extends IotCommonService{
List<DeviceInstanceEntity> deviceInstanceEntityList = JSONArray.parseArray(pagerResult.getData().toString()).toJavaList(DeviceInstanceEntity.class);
return deviceInstanceEntityList;
} else {
throw new RuntimeException("获取设备接口失败:{},responseMessage.getMessage()");
}
log.error("获取设备接口失败:{}",responseMessage.getMessage());
} catch (IOException e) {
log.error("调用:{}接口异常:{}",url,e.getMessage());
}
......
......@@ -412,7 +412,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
.eq(statusFlag, PlatOrg::getStatus, param.getStatus())
.eq(PlatOrg::getStatus, CommonEnum.YES.getValue())
);
if (typeFlag || nameFlag || statusFlag) {
if (typeFlag || nameFlag) {
Map<String, List<PlatOrg>> parentIdMap = orgList.stream().collect(Collectors.groupingBy(PlatOrg::getParentId));
orgList.forEach(vo -> {
List<PlatOrg> childList = parentIdMap.get(vo.getId());
......
......@@ -600,6 +600,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
}
//查询iot设备
List<DeviceInstanceEntity> iotDeviceList = iotOrgService.getOrgDevice(iotOrgId);
if (CollectionUtils.isEmpty(iotDeviceList)) {
continue;
}
//查询平台设备
Set<String> iotDeviceIdSet = iotDeviceList.stream().map(DeviceInstanceEntity::getId).collect(Collectors.toSet());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment