李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
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
55
56
57
package com.chinaztt.mes.aps.core.domain;
 
import com.chinaztt.mes.aps.entity.ResourceDuration;
import lombok.Data;
 
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
 
/**
 * @Author: zhangxy
 * @Date: 2020-10-19 19:41
 */
@Data
public class ResourceBo extends AbstractTaskOrResource {
 
    private Long id;
 
    private String name;
 
    private String no;
 
    private Set<Long> capabilityIds;
 
    private List<ResourceDuration> durations;
 
    private Set<Long> children;
 
    private LocalDateTime maxEndTime;
 
    @Override
    public LocalDateTime getPlanEndTime() {
        if (maxEndTime == null || maxEndTime.compareTo(LocalDateTime.now()) < 0) {
            return LocalDateTime.now();
        }
        return maxEndTime;
    }
 
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
 
        ResourceBo that = (ResourceBo) o;
 
        return id.equals(that.id);
    }
 
    @Override
    public int hashCode() {
        return id.hashCode();
    }
}