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 可以入库。当前质检字典将 2 用作不通过,不能按旧“特采”含义放行。
|
*/
|
public static boolean canInbound(Integer type) {
|
return QUALIFIED.getType().equals(type);
|
}
|
|
}
|