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

    // 新入职人员初定1;在职人员初定2;年度调整3;职位调动4;管理序列的聘任5;高级职称的聘任6
    NEW_ENTRY("1", "新入职人员初定"),
    /**在职人员定级*/
    IN_SERVICE_LEVEL("2", "在职人员初定"),
    /**年度调整*/
    ANNUAL_ADJUSTMENT("3", "年度调整"),
    /**职位调动*/
    POSITION_TRANSFER("4", "动态调整"),
    /**管理序列的聘任*/
    MANAGEMENT_SEQUENCE_EMPLOYMENT("5", "管理序列的聘任"),
    /**高级职称的聘任*/
    HIGH_PROFESSIONAL_EMPLOYMENT("6", "高级职称的聘任");


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

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

    private final String code;
    private final String name;

    TypeStateEnum(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 TypeStateEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        return CODE_MAP.get(code);
    }


    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
