枚举修改

This commit is contained in:
Zhang.WH
2025-03-19 09:12:01 +08:00
parent 41e9d825eb
commit 0f90dffd6b
2 changed files with 40 additions and 54 deletions

View File

@@ -1,54 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 项目类型
*
* @author zwh
* @date 2025-03-10
*/
@Getter
@AllArgsConstructor
public enum ItemCategory implements HisEnumInterface {
/**
* 中药
*/
CHINESE_MEDICINE(1, "1","中药"),
/**
* 西药
*/
WESTERN_MEDICINE(2, "2","西药"),
/**
* 中成药
*/
CHINESE_PATENT_MEDICINE(3, "3","中成药"),
/**
* 医疗耗材
*/
MEDICAL_CONSUMABLES(4, "4","医疗耗材");
private Integer value;
private String code;
private String info;
public static ItemCategory getByValue(Integer value) {
if (value == null) {
return null;
}
for (ItemCategory val : values()) {
if (val.getValue().equals(value)) {
return val;
}
}
return null;
}
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.common.enums;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 项目类型
*
* @author zwh
* @date 2025-03-10
*/
@Getter
@AllArgsConstructor
public enum ItemType implements HisEnumInterface {
/**
* 中药
*/
MEDICINE(1, "1", "中药"),
/**
* 西药
*/
DEVICE(2, "2", "西药"),
/**
* 医疗活动
*/
ACTIVITY(3, "3", "医疗活动");
@EnumValue
private Integer value;
private String code;
private String info;
}