gaoluyang
9 天以前 7bd10d34e8a8dc2437ec8551eb511e37634d7306
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
package cn.iocoder.yudao.module.mes.enums.wm;
 
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * MES 仓库类型枚举
 *
 * 需求 5.1①:支持产成品库、原辅料库、残次品库等多类型仓库
 */
@Getter
@AllArgsConstructor
public enum MesWmWarehouseTypeEnum implements ArrayValuable<Integer> {
 
    /**
     * 产成品库
     */
    FINISHED(1, "产成品库"),
    /**
     * 原辅料库
     */
    MATERIAL(2, "原辅料库"),
    /**
     * 残次品库
     */
    DEFECTIVE(3, "残次品库"),
    /**
     * 半成品库
     */
    SEMI_FINISHED(4, "半成品库"),
    /**
     * 通用库
     */
    GENERAL(5, "通用库"),
    /**
     * 线边库
     */
    LINE_SIDE(6, "线边库");
 
    public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesWmWarehouseTypeEnum::getType).toArray(Integer[]::new);
 
    /**
     * 类型值
     */
    private final Integer type;
    /**
     * 类型名
     */
    private final String name;
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
    public static MesWmWarehouseTypeEnum valueOf(Integer type) {
        return Arrays.stream(values()).filter(e -> e.getType().equals(type)).findFirst().orElse(null);
    }
 
}