package cn.iocoder.yudao.module.mes.enums.pd;
|
|
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
import lombok.Getter;
|
import lombok.RequiredArgsConstructor;
|
|
import java.util.Arrays;
|
|
/**
|
* 产品设计-产品档案类型
|
*
|
* @author 超级管理员
|
*/
|
@RequiredArgsConstructor
|
@Getter
|
public enum MesPdProductArchiveTypeEnum implements ArrayValuable<Integer> {
|
|
ELECTRICITY_SERVICE(1, "电力服务"),
|
POWER_SUPPLY_PRODUCT(2, "供电产品"),
|
VALUE_ADDED_ENERGY(3, "增值能源产品");
|
|
private final Integer type;
|
private final String name;
|
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesPdProductArchiveTypeEnum::getType).toArray(Integer[]::new);
|
|
public static String getNameByType(Integer type) {
|
if (type == null) {
|
return null;
|
}
|
for (MesPdProductArchiveTypeEnum e : values()) {
|
if (e.getType().equals(type)) {
|
return e.getName();
|
}
|
}
|
return null;
|
}
|
|
@Override
|
public Integer[] array() {
|
return ARRAYS;
|
}
|
|
}
|