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);
|
}
|
|
}
|