package com.engine.salary.enums.datacollection;

import com.engine.salary.enums.BaseEnum;

import java.util.Arrays;
import java.util.Optional;

/**
 * 人员使用枚举
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public enum UseEmployeeTypeEnum implements BaseEnum<Integer> {

    ORG(0, "组织架构", 109125),
    EXT(1, "非系统人员", 119127),
    ALL(2, "所有人员", 119127),
    ;

    private int value;

    private String defaultLabel;

    private int labelId;

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

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

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

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

    public static String getNameByValue(String value) {
        Optional<UseEmployeeTypeEnum> optional = Arrays.stream(UseEmployeeTypeEnum.values()).filter(r -> r.getValue().toString().equals(value)).findFirst();
        return optional.isPresent() ? optional.get().name() : "";
    }
}
