package com.engine.salary.enums.datacollection;

import java.util.Arrays;

/**
 * @Description: 考勤引用-来源
 * @Author: wangxiangzhong
 * @Date: 2021-11-17 14:37
 */
public enum AttendQuoteSourceTypeEnum {
    QUOTE(1, "引用", 87621),
    IMPORT(2, "导入", 87622);

    private int value;

    private String defaultLabel;

    private int labelId;

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

    public int getValue() {
        return value;
    }

    public String getDefaultLabel() {
        return defaultLabel;
    }

    public int getLabelId() {
        return labelId;
    }

    public static String getDefaultLabelByValue(Integer value) {
        if (value == null) {
            return "";
        }
        AttendQuoteSourceTypeEnum[] enumAry = AttendQuoteSourceTypeEnum.values();
        for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
            if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
                return enumAry[i].getDefaultLabel();
            }
        }
        return "";
    }
}
