package com.yeejoin.amos.boot.module.jg.api.enums;

import lombok.Getter;

/**
 * 业务类型枚举
 *
 * @author Administrator
 */
public enum SafetyProblemTypeEnum {

    /**
     * 问题主体类型
     */
    JYCQ("2", "检验超期", "设备检验超期", "jy/cq"),

    WBCQ("1", "维保超期", "设备维保超期", "wb/cq"),

    ZZCQ("3", "资质超期", "企业资质超期", "zz/cq");

    @Getter
    private final String code;

    @Getter
    private final String name;

    @Getter
    private final String desc;

    @Getter
    private final String topic;

    SafetyProblemTypeEnum(String code, String name, String desc, String topic) {
        this.code = code;
        this.name = name;
        this.desc = desc;
        this.topic = topic;
    }

    public static String getNameByType(String code) {
        String name = null;
        for (SafetyProblemTypeEnum enumOne : SafetyProblemTypeEnum.values()) {
            if (enumOne.getCode().equals(code)) {
                name = enumOne.getName();
                break;
            }
        }
        return name;
    }

}
