package com.qianwen.smartman.modules.cps.enums; /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/enums/MaterialPropertyEnum.class */ public enum MaterialPropertyEnum { T1(1, "原材料"), T2(2, "半成品"), T3(3, "成品"), T4(4, "备品备件"), T5(5, "辅助用品"), T9(9, "其它"); private final int type; private final String desc; MaterialPropertyEnum(final int type, final String desc) { this.type = type; this.desc = desc; } public int getType() { return this.type; } public String getDesc() { return this.desc; } public static MaterialPropertyEnum of(Integer status) { if (status == null) { return null; } MaterialPropertyEnum[] values = values(); for (MaterialPropertyEnum materialPropertyEnum : values) { if (materialPropertyEnum.type == status.intValue()) { return materialPropertyEnum; } } return null; } public static Integer getType(String desc) { if (desc == null) { return null; } MaterialPropertyEnum[] values = values(); for (MaterialPropertyEnum materialPropertyEnum : values) { if (desc.equals(materialPropertyEnum.desc)) { return Integer.valueOf(materialPropertyEnum.type); } } return null; } public static String getDesc(Integer type) { if (type == null) { return null; } MaterialPropertyEnum[] values = values(); for (MaterialPropertyEnum materialPropertyEnum : values) { if (type.intValue() == materialPropertyEnum.type) { return materialPropertyEnum.desc; } } return null; } }