云
10 小时以前 02a1ae81eba7b48223052fb833859f0a65dd7d21
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
65
package cn.iocoder.yudao.module.mes.enums.pro;
 
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * MES 袋码批量生成任务状态枚举
 */
@Getter
@AllArgsConstructor
public enum MesProBagCodeGenerateTaskStatusEnum implements ArrayValuable<Integer> {
 
    /**
     * 已创建待执行(受并发闸门限制时短暂停留该状态)
     */
    PENDING(10, "排队中"),
    /**
     * 生成中
     */
    RUNNING(20, "生成中"),
    /**
     * 已收到取消请求,正在停止并清理已生成数据
     */
    CANCELING(25, "取消中"),
    /**
     * 全部数据生成完成
     */
    FINISHED(30, "已完成"),
    /**
     * 用户取消,部分数据已清理
     */
    CANCELED(40, "已取消"),
    /**
     * 异常终止,部分数据已清理
     */
    FAILED(50, "已失败");
 
    public static final Integer[] ARRAYS = Arrays.stream(values())
            .map(MesProBagCodeGenerateTaskStatusEnum::getStatus).toArray(Integer[]::new);
 
    /**
     * 状态
     */
    private final Integer status;
    /**
     * 状态名称
     */
    private final String name;
 
    /**
     * 是否为终态(不再变化)
     */
    public boolean isFinal() {
        return this == FINISHED || this == CANCELED || this == FAILED;
    }
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
}