package com.goafanti.common.enums;

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

public enum ProprotionFields {
	
	INSTITUTION("institution", "企业研发机构"),
	ACTIVITY("activity", "研发活动"),
	ACTIVITYCOST("activityCost", "研发活动费用详情"),
	TECHPROJECT("techProject", "高新技术产品"),
	INTELLECTUALPROPERTY("intellectualProperty", "知识产权"),
	ACHIEVEMENT("achievement", "科技成果转化"),
	RATEPAY("ratepay", "企业所得税纳税申报表"),
	FINANCE("finance", "财务报表"),
	HUMANRESOURCE("humanResource", "企业人员情况"),
	HONORDATUM("honorDatum", "企业荣誉及其他证明材料"),
	STANDARD("standard", "标准制定情况"),
	ABILITY("ability", "企业创新能力"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, ProprotionFields> status = new HashMap<String, ProprotionFields>();
	
	private ProprotionFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (ProprotionFields value : ProprotionFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static ProprotionFields 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;
	}

}
