manailin
2021-06-21 26e9429512245f4b441b55c3ce59c21a5ebb570f
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
package com.panzhihua.common.enums;
 
import lombok.Getter;
 
/**
 * desc 本地事件类型和浪潮接口对应的事件类型的对应关系
 * 本地事件类型1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报 7宣传教育
 * @author manaiilin
 */
@Getter
public enum LocalEventToLangChaoEventTypeEnum
{
    ZA(1, "6","治安隐患"),
    GG(2, "4","公共服务"),
    MD(3, "5","矛盾纠纷"),
    BWD(4, "55d8def10c1344dc853b9ccf0484c06d","不稳定因素"),
    TF(5, "1b62afbccc2a4bb98125f999b7133242","突发事件"),
    TSRQ(6, "7da14163537b4b7e9a73ae28f4a58b72","特殊人群信息上报"),
    XC(7, "9306ca7327a44b5ca474426f2da0e206","宣传教育"),
    QT(8, "55d8def10c1344dc853b9ccf0484c06d","其他");
 
    private final Integer code;
    private final String name;
    private final String eventName;
 
    LocalEventToLangChaoEventTypeEnum(Integer code, String name,String eventName)
    {
        this.code = code;
        this.name = name;
        this.eventName = eventName;
    }
    public static String getCodeByName(Integer code) {
        for (LocalEventToLangChaoEventTypeEnum item : LocalEventToLangChaoEventTypeEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getName();
            }
        }
        return BWD.getName();
    }
    public static String getEventNameByCode(Integer code) {
        for (LocalEventToLangChaoEventTypeEnum item : LocalEventToLangChaoEventTypeEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getEventName();
            }
        }
        return BWD.getEventName();
    }
}