6 天以前 85156554438bb13930c89072ee0b7fa93192a7fe
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
package cn.iocoder.yudao.module.mes.enums.qc;
 
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * MES 检测结果枚举
 */
@Getter
@AllArgsConstructor
public enum MesQcCheckResultEnum implements ArrayValuable<Integer> {
 
    QUALIFIED(1, "合格"),
    SPECIAL_APPROVAL(2, "特采"),
    RETURN(3, "不合格退货"),
    SCRAP(4, "不合格报废");
 
    public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesQcCheckResultEnum::getType).toArray(Integer[]::new);
 
    /**
     * 结果值
     */
    private final Integer type;
    /**
     * 结果名
     */
    private final String name;
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
    /**
     * 判断是否可以入库
     *
     * @param type 检测结果
     * @return true 可以入库
     */
    public static boolean canInbound(Integer type) {
        return QUALIFIED.getType().equals(type) || SPECIAL_APPROVAL.getType().equals(type);
    }
 
}