package com.goafanti.common.enums;

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

public enum OrgRatepayFields {
	
	UID("uid", "用户id"),
	OPERATINGINCOME("operatingIncome", "营业收入(万元)"),
	MANAGEMENTCOST("managementCost", "管理费用(万元)"),
	OPERATINGPROFIT("operatingProfit", "营业利润(万元)"),
	NONOPERATINGINCOME("nonOperatingIncome", "营业外收入(万元)"),
	NONTAXABLEINCOME("nonTaxableIncome", "不征税收入(万元)"),
	TAXEXEMPTINCOME("taxExemptIncome", "免税收入(万元)"),
	SUBSIDYINCOME("subsidyIncome", "政府补助收入(万元)"),
	YEAR("year", "年份"),
	GROSSPROFIT("grossProfit", "利润总额(万元)"),
	RESEARCHCOST("researchCost", "研发费用(万元)"),
	TAXRETURNURL("taxReturnUrl", "纳税申报表URL"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, OrgRatepayFields> status = new HashMap<String, OrgRatepayFields>();
	
	private OrgRatepayFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (OrgRatepayFields value : OrgRatepayFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static OrgRatepayFields 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;
	}

}
