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; /** * MES 工序计费类型枚举 * *

决定报工工资的计算口径: *

* * @author 超级管理员 */ @Getter @AllArgsConstructor public enum MesProProcessBillingTypeEnum implements ArrayValuable { TIME(1, "计时"), PIECE(2, "计件"); public static final Integer[] ARRAYS = Arrays.stream(values()) .map(MesProProcessBillingTypeEnum::getType).toArray(Integer[]::new); /** * 类型值 */ private final Integer type; /** * 类型名 */ private final String name; @Override public Integer[] array() { return ARRAYS; } public static MesProProcessBillingTypeEnum valueOfType(Integer type) { if (type == null) { return null; } return Arrays.stream(values()).filter(e -> e.getType().equals(type)).findFirst().orElse(null); } public static String getNameByType(Integer type) { MesProProcessBillingTypeEnum billingType = valueOfType(type); return billingType != null ? billingType.getName() : String.valueOf(type); } }