package com.goafanti.common.enums;

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

public enum OrgBasicInfoFields {
	
	UID("uid", "用户id"),
	HID("hid", "人力资源id"),
	UNITNAME("unitName", "企业名称"),
	PROVINCE("province", "行政区域--省"),
	CITY("city", "行政区域--市"),
	AREA("area", "行政区域--区"),
	POSTALADDRESS("postalAddress", "通讯地址"),
	POSTCODE("postcode", "邮编"),
	CONTACTS("contacts", "联系人姓名"),
	CONTACTMOBILE("contactMobile", "联系人手机"),
	CONTACTSFIXEDTEL("contactsFixedTel", "联系人电话"),
	CONTACTSFAX("contactsFax", "联系人传真"),
	LEGALPERSONTEL("legalPersonTel", "法人电话"),
	LEGALPERSONFAX("legalPersonFax", "法人传真"),
	LEGALPERSONEMAIL("legalPersonEmail", "法人Email"),
	REGISTEREDCAPITAL("registeredCapital", "注册资金"),
	LEGALPERSON("legalPerson", "法人代表姓名"),
	LEGALPERSONIDCARD("legalPersonIdCard", "法人身份证号"),
	ORGCODE("orgCode", "组织机构代码/统一社会信用代码"),
	RATEPAYCODE("ratepayCode", "税务登记号/统一社会信用代码"),
	INDUSTRY("industry", "所属行业"),
	ENTERPRISESCALE("enterpriseScale", "企业规模(注册资金)"),
	REGISTERTYPE("registerType", "注册类型"),
	FOREIGNINVESTMENT("foreignInvestment", "外资来源地"),
	FIELD("field", "领域"),
	TAXAUTHORITY("taxAuthority", "企业所得税主管税务机关"),
	RATEPAYMETHOD("ratepayMethod", "企业所得税征收方式"),
	LISTED("listed", "是否上市"),
	HIGHTECHZONE("highTechZone", "是否属于国家级高新区内企业"),
	RISKINVESTMENT("riskInvestment", "是否引入风险投资"),
	BUSINESSSCOPE("businessScope", "经营范围"),
	FIRMTOTAL("firmTotal", "企业职工"),
	TECHTOTAL("techTotal", "科技人员"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, OrgBasicInfoFields> status = new HashMap<String, OrgBasicInfoFields>();
	
	private OrgBasicInfoFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (OrgBasicInfoFields value : OrgBasicInfoFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static OrgBasicInfoFields 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;
	}

}
