package cn.iocoder.yudao.module.mes.enums.pro; import cn.iocoder.yudao.framework.common.core.ArrayValuable; import lombok.AllArgsConstructor; import lombok.Getter; import java.util.Arrays; @Getter @AllArgsConstructor public enum MesProBagTypeEnum implements ArrayValuable { SMALL(10, "小袋", 100), LARGE(20, "大袋", 48); public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProBagTypeEnum::getType).toArray(Integer[]::new); private final Integer type; private final String name; private final int threshold; @Override public Integer[] array() { return ARRAYS; } public static MesProBagTypeEnum valueOfType(Integer type) { return Arrays.stream(values()).filter(item -> item.type.equals(type)).findFirst().orElse(null); } }