huanghongfa
2021-07-28 098b507166a2b23f0256d5c4f097e7f05f11e9be
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.panzhihua.common.enums;
 
import lombok.Getter;
 
/**
 * 婚姻状况
 * 
 * @author huanghongfa
 */
@Getter
public enum SafeWordStatusEnum
{
    DCK(1, "待查看"),
    DCL(2, "待处理"),
    YCL(3, "已处理"),
    YZG(4, "已整改");
 
    private final Integer code;
    private final String name;
 
    SafeWordStatusEnum(Integer code, String name)
    {
        this.code = code;
        this.name = name;
    }
 
    public static int getCodeByName(String name) {
        for (SafeWordStatusEnum item : SafeWordStatusEnum.values()) {
            if (item.name.equals(name)) {
                return item.getCode();
            }
        }
        return -1;
    }
 
    public static String getCnDescByName(Integer code) {
        for (SafeWordStatusEnum item : SafeWordStatusEnum.values()) {
            if (item.code.equals(code)) {
                return item.getName();
            }
        }
        return "其他";
    }
 
}