package com.engine.organization.entity.personnelcard;

import com.engine.organization.exception.OrganizationRunTimeException;

/**
 * @author:dxfeng
 * @createTime: 2022/10/14
 * @version: 1.0
 */
public enum ResourceStatusEnum {
    TRY_OUT("0", "试用"),
    OFFICIAL("1", "正式"),
    TEMPORARILY("2", "临时"),
    TRIAL_EXTENSION("3", "试用延期"),
    DISMISSAL("4", "解聘"),
    RESIGN("5", "离职"),
    RETIRE("6", "退休"),
    INVALID("7", "无效"),
    WORK("8", "在职");

    private String value;
    private String name;

    ResourceStatusEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public static ResourceStatusEnum getResourceStatus(String value) {
        for (ResourceStatusEnum item : ResourceStatusEnum.values()) {
            if (item.value.equalsIgnoreCase(value)) {
                return item;
            }
        }
        throw new OrganizationRunTimeException("未找到对应状态");
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
