Merge branch 'main' of https://git.ngsk.tech/linweidong/besure_server
commit
d9acb82982
@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.mold.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum OrgTypeStatusEnum {
|
||||||
|
zhijiang("zhijiang", "制浆"),
|
||||||
|
duidie("duidie", "堆叠"),
|
||||||
|
chengxing("chengxing", "成型"),
|
||||||
|
honggan("honggan", "烘干"),
|
||||||
|
zhuanyi("zhuanyi", "转移"),
|
||||||
|
jiashi("jiashi", "加湿"),
|
||||||
|
reya("reya", "热压"),
|
||||||
|
qiebian("qiebian", "切边"),
|
||||||
|
pinjian("pinjian", "品检"),
|
||||||
|
dabao("dabao", "打包"),
|
||||||
|
tiebiao("tiebiao", "贴标"),
|
||||||
|
sufeng("sufeng", "塑封"),
|
||||||
|
pinyin("pinyin", "品印");
|
||||||
|
|
||||||
|
private final String orgtype;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
public static OrgTypeStatusEnum getByCode(String code) {
|
||||||
|
for (OrgTypeStatusEnum status : values()) {
|
||||||
|
if (status.getOrgtype().equals(code)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
package cn.iocoder.yudao.module.mes.controller.admin.repairtems.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(description = "设备类型枚举")
|
||||||
|
public enum DeviceTypeEnum {
|
||||||
|
|
||||||
|
DEVICE(1, "设备"),
|
||||||
|
CRITICAL_COMPONENT(2, "关键件");
|
||||||
|
|
||||||
|
@Schema(description = "类型", example = "1")
|
||||||
|
private final Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "描述", example = "设备")
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型获取枚举
|
||||||
|
*/
|
||||||
|
public static DeviceTypeEnum getByType(Integer type) {
|
||||||
|
if (type == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (DeviceTypeEnum deviceType : DeviceTypeEnum.values()) {
|
||||||
|
if (deviceType.getType().equals(type)) {
|
||||||
|
return deviceType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型获取描述
|
||||||
|
*/
|
||||||
|
public static String getDescriptionByType(Integer type) {
|
||||||
|
DeviceTypeEnum deviceType = getByType(type);
|
||||||
|
return deviceType != null ? deviceType.getDescription() : "未知";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断类型是否有效
|
||||||
|
*/
|
||||||
|
public static boolean isValid(Integer type) {
|
||||||
|
return getByType(type) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有类型列表
|
||||||
|
*/
|
||||||
|
public static Map<Integer, String> getAllTypes() {
|
||||||
|
Map<Integer, String> map = new LinkedHashMap<>();
|
||||||
|
for (DeviceTypeEnum deviceType : values()) {
|
||||||
|
map.put(deviceType.getType(), deviceType.getDescription());
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue