From fe7ddbb5c351d973b83cd6350bd2837a000d3d4a Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 19 十一月 2021 18:08:49 +0800 Subject: [PATCH] 修复DOCKERFILE --- src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 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..39f894c 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,12 +1,18 @@ package com.genersoft.iot.vmp.gb28181.bean; +import org.jetbrains.annotations.NotNull; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +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; @@ -97,4 +103,21 @@ public void setRecorderId(String recorderId) { this.recorderId = recorderId; } + + @Override + public int compareTo(@NotNull RecordItem recordItem) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + Date startTime_now = sdf.parse(startTime); + Date startTime_param = sdf.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