package com.hzs.common.core.enums;

import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: 月度业绩查询类型
 * @Author: zhangjing
 * @Time: 2023/11/28 11:50
 * @Classname: EPlaceDept
 * @PackageName: com.hzs.common.core.enums
 */
@AllArgsConstructor
@Getter
public enum EMonthScoreType {

    /**
     * 左右区人数
     */
    PEOPLE_NUMBER(1, "左右区人数", 0, EnumsPrefixConstants.MONTH_SCORE_TYPE + "1"),
    /**
     * 左右区业绩
     */
    SCORE(2, "左右区业绩", 0, EnumsPrefixConstants.MONTH_SCORE_TYPE + "2"),
    /**
     * 左右区血缘业绩
     */
    BLOOD_SCORE(3, "左右区血缘业绩", 0, EnumsPrefixConstants.MONTH_SCORE_TYPE + "3"),
    /**
     * 血缘业绩
     */
    DIRECT_SCORE(4, "血缘业绩", 0, EnumsPrefixConstants.MONTH_SCORE_TYPE + "4"),


    ;

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;
    /**
     * 是否启用（0=是,1=否） -- 来源EYesNo
     */
    private final int enable;
    /**
     * 国际化翻译key值
     */
    private final String key;

    public static String getEPlaceDept(int value) {
        for (EMonthScoreType ePlaceDept : EMonthScoreType.values()) {
            if (ePlaceDept.value == value) {
                return ePlaceDept.label;
            }
        }
        return null;
    }

    /**
     * 根据label获取枚举
     *
     * @param label
     * @return
     */
    public static EMonthScoreType getEnumByLabel(String label) {
        for (EMonthScoreType value : EMonthScoreType.values()) {
            if (value.getLabel().equals(label)) {
                return value;
            }
        }
        return null;
    }

}
