9 小时以前 3ce57820e618b704ce61487b7cdb38fdd6b0f44a
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
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 出货检验单检测结果枚举(OQC 专用)
 *
 * <p>与 IQC/IPQC/RQC 共用的 {@link MesQcCheckResultEnum} 不同,出货检验按产品等级判定,
 * 字典 {@link cn.iocoder.yudao.module.mes.enums.DictTypeConstants#MES_OQC_CHECK_RESULT}</p>
 */
@Getter
@AllArgsConstructor
public enum MesQcOqcCheckResultEnum implements ArrayValuable<Integer> {
 
    TYPE_1(1, "1型"),
    TYPE_2(2, "2型"),
    SCRAP(3, "废品");
 
    public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesQcOqcCheckResultEnum::getType).toArray(Integer[]::new);
 
    /**
     * 结果值
     */
    private final Integer type;
    /**
     * 结果名
     */
    private final String name;
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
    /**
     * 判断是否可以放行发货
     *
     * <p>1 型、2 型均为可发货等级,仅废品不放行</p>
     *
     * @param type 检测结果
     * @return true 可以放行
     */
    public static boolean canShip(Integer type) {
        return type != null && !SCRAP.getType().equals(type);
    }
 
}