package com.goafanti.common.enums;

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

public enum OrgCognizanceFields {
	
	UID("uid", "用户id"),
	CONTACTS("contacts", "联系人及联系方式"),
	CONSULTANT("consultant", "咨询师"),
	TECHNICALFIELD1("technicalField1", "技术领域1st select"),
	TECHNICALFIELD2("technicalField2", "技术领域1nd select"),
	TECHNICALFIELD3("technicalField3", "技术领域1rd select"),
	BASICRESEARCHCOST("basicResearchCost", "基础研究投入费用"),
	ACCIDENT("accident", "申请认定前一年内是否发生过重大安全、重大质量或严重环境违法行为"),
	CERTIFICATENUMBER("certificateNumber", "证书编号"),
	CERTIFICATEURL("certificateUrl", "证书URL"),
	YEAR("year", "年份"),
	PRINCIPAL("principal", "负责人"),
	COMMENT("comment", "备注"),
	STATE("state", "高企申请状态"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, OrgCognizanceFields> status = new HashMap<String, OrgCognizanceFields>();
	
	private OrgCognizanceFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (OrgCognizanceFields value : OrgCognizanceFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static OrgCognizanceFields getField(String code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return OTHER;
	}
	
	public static String getFieldDesc(String code) {
		return getField(code).getDesc();
	}

	public static boolean containsType(String code) {
		return status.containsKey(code);
	}
	
	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

}
