| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | //优云对接数据任务 |
| | |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(dataList); |
| | | } |
| | | //工单 |
| | | //工单(同一IP只生成一个工单) |
| | | List<WorkOrder> workOrderList = dataList.stream() |
| | | .filter(item -> Objects.nonNull(item.getWorkOrder())) |
| | | .collect(Collectors.toMap( |
| | | TMonitorResult::getIp, |
| | | Function.identity(), |
| | | (existing, replacement) -> existing // 如果遇到相同的 IP,保留第一个 TMonitorResult 对象 |
| | | )) |
| | | .values() |
| | | .stream() |
| | | .map(TMonitorResult::getWorkOrder) |
| | | .collect(Collectors.toList()); |
| | | if (!CollectionUtils.isEmpty(workOrderList)) { |
| | |
| | | return vo; |
| | | }).collect(Collectors.toList()); |
| | | monitorMapper.updateOnline(willUpdateList); |
| | | //离线生成工单 |
| | | List<VideoOnlineResult> workOrders = records.stream().filter(item -> ApiConstants.UY_OnlineSite_Offline.equals(item.getStatus())).collect(Collectors.toList()); |
| | | //离线生成工单,一个ip只生成一个工单 |
| | | List<VideoOnlineResult> workOrders = (List<VideoOnlineResult>) records.stream() |
| | | .filter(item -> ApiConstants.UY_OnlineSite_Offline.equals(item.getStatus())) |
| | | .collect(Collectors.toMap( |
| | | VideoOnlineResult::getIpAddr, |
| | | Function.identity(), |
| | | (existing, replacement) -> existing // 如果遇到相同的 IP,保留第一个(existing) |
| | | )).values(); |
| | | uyErrorTypeCheckService.videoOnlineCheck(workOrders); |
| | | } else { |
| | | log.error("点位在线结果数据为空{}", data); |
| | |
| | | pointService.setDeviceTagByGB(records); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(records); |
| | | // 工单生成 |
| | | uyErrorTypeCheckService.recordMetaDSumCheck(records); |
| | | // // 工单生成 |
| | | // uyErrorTypeCheckService.recordMetaDSumCheck(records); |
| | | } |
| | | } else { |
| | | log.error("录像可用数据为空{}", jsonObject); |