| | |
| | | /** |
| | | * 点位在线检测 |
| | | */ |
| | | //TODO:视频离线次数、监测次数(修改逻辑只针对工单,检测在线的) |
| | | public void pointOnline() throws ExecutionException, InterruptedException { |
| | | log.info("开始检测点位在线"); |
| | | Integer times = 2; |
| | |
| | | OnlineCheckThread thread = new OnlineCheckThread(monitor, checkPointUtil, time); |
| | | return thread.call(); // 假设 OnlineCheckThread 实现了 Callable 接口 |
| | | }, executorService) |
| | | .orTimeout(30, TimeUnit.SECONDS) |
| | | .orTimeout(40, TimeUnit.SECONDS) |
| | | .exceptionally(ex -> { |
| | | if (ex instanceof TimeoutException) { |
| | | log.error("任务执行超时:"); |
| | | log.error("任务执行超时:"+monitor.getIp()); |
| | | } else { |
| | | log.error("任务执行异常:" + ex); |
| | | log.error("任务执行异常:"+monitor.getIp() + ex); |
| | | } |
| | | int checkTimes = 1; |
| | | int offLineTimes = 1; |
| | |
| | | allOf.get(35, TimeUnit.SECONDS); // 给予额外的5秒来收集结果 |
| | | } catch (TimeoutException e) { |
| | | log.warn("部分任务未在指定时间内完成"); |
| | | } catch (Exception e2){ |
| | | log.error("数据收集异常"+e2); |
| | | } |
| | | |
| | | dataList = futureList.stream() |
| | |
| | | log.info("点位在线监测完成"); |
| | | } |
| | | |
| | | //(弃用)点位在线率 |
| | | //点位在线率(优云) |
| | | public void videoOnlineTask() { |
| | | //视频图像质量 |
| | | log.info("开始执行点位在线数据同步"); |
| | |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, VideoOnlineResult.class); |
| | | //打标签 |
| | | pointService.setDeviceTagByGB(records); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(records); |
| | | // 工单生成 |
| | |
| | | item.setNo(item.getDeviceId()); |
| | | } |
| | | }); |
| | | //打标签 |
| | | pointService.setDeviceTagByGB(records); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(records); |