package nckd.jxccl.base.common.enums.psms;

import java.util.HashMap;
import java.util.Map;

/**
 * 员工年度贡献综合评价积分-积分项目级别
 * @author W.Y.C
 * @date 2025/10/14 10:35
 * @version 1.0
 */
public enum ScoreItemLevelEnum {

    NATIONAL_LEVEL("01", "国家级"),
    /**省部级*/
    PROVINCIAL_LEVEL("02", "省部级"),
    /**公司级*/
    COMPANY_LEVEL("03", "公司级"),
    /**厂矿级*/
    FACTORY_LEVEL("04", "厂矿级"),
    /**公司青工*/
    COMPANY_JUNIOR_LEVEL("05", "公司青工"),
    /**车间级*/
    WORKSHOP_LEVEL("06", "车间级");



    private static final Map<String, ScoreItemLevelEnum> CODE_MAP = new HashMap<>();

    static {
        for (ScoreItemLevelEnum value : ScoreItemLevelEnum.values()) {
            CODE_MAP.put(value.code, value);
        }
    }

    private final String code;
    private final String name;

    ScoreItemLevelEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 根据编码获取枚举
     * @param code
     * @return: AdjustTypeEnum
     * @author W.Y.C
     * @date: 2025/09/12 14:33
     */
    public static ScoreItemLevelEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        return CODE_MAP.get(code);
    }



    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
