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;
|
}
|
}
|