| | |
| | | monitorList.add(monitor); |
| | | ywPointList.add(point); |
| | | } |
| | | log.error("同步mongo新ywpoint数据{}",ywPointList); |
| | | //添加老数据 |
| | | List<String> numbers = CollectionUtils.isEmpty(monitorList) ? new ArrayList<>() : monitorList.stream().map(TMonitor::getSerialNumber).collect(Collectors.toList()); |
| | | monitorVOMap.forEach((key, value) -> { |
| | |
| | | if (osdCheckResult != null) { |
| | | monitor.setDeviceType(osdCheckResult.getDeviceBrand()); |
| | | } |
| | | |
| | | monitorList.add(monitor); |
| | | } |
| | | }); |
| | | //转换 |
| | | List<String> points = CollectionUtils.isEmpty(ywPointList) ? new ArrayList<>() : ywPointList.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); |
| | | //pointMap点位旧数据 设备码map |
| | | pointMap.forEach((key, value) -> { |
| | | //老设备状态改为不参与考核 |
| | | if (!points.contains(key)) { |
| | |
| | | ywPointList.add(value); |
| | | } |
| | | }); |
| | | |
| | | log.error("同步mongo新加旧ywpoint数据{}",ywPointList); |
| | | log.info("result集合{},设备集合{},点位集合{}", oneMachineFileResults.size(), monitorList.size(), ywPointList.size()); |
| | | //插入数据库 |
| | | if (!CollectionUtils.isEmpty(monitorList)) { |
| | |
| | | YwPoint ywPoint = new YwPoint(); |
| | | if (pointMap.containsKey(result.getSerialNumber().getValue())) { |
| | | ywPoint = pointMap.get(result.getSerialNumber().getValue()); |
| | | //更新定位名 |
| | | if (ywPoint != null) { |
| | | ywPoint.setPointName(result.getName().getValue()); |
| | | } |
| | | } else { |
| | | ywPoint.setPointName(result.getName().getValue()); |
| | | ywPoint.setStatus(PointStatus.WAIT.getDesc()); |