package com.mortals.xhx.common.code;

import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;

import java.util.LinkedHashMap;
import java.util.Map;

public enum MenuComm {
    /** 非常用 */
    UNCOMMON(0, "非常用"),
    /** 常用 */
    COMMON(1, "常用");
    
    private int value;
    private String desc;
    private String style;

    MenuComm(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }


    public int getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }


	public static MenuComm getByValue(int value) {
        for (MenuComm menuComm : MenuComm.values()) {
            if (menuComm.getValue() == value) {
                return menuComm;
            }
        }
        return null;
    }
	/**
	 * 获取Map集合
	 * @param eItem 不包含项
	 * @return
	 */
	public static Map<String,String> getEnumMap(int... eItem) {
		Map<String,String> resultMap= new LinkedHashMap<String,String>();
		for (MenuComm item : MenuComm.values()) {
			try{
				boolean hasE = false;
				for (int e : eItem){
					if(item.getValue()==e){
						hasE = true;
						break;
					}
				}
				if(!hasE){
					resultMap.put(item.getValue()+"", item.getDesc());
				}
			}catch(Exception ex){
			}
		}
		return resultMap;
	}
}
