From f962534ae431779f3e341365af2e30fdd0afeb0f Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期日, 13 十月 2024 16:20:13 +0800 Subject: [PATCH] 点位在线率恢复为取优云和海康数据 --- ycl-server/src/main/java/com/ycl/task/UYTask.java | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/task/UYTask.java b/ycl-server/src/main/java/com/ycl/task/UYTask.java index 3afaece..a196083 100644 --- a/ycl-server/src/main/java/com/ycl/task/UYTask.java +++ b/ycl-server/src/main/java/com/ycl/task/UYTask.java @@ -174,6 +174,7 @@ /** * 鐐逛綅鍦ㄧ嚎妫�娴� */ + //TODO锛氳棰戠绾挎鏁般�佺洃娴嬫鏁帮紙淇敼閫昏緫鍙拡瀵瑰伐鍗曪紝妫�娴嬪湪绾跨殑锛� public void pointOnline() throws ExecutionException, InterruptedException { log.info("寮�濮嬫娴嬬偣浣嶅湪绾�"); Integer times = 2; @@ -203,16 +204,15 @@ 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; - //TODO:BUG Map<String, Object> map = (Map<String, Object>) redisTemplate.opsForHash().get(RedisConstant.ONLINE_KEY, monitor.getIp()); if (!CollectionUtils.isEmpty(map)) { checkTimes = (Integer) map.get("checkTimes") + 1; @@ -279,7 +279,7 @@ log.info("鐐逛綅鍦ㄧ嚎鐩戞祴瀹屾垚"); } - //锛堝純鐢級鐐逛綅鍦ㄧ嚎鐜� + //鐐逛綅鍦ㄧ嚎鐜囷紙浼樹簯锛� public void videoOnlineTask() { //瑙嗛鍥惧儚璐ㄩ噺 log.info("寮�濮嬫墽琛岀偣浣嶅湪绾挎暟鎹悓姝�"); @@ -301,6 +301,8 @@ 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); //瀛樻斁鍦╩ongo涓� mongoTemplate.insertAll(records); // 宸ュ崟鐢熸垚 @@ -349,6 +351,7 @@ item.setNo(item.getDeviceId()); } }); + //鎵撴爣绛� pointService.setDeviceTagByGB(records); //瀛樻斁鍦╩ongo涓� mongoTemplate.insertAll(records); -- Gitblit v1.8.0