From dd4e0d0d9c75b5216b08644bfe1333a79f794b58 Mon Sep 17 00:00:00 2001
From: hexq <hexiaoqu@visioninsight.com>
Date: 星期六, 20 一月 2024 10:22:34 +0800
Subject: [PATCH] BUGFIX:向下级目录关联通道时,出现“未查询到目录xxx的信息"

---
 src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java
index 617d9f2..e5f9fe4 100755
--- a/src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java
+++ b/src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java
@@ -139,4 +139,13 @@
         Instant beforeInstant = Instant.from(formatter.parse(keepaliveTime));
         return ChronoUnit.MILLIS.between(beforeInstant, Instant.now());
     }
+
+    public static long getDifference(String startTime, String endTime) {
+        if (ObjectUtils.isEmpty(startTime) || ObjectUtils.isEmpty(endTime)) {
+            return 0;
+        }
+        Instant startInstant = Instant.from(formatter.parse(startTime));
+        Instant endInstant = Instant.from(formatter.parse(endTime));
+        return ChronoUnit.MILLIS.between(endInstant, startInstant);
+    }
 }

--
Gitblit v1.8.0