package com.xunmei.common.core.enums;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.xunmei.common.core.json.EnumSerializer;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author jingyuanchao
 * @date 2022/10/17 15:58
 */

@Getter
@NoArgsConstructor
@AllArgsConstructor
@JsonSerialize(using = EnumSerializer.class)
public enum ExportPdfType {
    SECURITY_PERFORMANCE(0, "安保履职登记簿"),
    EDUCATION_TRAINING(1, "教育培训登记簿"),
    SAFETY_DRILL(2, "预案演练登记簿"),
    SAFETY_CHECK_REPORT(3, "网点安全保卫履职每日"),
    SAFETY_EDUCATION_REPORT(4, "网点安全保卫履职每月"),
    PLAN_DRILL_REPORT(5, "网点安全保卫履职每季"),
    INTELLIGENT_OPERATION_REPORT(6, "网点设备状态监测"),
    DAY_OF_JKRESUMTPION(7, "金库安全保卫履职每日"),
    QUARTER_OF_JKREUMPTION(8, "金库安全保卫履职每季"),
    WEEK_OF_YJZXREUMPTION(9, "一级支行部门履职每周"),
    MONTH_OF_YJZXREUMPTION(10, "一级支行部门履职每月"),
    QUARTER_OF_YJZXREUMPTION(11, "一级支行部门履职每季"),
    QUARTER_OF_YJZXFGHZREUMPTION(12, "一级支行分管行长季度"),
    HALFYEAR_OF_YJZXFGHZREUMPTION(13, "一级支行分管行长半年"),
    HALFYEAR_OF_YJZXREUMPTION(14, "一级支行部门履职半年"),
    YEAR_OF_YJZXREUMPTION(15, "一级支行部门履职每年"),
    WEEK_OF_JKREUMPTION(16, "金库安全保卫履职每周"),
    MONTH_OF_JKREUMPTION(17, "金库安全保卫履职每月"),
    YEAR_OF_JKREUMPTION(18, "金库安全保卫履职每年"),
    WEEK_OF_WDREUMPTION(19, "网点安全保卫履职每周"),
    YEAE_OF_WDREUMPTION(20, "网点安全保卫履职每年"),
    DAY_OF_WDPROTECTION_DATA(21, "营业网点布防情况统计每日"),
    DAY_OF_JKPROTECTION_DATA(22, "金库布防情况统计每日"),
    VISIT_RECORD(23, "来访管理登记簿"),
    JK_OPERATION_REPORT(24, "金库设备状态监测"),
    DEVICE_STATISTICS_NUM(25, "营业网点安防消防设备器材统计"),

    SAFE_CHECK_REPORT(26, "安全检查登记簿"),


    ;


    /**
     * 所有枚举
     */
    private static final Map<Integer, ExportPdfType> enumMap = new LinkedHashMap<>();

    static {
        for (ExportPdfType typeEnum : ExportPdfType.values()) {
            enumMap.put(typeEnum.num, typeEnum);
        }
    }

    private int num;
    private String text;

    /**
     * 根据code获取name
     */
    public static String getName(Integer num) {
        ExportPdfType e = enumMap.get(num);
        return e != null ? e.getText() : "";
    }

    /**
     * 根据code获取name
     */
    public static ExportPdfType getEnums(Integer num) {
        return enumMap.get(num);
    }

}
