package com.ruoyi.common.enums;
|
|
|
public enum RawMaterialCheckResult implements BaseEnum<Integer>{
|
RawMaterialCheckResultUnqualified(0, "不合格"),
|
RawMaterialCheckResultQualified(1, "合格");
|
|
private final Integer value;
|
private final String label;
|
|
RawMaterialCheckResult(Integer value, String label) {
|
this.value = value;
|
this.label = label;
|
}
|
|
public Integer getCode() {
|
return value;
|
}
|
|
public String getValue() {
|
return label;
|
}
|
|
/**
|
* 根据值获取对应的枚举
|
*/
|
public static RawMaterialCheckResult fromValue(Integer value) {
|
for (RawMaterialCheckResult type : values()) {
|
if (type.getValue().equals(value)) {
|
return type;
|
}
|
}
|
throw new IllegalArgumentException("未知的 RawMaterialCheckResult 值: " + value);
|
}
|
}
|