package com.goafanti.order.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 项目阶段
 * @author Administrator
 *
 */
public enum ProjectStage {
	/** 未达立项条件 **/
	NOT_SATISFY_CONDITION(0,"未达立项条件"),
	/** 等待立项 **/
	WAIT_SET_UP(1,"等待立项 "),
	/** 已立项 **/
	ALREADY_SET_UP(2,"已立项 "),
	/** 已结项 **/
	FINISH(3,"已结项"),
	/** 已撤项 **/
	CANCEL(4,"已撤项"),
	/** 无效 **/
	INVALID(10, "INVALID");
	
	private ProjectStage(Integer code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	private static Map<Integer, ProjectStage> status = new HashMap<Integer, ProjectStage>();

	static {
		for (ProjectStage value : ProjectStage.values()) {
			status.put(value.getCode(), value);
		}
	}
	public static ProjectStage getStatus(Integer code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return INVALID;
	}
	public static boolean containsType(Integer code) {
		return status.containsKey(code);
	}
	private Integer	code;
	private String	desc;
	public Integer getCode() {
		return code;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
}
