|
|
|
|
@ -3,9 +3,11 @@ package com.zhehekeji.web.pojo;
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.Delayed;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
public class IndustrialCameraVO {
|
|
|
|
|
public class IndustrialCameraVO implements Delayed {
|
|
|
|
|
private String name;
|
|
|
|
|
private String picImg;
|
|
|
|
|
private String typeMacth;
|
|
|
|
|
@ -20,4 +22,33 @@ public class IndustrialCameraVO {
|
|
|
|
|
private int flag;
|
|
|
|
|
private String streetId;
|
|
|
|
|
private int sentCount;
|
|
|
|
|
|
|
|
|
|
private long executeTime;
|
|
|
|
|
public IndustrialCameraVO(){
|
|
|
|
|
this.executeTime = System.currentTimeMillis() + 2000;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取延迟时间
|
|
|
|
|
*
|
|
|
|
|
* @param unit 时间单位,用于转换延迟时间
|
|
|
|
|
* @return 延迟时间,以指定的时间单位表示
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public long getDelay(TimeUnit unit) {
|
|
|
|
|
// 计算延迟时间,将时间差转换为指定的时间单位
|
|
|
|
|
return unit.convert(this.executeTime - System.currentTimeMillis(), TimeUnit.MILLISECONDS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 比较两个Delayed对象的延迟时间
|
|
|
|
|
*
|
|
|
|
|
* @param o 要比较的Delayed对象
|
|
|
|
|
* @return 如果延迟时间相等,则返回0;如果当前对象的延迟时间小于参数对象的延迟时间,则返回负数;反之返回正数
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int compareTo(Delayed o) {
|
|
|
|
|
// 比较两个Delayed对象的延迟时间,以毫秒为单位
|
|
|
|
|
return (int) (this.getDelay(TimeUnit.MILLISECONDS) - o.getDelay(TimeUnit.MILLISECONDS));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|