From bac19f583c60f86fd15a13230ea70bfc3a6645b1 Mon Sep 17 00:00:00 2001
From: chenghong <24211317@qq.com>
Date: 星期一, 14 八月 2023 11:44:41 +0800
Subject: [PATCH] 解决两个国标平台相互级联时,上级不能获取目录的问题

---
 src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java |  138 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 125 insertions(+), 13 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 7d3eec5..07e559c 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,32 +1,144 @@
 package com.genersoft.iot.vmp.gb28181.bean;
 
-import lombok.Data;
+
+import com.genersoft.iot.vmp.utils.DateUtil;
+import io.swagger.v3.oas.annotations.media.Schema;
+import org.jetbrains.annotations.NotNull;
+
+import java.time.Instant;
+import java.time.temporal.TemporalAccessor;
 
 /**
- * @Description:璁惧褰曞儚bean 
+ * @description:璁惧褰曞儚bean 
  * @author: swwheihei
  * @date:   2020骞�5鏈�8鏃� 涓嬪崍2:06:54     
  */
+@Schema(description = "璁惧褰曞儚璇︽儏")
+public class RecordItem  implements Comparable<RecordItem>{
 
-@Data
-public class RecordItem {
-
+	@Schema(description = "璁惧缂栧彿")
 	private String deviceId;
-	
+
+	@Schema(description = "鍚嶇О")
 	private String name;
-	
+
+	@Schema(description = "鏂囦欢璺緞鍚� (鍙��)")
 	private String filePath;
-	
+
+	@Schema(description = "褰曞儚鏂囦欢澶у皬,鍗曚綅:Byte(鍙��)")
+	private String fileSize;
+
+	@Schema(description = "褰曞儚鍦板潃(鍙��)")
 	private String address;
-	
+
+	@Schema(description = "褰曞儚寮�濮嬫椂闂�(鍙��)")
 	private String startTime;
-	
+
+	@Schema(description = "褰曞儚缁撴潫鏃堕棿(鍙��)")
 	private String endTime;
-	
+
+	@Schema(description = "淇濆瘑灞炴��(蹇呴��)缂虹渷涓�0;0:涓嶆秹瀵�,1:娑夊瘑")
 	private int secrecy;
-	
+
+	@Schema(description = "褰曞儚浜х敓绫诲瀷(鍙��)time鎴朼larm 鎴� manua")
 	private String type;
-	
+
+	@Schema(description = "褰曞儚瑙﹀彂鑰匢D(鍙��)")
 	private String recorderId;
 
+	public String getDeviceId() {
+		return deviceId;
+	}
+
+	public void setDeviceId(String deviceId) {
+		this.deviceId = deviceId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getFilePath() {
+		return filePath;
+	}
+
+	public void setFilePath(String filePath) {
+		this.filePath = filePath;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+	public String getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+
+	public String getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+
+	public int getSecrecy() {
+		return secrecy;
+	}
+
+	public void setSecrecy(int secrecy) {
+		this.secrecy = secrecy;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getRecorderId() {
+		return recorderId;
+	}
+
+	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) {
+		TemporalAccessor startTimeNow = DateUtil.formatter.parse(startTime);
+		TemporalAccessor startTimeParam = DateUtil.formatter.parse(recordItem.getStartTime());
+		Instant startTimeParamInstant = Instant.from(startTimeParam);
+		Instant startTimeNowInstant = Instant.from(startTimeNow);
+		if (startTimeNowInstant.equals(startTimeParamInstant)) {
+			return 0;
+		}else if (Instant.from(startTimeParam).isAfter(Instant.from(startTimeNow)) ) {
+			return -1;
+		}else {
+			return 1;
+		}
+
+	}
 }

--
Gitblit v1.8.0