刘光辉
昨天 bb638871a7fb692d80f1b7a758f991dc0879002c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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;
    }
}