package com.goafanti.common.enums;

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

public enum AttachmentType {
	COPYRIGHT_AUTH("copyright_auth", "软著证书"),
	COPYRIGHT_APPLY("copyright_apply", "软著申请书"),
	DEFAULT("attachment", "附件"),
	PATENT_PRORY_STATEMENT("patent_prory_statement", "专利代理委托书"),
	PATENT_WRITING("patent_writing", "专利稿件"),
	AUTHORIZATION_NOTICE("authorization_notice", "授权通知书 "),
	PATENT_CERTIFICATE("patent_certificate", "专利证书"),
	PATENT_TEMPLATE("patent_template", "专利代理委托书模版"),
	INSTITUTION("institution", "研发部门制度"),
	PROTOCOL("protocol", "产学研技术中心协议"),
	PROOF("proof", "研发活动立项证明材料"),
	ACTIVITY_COST_ACCOUNT("activity_cost_account", "研发活动费用台帐"),
	TECH_PRODUCT("tech_product", "高新技术产品台帐"),
	PROPERTY_RIGHT("property_right", "知识产权证书"),
	ACHIEVEMENT("achievement", "科技成果附件"),
	RATEPAY("ratepay", "企业纳税申报表"),
	FINANCE("finance", "企业财务报表"),
	ROSTER("roster", "企业花名册"),
	SOCIAL_SECURITY("social_security", "企业社保情况表"),
	HONOR("honor", "荣誉及其他证明材料"),
	LAST_YEAR_RATEPAY("last_year_ratepay", "上年度纳税申报表"),
	TECH_PROJECT("tech_project", "科技项目申报材料"),
	STANDARD("standard", "标准制定附件"),
	MANUSCRIPT("manuscript", "知识产权稿件"),
	ORGCODE("orgcode", "组织结构代码证"),
	LICENCE("licence", "营业执照"),
	DEMAND_PICTURE("demand_picture", "科技需求图片资料"),
	DEMAND_TEXT_FILE("demand_text_file", "科技需求文本文件资料"),
	ACHIEVEMENT_TECHNICAL_PICTURE("achievement_technical_picture", "科技成果技术图片"),
	ACHIEVEMENT_MATURITY_PICTURE("achievement_maturity_picture", "科技成果成熟度资料图片"),
	ACHIEVEMENT_MATURITY_TEXT_FILE("achievement_maturity_text_file", "科技成果成熟度资料文本文件"),
	ACHIEVEMENT_TECH_PLAN("achievement_tech_plan", "科技成果技术方案文件"),
	ACHIEVEMENT_BUSINESS_PLAN("achievement_business_plan", "科技成果商业计划书"),
	ACHIEVEMENT_COVER_PICTURE("achievement_cover_picture","科技成果封面图"),
	DEMAND_TEMPLATE("demand_template", "科技需求批量导入模板"),
	ACHIEVEMENT_TEMPLATE("achievement_template", "科技成果批量导入模板"),
	RECEIVABLES_TEMPLATE("receivbles_template", "收款批量导入模板"),
	NEW_PATENT_TEMPLATE("new_patent_template", "新专利导入模板"),
	USER_CHANNEL("user_channel", "渠道客户导入模板"),
	DEMAND_ORDER_FILE("demand_order_file", "科技需求意向单/交易单附件"),
	DEMAND_COVER_PICTURE("demand_cover_picture","科技需求封面图"),
	BANNERS_PIC("banners", "广告图片"),
	NEWS_TITLE_PICTURE("news_title_picture", "新闻题图图片"),
	NEWS_CONTENT_PICTURE("news_content_picture", "新闻内容图片"),
	LECTURE_PICTURE("lecture_picture", "科技讲堂展示图片"),
	ACTIVITY_TITLE_PICTURE("activity_title_picture", "活动题图"),
	ACTIVITY_CONTENT_PICTURE("activity_content_picture", "活动内容图片"),
	CUSTOMER_SYS_FILE("customer_sys_file","客户系统文件"),
	BUSINESS_PROJECT_MIN_PICTURE("business_project_min_picture","业务项目小图"),
	BUSINESS_PROJECT_MAX_PICTURE("business_project_max_picture","业务项目大图"),
	VARIETIES_PICTURE("varieties_picture","业务品类图片"),
	ORGANIZATION_APPLICATION("organization_application","企业申报书"),
	DUN_LOG_ATTACHMENT("dun_log_attachment","催款日志附件"),
	LEGAL_LOG_ATTACHMENT("legal_log_attachment","催款日志附件"),
	STANDARD_DOCUMENT("standard_document","标准文档");



	private AttachmentType(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	private static Map<String, AttachmentType> status = new HashMap<String, AttachmentType>();

	static {
		for (AttachmentType value : AttachmentType.values()) {
			status.put(value.getCode(), value);
		}
	}

	public static AttachmentType getField(String code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return DEFAULT;
	}

	public static String getFieldDesc(String code) {
		return getField(code).getDesc();
	}

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

	private String	code;
	private String	desc;

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
}
