package nckd.jxccl.hrmp.hbpm.common.hr;

import kd.hr.hbp.common.util.HRStringUtils;

/**
 * 岗位变动类型枚举
 * @author: jtd
 * @date: 2025/12/20 16:42
 */
public enum PositionChangeTypeEnum {
    ADD("1010", "岗位新设", PositionBillConstant.ADD_TAG, "新增岗位"),
    CHANGE("1020", "岗位变更", PositionBillConstant.CHANGE_TAG, "变更信息");

    private String number;
    private String name;
    private String tag;
    private String tip;

    private PositionChangeTypeEnum(String number, String name, String tag, String tip) {
        this.number = number;
        this.name = name;
        this.tag = tag;
        this.tip = tip;
    }

    public static String getNumberByTag(String tag) {
        if (tag == null) {
            return "";
        }
        for (PositionChangeTypeEnum value : values()) {
            if (HRStringUtils.equals(value.getTag(), tag)) {
                return value.getNumber();
            }
        }
        return "";
    }

    public static String getTagByNumber(String number) {
        if (number == null) {
            return "";
        }
        for (PositionChangeTypeEnum value : values()) {
            if (HRStringUtils.equals(value.getNumber(), number)) {
                return value.getTag();
            }
        }
        return "";
    }

    public static String getTipByTag(String tag) {
        if (tag == null) {
            return "";
        }
        for (PositionChangeTypeEnum value : values()) {
            if (HRStringUtils.equals(value.getTag(), tag)) {
                return value.getTip();
            }
        }
        return "";
    }

    public String getNumber() {
        return number;
    }

    public String getName() {
        return name;
    }

    public String getTag() {
        return tag;
    }

    public String getTip() {
        return tip;
    }
}
