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 ScoreItemEnum {

    /**科研与创新积分*/
    RESEARCH_SCORE("01", "科研与创新积分","nckd_contribbill_a"),
    /**专利申报积分*/
    PATENT_SCORE("02", "专利申报积分","nckd_contribbill_b"),
    /**论文发表积分*/
    PAPER_SCORE("03", "论文发表积分","nckd_contribbill_c"),
    /**技能竞赛积分*/
    SKILL_CONTEST_SCORE("04", "技能竞赛积分","nckd_contribbill_d"),
    /**培训教材积分*/
    TRAINING_MATERIAL_SCORE("05", "培训教材积分","nckd_contribbill_e"),
    /**技术标准积分*/
    TECH_STANDARD_SCORE("06", "技术标准积分","nckd_contribbill_f"),
    /**管理规范积分*/
    MGMT_SPEC_SCORE("07", "管理规范积分","nckd_contribbill_g"),
    /**师带徒积分*/
    MENTOR_SCORE("08", "师带徒积分","nckd_contribbill_h"),
    /**培训授课积分*/
    TRAINING_SCORE("09", "培训授课积分","nckd_contribbill_i");


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

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

    private final String code;
    private final String name;
    private final String pageId;

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

    /**
     * 根据编码获取枚举
     * @param code
     * @return: AdjustTypeEnum
     * @author W.Y.C
     * @date: 2025/09/12 14:33
     */
    public static ScoreItemEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        return CODE_MAP.get(code);
    }
    
    /**
     * 根据页面标识获取枚举
      * @param pageId
     * @return: nckd.jxccl.base.common.enums.psms.ScoreItemEnum
     * @author W.Y.C
     * @date: 2025/10/26 21:45
     */
    public static ScoreItemEnum getByPageId(String pageId) {
        for (ScoreItemEnum value : ScoreItemEnum.values()) {
            if (value.pageId.equals(pageId)) {
                return value;
            }
        }
        return null;
    }


    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getPageId() {
		return pageId;
	}



}
