liyong
9 天以前 88e384da863bb2f7324cb1e1474885df3b7cce91
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
66
67
68
69
70
package cn.iocoder.yudao.module.mes.enums.wm;
 
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * MES 库存事务类型枚举
 *
 * @author 芋道源码
 */
@Getter
@AllArgsConstructor
public enum MesWmTransactionTypeEnum implements ArrayValuable<Integer> {
 
    /**
     * 入库
     */
    IN(1, "入库", true),
    /**
     * 出库
     */
    OUT(2, "出库", false),
    /**
     * 调拨移出
     */
    MOVE_OUT(3, "调拨移出", false),
    /**
     * 调拨移入
     */
    MOVE_IN(4, "调拨移入", true),
    /**
     * 盘盈
     */
    ADJUST_IN(5, "盘盈", true),
    /**
     * 盘亏
     */
    ADJUST_OUT(6, "盘亏", false);
 
    public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesWmTransactionTypeEnum::getType).toArray(Integer[]::new);
 
    /**
     * 类型值
     */
    private final Integer type;
    /**
     * 类型名
     */
    private final String name;
    /**
     * 是否为入库方向
     */
    private final boolean inbound;
 
    public static MesWmTransactionTypeEnum valueOf(Integer type) {
        return CollUtil.findOne(CollUtil.newArrayList(values()),
                e -> ObjUtil.equal(e.getType(), type));
    }
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
}