package com.ningdatech.carapi.company.enumeration;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 企业安全主体责任-通报文件类型
 * @return
 * @author CMM
 * @since 2023/05/17 14:42
 */
@Getter
@AllArgsConstructor
public enum SecurityProductRegulationFileType {

    ALL_SAFETY_EDUCATION_TRAIN_DATA(0, "全员安全教育培训考试资料"),
    DRIVER_SAFETY_EDUCATION_TRAIN_LEDGER(1, "驾驶员安全教育培训台账"),
    SAFETY_MANAGE_REGIME(2,"安全管理制度"),
    SAFETY_PRODUCT_WORK_PLAN(3,"安全生产工作计划"),
    SAFETY_PRODUCT_MEETING_RECORD(4,"安全生产会议记录"),
    COMMERCIAL_CONCRETE_COMPANY_ACCIDENT_SUMMARY(5,"商品混凝土企业事故案例汇编");




    private Integer code;
    private String desc;

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByCode(Integer code) {
        if(Objects.isNull(code)){
            return StringUtils.EMPTY;
        }
        for (SecurityProductRegulationFileType t : SecurityProductRegulationFileType.values()) {
            if (code.equals(t.getCode())) {
                return t.desc;
            }
        }
        return StringUtils.EMPTY;
    }

}
