Junjie
7 小时以前 9ed9cd2e6f619c84732ae6715699b160c404684c
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
58
59
60
61
62
63
64
package com.zy.core.move;
 
import lombok.Data;
 
import java.util.ArrayList;
import java.util.List;
 
@Data
public class StationMoveSession {
 
    public static final String STATUS_WAITING = "WAITING";
    public static final String STATUS_RUNNING = "RUNNING";
    public static final String STATUS_CANCEL_PENDING = "CANCEL_PENDING";
    public static final String STATUS_CANCELLED = "CANCELLED";
    public static final String STATUS_BLOCKED = "BLOCKED";
    public static final String STATUS_TIMEOUT = "TIMEOUT";
    public static final String STATUS_FINISHED = "FINISHED";
 
    private Integer taskNo;
 
    private Integer routeVersion;
 
    private String threadImpl;
 
    private Integer currentStationId;
 
    private StationMoveTriggerType triggerType;
 
    private StationMoveDispatchMode dispatchMode;
 
    private String status;
 
    private Integer dispatchStationId;
 
    private Integer businessTargetStationId;
 
    private Integer currentRouteTargetStationId;
 
    private Integer nextDecisionStationId;
 
    private List<Integer> fullPathStationIds = new ArrayList<>();
 
    private String pathSignature;
 
    private String cancelReason;
 
    private Long createdAt;
 
    private Long updatedAt;
 
    private Long lastIssuedAt;
 
    public boolean isActive() {
        return STATUS_WAITING.equals(status)
                || STATUS_RUNNING.equals(status)
                || STATUS_CANCEL_PENDING.equals(status);
    }
 
    public boolean containsStation(Integer stationId) {
        return stationId != null
                && fullPathStationIds != null
                && fullPathStationIds.contains(stationId);
    }
}