| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | |
| | | private YwPointMapper ywPointMapper; |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Value("${DH.userName}") |
| | | public String userName; |
| | | @Value("${DH.password}") |
| | | public String password; |
| | | //同步点位在线率到mongo(弃用) |
| | | // public void siteOnline() { |
| | | // log.info("开始同步点位在线率到mongo"); |
| | |
| | | monitorList.add(monitor); |
| | | ywPointList.add(point); |
| | | } |
| | | |
| | | //添加老数据 |
| | | 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)) { |
| | |
| | | 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()); |
| | |
| | | ywPoint.setCreateTime(new Date()); |
| | | ywPoint.setUpdateTime(new Date()); |
| | | ywPoint.setOnline(ApiConstants.UY_OnlineSite_Unknown); |
| | | ywPoint.setUsername(userName); |
| | | ywPoint.setPassword(password); |
| | | } |
| | | //状态设置为考核设备 |
| | | ywPoint.setExamineStatus(Boolean.TRUE); |