xuhy
2 天以前 39a97f1b7585edc184ea5066600f1d9a2d2cb8cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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;
    }
}