From 3cd1378d39ed026ed05a1008c3bc92d39162d60b Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 12 五月 2022 10:24:08 +0800
Subject: [PATCH] 修复新设备注册

---
 src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java
index 20605b1..3349cdc 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java
@@ -1,19 +1,27 @@
 package com.genersoft.iot.vmp.gb28181.bean;
 
 
+import com.genersoft.iot.vmp.utils.DateUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.text.ParseException;
+import java.util.Date;
+
 /**
- * @Description:璁惧褰曞儚bean 
+ * @description:璁惧褰曞儚bean 
  * @author: swwheihei
  * @date:   2020骞�5鏈�8鏃� 涓嬪崍2:06:54     
  */
-public class RecordItem {
+public class RecordItem  implements Comparable<RecordItem>{
 
 	private String deviceId;
 	
 	private String name;
 	
 	private String filePath;
-	
+
+	private String fileSize;
+
 	private String address;
 	
 	private String startTime;
@@ -97,4 +105,28 @@
 	public void setRecorderId(String recorderId) {
 		this.recorderId = recorderId;
 	}
+
+	public String getFileSize() {
+		return fileSize;
+	}
+
+	public void setFileSize(String fileSize) {
+		this.fileSize = fileSize;
+	}
+
+	@Override
+	public int compareTo(@NotNull RecordItem recordItem) {
+		try {
+			Date startTime_now = DateUtil.format.parse(startTime);
+			Date startTime_param = DateUtil.format.parse(recordItem.getStartTime());
+			if (startTime_param.compareTo(startTime_now) > 0) {
+				return -1;
+			}else {
+				return 1;
+			}
+		} catch (ParseException e) {
+			e.printStackTrace();
+		}
+		return 0;
+	}
 }

--
Gitblit v1.8.0