刘光辉
14 小时以前 34981c30a78e8bbd7791131059a9210f9928b62c
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package jnpf.enums;
 
public enum LimsSampleEnum {
    /**
     * 样品请检
     */
    APPLY_CHECK("1", "待请检","1","lims_apply_test"),
 
    /**
     * 取样
     */
    SAMPLE_RECORD("2", "待取样","1","lims_sampling_record"),
 
    /**
     * 分样
     */
    SAMPLE_SPLITTING("3", "待分样","1","lims_sampling_record"),
 
    /**
     * 接收
     */
    SAMPLE_RECEIVING("4", "待接收","1","lims_sampling_record"),
 
    /**
     * 项目领取
     */
    PROJECT_CLAIM("5", "待项目领取","2","lims_test_task"),
 
    /**
     * 结果登记
     */
    RESULT_RECORDING("6", "待结果登记","3","lims_test_task"),
 
    /**
     * 结果复核
     */
    RESULT_REVIEW("7", "待结果复核","4","lims_test_task"),
 
    /**
     * 制作报告
     */
    REPORT_PREPARATION("10", "待制作报告","5","lims_sample_info"),
 
    /**
     * 报告一审
     */
    REPORT_FIRST_REVIEW("11", "待报告一审","5","lims_report"),
 
    /**
     * 报告二审
     */
    REPORT_SECOND_REVIEW("12", "待报告二审","5","lims_report"),
 
    /**
     * 检验完成
     */
    CHECK_OVER("15", "检验完成","5","lims_report"),
 
    /**
     * 检验废弃
     */
    CHECK_ISDEL("-1","检验终止","-1","lims_sample_info");
 
    /**
     * 状态码(建议与数据库存储的值一致)
     */
    private final String code;
 
    private final String itemCode;
 
    private final String tableName;
 
    /**
     * 状态描述(用于前端展示)
     */
    private final String description;
 
    LimsSampleEnum(String code, String description, String itemCode , String tableName) {
        this.code = code;
        this.itemCode = itemCode;
        this.description = description;
        this.tableName = tableName;
    }
 
    /**
     * 获取状态码
     */
    public String getCode() {
        return code;
    }
 
    public String getItemCode() {
        return itemCode;
    }
 
    /**
     * 获取状态描述
     */
    public String getDescription() {
        return description;
    }
 
    public String getTableName() {
        return tableName;
    }
 
    /**
     * 根据状态码获取对应的枚举
     *
     * @param code 状态码
     * @return 枚举实例
     * @throws IllegalArgumentException 如果状态码不存在
     */
    public static LimsSampleEnum fromCode(String code) {
        for (LimsSampleEnum status : values()) {
            if (status.code == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("无效的状态码: " + code);
    }
 
    /**
     * 可选:重写 toString() 便于日志输出
     */
    @Override
    public String toString() {
        return this.description;
    }
}