-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecordDTO.java
More file actions
54 lines (43 loc) · 1.15 KB
/
Copy pathRecordDTO.java
File metadata and controls
54 lines (43 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
public class RecordDTO implements Comparable<RecordDTO> {
private Long orderid;
private Long shopid;
private Long userid;
private Date event_time;
public Long getOrderId() {
return orderid;
}
public void setOrderId(Long orderid) {
this.orderid = orderid;
}
public Long getShopId() {
return shopid;
}
public void setShopId(Long shopid) {
this.shopid = shopid;
}
public Long getUserId() {
return userid;
}
public void setUserId(Long userid) {
this.userid = userid;
}
public Date getEventTime() {
return event_time;
}
public void setEventTime(Date event_time) {
this.event_time = event_time;
}
@Override
public int compareTo(RecordDTO u) {
if (getEventTime() == null || u.getEventTime() == null) {
return 0;
}
return getEventTime().compareTo(u.getEventTime());
}
public int getHour() {
return LocalDateTime.ofInstant(event_time.toInstant(), ZoneId.systemDefault()).getHour();
}
}