package jnpf.limsEntity; /** * 检验异常调查类型(字典 jianyanYichangDiaochaLeixing)。 * code = 入库值(lims_jianyan_xiang.yichang_diaocha_leixing),label = 中文展示, * flowTemplateEnCode = 对应工作流模板的流程编码(workflow_template.f_en_code),用于发起流程时反解 templateId。 * oos/oot 共用同一张 OOS/OOT 调查表流程模板(oosOotDiaochabiao)。 */ public enum YichangDiaochaLeixing { NA("na", "N/A", null), AD("ad", "AD调查", "adDiaochabiao"), OOS("oos", "OOS调查", "oosOotDiaochabiao"), OOT("oot", "OOT调查", "oosOotDiaochabiao"); private final String code; private final String label; private final String flowTemplateEnCode; YichangDiaochaLeixing(String code, String label, String flowTemplateEnCode) { this.code = code; this.label = label; this.flowTemplateEnCode = flowTemplateEnCode; } public String getCode() { return code; } public String getLabel() { return label; } /** 对应工作流模板的流程编码(workflow_template.f_en_code);NA 为 null */ public String getFlowTemplateEnCode() { return flowTemplateEnCode; } /** 按 code 匹配;null / 未知 code 返回 null(调用方据此跳过,不抛异常) */ public static YichangDiaochaLeixing fromCode(String code) { if (code == null) { return null; } for (YichangDiaochaLeixing v : values()) { if (v.code.equals(code)) { return v; } } return null; } /** 是否为需要发起调查的有效类型(非 N/A) */ public boolean isInvestigation() { return this == AD || this == OOS || this == OOT; } }