|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | * @author: songww | 
|---|
|  |  |  | * @author: swwheihei | 
|---|
|  |  |  | * @date:   2020年5月8日 下午2:06:54 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public class RecordItem { | 
|---|
|  |  |  | public class RecordItem  implements Comparable<RecordItem>{ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String deviceId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String type; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String recordId; | 
|---|
|  |  |  | private String recorderId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getDeviceId() { | 
|---|
|  |  |  | return deviceId; | 
|---|
|  |  |  | 
|---|
|  |  |  | this.startTime = startTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getEndTime() { | 
|---|
|  |  |  | return endTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setEndTime(String endTime) { | 
|---|
|  |  |  | this.endTime = endTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public int getSecrecy() { | 
|---|
|  |  |  | return secrecy; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | this.type = type; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getRecordId() { | 
|---|
|  |  |  | return recordId; | 
|---|
|  |  |  | public String getRecorderId() { | 
|---|
|  |  |  | return recorderId; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setRecordId(String recordId) { | 
|---|
|  |  |  | this.recordId = recordId; | 
|---|
|  |  |  | public void setRecorderId(String recorderId) { | 
|---|
|  |  |  | this.recorderId = recorderId; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getEndTime() { | 
|---|
|  |  |  | return endTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setEndTime(String endTime) { | 
|---|
|  |  |  | this.endTime = endTime; | 
|---|
|  |  |  | @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; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|