package com.engine.salary.sys.enums;

import com.engine.salary.enums.BaseEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * 薪资核算、社保福利核算人员匹配规则
 * @author songyang
 **/
public enum SalaryAcctEmployeeRuleEnum implements BaseEnum<String> {

    //"0"代表根据最后缴纳日期判断（包含停薪（停缴）列表），"1"代表根据最后缴纳日期判断（不包含停薪（停缴）列表）
    BYPAYENDTIME("0", "发薪员工（在缴员工）、从发薪（在缴）至停缴（停薪）列表员工", 1),
    BYSTATUS("1", "发薪员工（在缴员工）列表" , 1);

    private String value;

    private String defaultLabel;

    private int labelId;


    SalaryAcctEmployeeRuleEnum(String value, String defaultLabel, int labelId) {
        this.value = value;
        this.defaultLabel = defaultLabel;
        this.labelId = labelId;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDefaultLabel() {
        return defaultLabel;
    }

    @Override
    public Integer getLabelId() {
        return labelId;
    }

    public static SalaryAcctEmployeeRuleEnum parseByValue(String value) {
        for (SalaryAcctEmployeeRuleEnum salaryAcctEmployeeRuleEnum : SalaryAcctEmployeeRuleEnum.values()) {
            if (StringUtils.equals(salaryAcctEmployeeRuleEnum.getValue(), value)) {
                return salaryAcctEmployeeRuleEnum;
            }
        }
        return BYPAYENDTIME;
    }
}
