32 lines
617 B
Plaintext
32 lines
617 B
Plaintext
package com.cmeim.template.enums;
|
|
|
|
import lombok.Getter;
|
|
|
|
public enum BaBomType {
|
|
|
|
FIN(1, "成品"),
|
|
HALF(2, "半成品"),
|
|
RAW(3, "原材料"),
|
|
;
|
|
|
|
@Getter
|
|
private int value;
|
|
@Getter
|
|
private String text;
|
|
|
|
private BaBomType(int value, String text) {
|
|
this.value = value;
|
|
this.text = text;
|
|
}
|
|
|
|
public static int getTypeValue(String text) {
|
|
BaBomType[] items = BaBomType.values();
|
|
for(BaBomType item : items) {
|
|
if(item.getText().equals(text)) {
|
|
return item.getValue();
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
}
|