package com.mortals.xhx.common.code;

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

/**
 * 资源类型
 * @author 
 *
 */
public enum DataSatusEnum {
	DISENABLE(0, "禁用"),
	ENABLE(1, "启用"),
	CLOSE(2, "注销"),
	DELETE(3, "已删除"),
	OVERDUE(4, "过期"),
	USEOUT(5, "用完");
    private int value;
    private String desc;
    

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

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

    public String getDesc() {
        return desc;
    }

	public static DataSatusEnum getByValue(int value) {
        for (DataSatusEnum examStatus : DataSatusEnum.values()) {
            if (examStatus.getValue() == value) {
                return examStatus;
            }
        }
        return null;
    }
	/**
	 * 获取Map集合
	 * @param eItem 不包含项
	 * @return
	 */
	public static Map<String,String> getEnumMap(int... eItem) {
		Map<String,String> resultMap= new LinkedHashMap<String,String>();
		for (DataSatusEnum item : DataSatusEnum.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;
	}
}
