20250407 更新
1.提供BusinessType枚举到api包里
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package digital.laboratory.platform.inspetion.api.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum BusinessType {
|
||||
NPS_CASE("10001", "缴获物检验"),
|
||||
BOINT_CASE("10002", "生物样本案件"),
|
||||
|
||||
|
||||
BOINT_JOB("20001", "毛发任务"),
|
||||
SEWAGE_JOB("20002", "污水任务"),
|
||||
SCREENING_EVENT("30001", "筛查事件");
|
||||
|
||||
BusinessType(String businessType, String businessTypeName) {
|
||||
this.businessType = businessType;
|
||||
this.businessTypeName = businessTypeName;
|
||||
}
|
||||
private final String businessType;
|
||||
private final String businessTypeName;
|
||||
|
||||
public static String getBusinessTypeName(String businessType) {
|
||||
for (BusinessType type : values()) {
|
||||
if (businessType.equals(type.businessType)) {
|
||||
return type.businessTypeName;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException(String.format("没有获取到%s相关的Name", businessType));
|
||||
}
|
||||
public static BusinessType getBusinessTypeByType(String businessType) {
|
||||
for (BusinessType type : values()) {
|
||||
if (businessType.equals(type.businessType)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException(String.format("没有获取到%s相关的Name", businessType));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user