yanghb
2024-12-17 1287337fd0b0c156ec79712f9a600ebeffefe3a6
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
package com.zzg.common.enums;
 
public enum CompensateTypeEnum {
    HOUSE_ACQUISITION_COMPENSATION_FEE(1, "征收房屋补偿费"),
    POLICY_COMPENSATION_FEE(2, "政策性补偿费"),
    POLICY_SUBSIDY_FEE(3, "政策性补助费"),
    POLICY_ALLOWANCE(4, "政策性补贴"),
    EARLY_RELOCATION_REWARD(5, "提前搬迁奖励");
 
    private final int code;
    private final String description;
 
    CompensateTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }
    public static int getCode(String description) {
        for (CompensateTypeEnum type : CompensateTypeEnum.values()) {
            if (type.getDescription().equalsIgnoreCase(description)) {
                return type.getCode();
            }
        }
       return 0;
    }
    public static String getDescription(Integer key) {
        for (CompensateTypeEnum v : CompensateTypeEnum.values()) {
            if (key.equals(v.getCode())) {
                return v.getDescription();
            }
        }
        return "";
    }
    public int getCode() {
        return code;
    }
 
    public String getDescription() {
        return description;
    }
 
    @Override
    public String toString() {
        return this.description;
    }
}