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;

/**
 * 流程通知状态
 * @author 
 *
 */
public enum FlowStatusNotifyType implements IBaseEnum {

    FLOW_START(0, "流程启动", SysConstains.STYLE_DEFAULT),

    FLOW_END(1, "流程结束", SysConstains.STYLE_PRIMARY),

	TASK_CREATE(2, "任务创建", SysConstains.STYLE_PRIMARY),

	TASK_COMPLETE(3, "任务结束", SysConstains.STYLE_PRIMARY);

    private int value;
    private String desc;
    private String style;

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

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

    public String getDesc() {
        return desc;
    }

    public String getStyle()
	{
		return style;
	}

	public static FlowStatusNotifyType getByValue(int value) {
        for (FlowStatusNotifyType examStatus : FlowStatusNotifyType.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 (FlowStatusNotifyType item : FlowStatusNotifyType.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;
	}
}
