package com.goafanti.order.enums;

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

/**
 * 项目阶段
 * @author Administrator
 *
 */
public enum ProjectNewStage {
	/** 项目待提交 **/
	DTJ(0,"项目待提交"),
	/** 项目已提交 **/
	YTJ(1,"项目已提交"),
	/** 项目评审 **/
	PS(2,"项目评审"),
	/** 项目立项 **/
	LS(3,"项目立项"),
	/** 项目公示 **/
	GS(4,"项目公示"),
	/** 项目抽查 **/
	CC(5,"项目抽查"),
	/** 项目备案 **/
	BA(6,"项目备案"),
	/** 项目下证 **/
	XZ(7,"项目下证"),
	/** 项目验收 **/
	YS(8,"项目验收"),
	/** 项目拨款 **/
	BK(9,"项目拨款"),

	JD10(10,"项目进度10%"),
	
	JD30(11,"项目进度30%"),
	
	JD70(12,"项目进度70%"),
	/** 无效 **/
	INVALID(10, "INVALID");
	
	private ProjectNewStage(Integer code, String desc) {
		this.code = code;
		this.desc = desc;
	}

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

	static {
		for (ProjectNewStage value : ProjectNewStage.values()) {
			status.put(value.getCode(), value);
		}
	}
	public static ProjectNewStage getStatus(Integer code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return INVALID;
	}
	
	public static String getValueByCode(Integer code){
        for(ProjectNewStage projectNewStage:ProjectNewStage.values()){
            if(code.equals(projectNewStage.getCode())){
                return projectNewStage.getDesc();
            }
        }
        return  "";
    }
	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;
	}
}
