package com.ruoyi.common.enums;
|
|
import lombok.AllArgsConstructor;
|
import lombok.Getter;
|
|
/**
|
* 1. 入户调查
|
* 2. 价格评估
|
* 3. 协议签订
|
* 固定对应表 state_process_module
|
*/
|
@Getter
|
@AllArgsConstructor
|
public enum ProcessCategoryEnum {
|
CATEGORY0(0, "错误分类"),
|
CATEGORY1(1, "入户调查"),
|
CATEGORY2(2, "价格评估"),
|
CATEGORY3(3, "协议签订"),
|
;
|
|
|
private final Integer value;
|
private final String text;
|
|
public static Integer getValue(String text) {
|
for (ProcessCategoryEnum v : ProcessCategoryEnum.values()) {
|
if (v.text.equals(text)) {
|
return v.value;
|
}
|
}
|
return 0;
|
}
|
|
public static String getValueByKey(Integer key) {
|
for (ProcessCategoryEnum v : ProcessCategoryEnum.values()) {
|
if (v.getValue().equals(key)) {
|
return v.getText();
|
}
|
}
|
return "";
|
}
|
|
public static ProcessCategoryEnum getEnumByKey(Integer key) {
|
for (ProcessCategoryEnum v : ProcessCategoryEnum.values()) {
|
if (v.getValue().equals(key)) {
|
return v;
|
}
|
}
|
return CATEGORY0;
|
}
|
}
|