MaterialUnitEnum.java
2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com.huaheng.common.utils;
import java.util.Date;
public enum MaterialUnitEnum {
UNIT1("公斤", "KG"),
UNIT2("根", "PCS(G)"),
UNIT3("只", "PCS"),
UNIT4("件", "PCS"),
UNIT5("套", "SET"),
UNIT6("米", "M"),
UNIT7("支", "PCS"),
UNIT8("片", "PCS"),
UNIT9("个", "EA(G)"),
UNIT10("平方米", "MS"),
UNIT11("批", "BATCH"),
UNIT12("次", "CNT"),
UNIT13("条", "BAR"),
UNIT14("盘", "PALLET"),
UNIT15("张", "SHEET"),
UNIT16("粒", "PCS(L)"),
UNIT17("包", "PACK"),
UNIT18("盒", "BOX"),
UNIT19("双", "PAIR(S)"),
UNIT20("节", "LINK"),
UNIT21("箱", "CASE"),
UNIT22("吨", "T"),
UNIT23("对", "PAIR"),
UNIT24("本", "PCS(B)"),
UNIT25("克", "G"),
UNIT26("袋", "BAG"),
UNIT27("辆", "UNIT"),
UNIT28("毫米", "MM"),
UNIT29("捆", "BDL"),
UNIT30("台", "SET(T)"),
UNIT31("把", "GROUP"),
UNIT32("桶", "BBL"),
UNIT33("副", "PAIR"),
UNIT34("卷", "ROL"),
UNIT35("组", "LOT"),
UNIT36("瓶", "BOT"),
UNIT37("升", "L"),
UNIT50("块", "PCS(K)");
private String typeName;
private String typeCode;
// 构造方法
private MaterialUnitEnum(String typeName, String typeCode) {
this.typeName = typeName;
this.typeCode = typeCode;
}
public static String getTypeCode(String typeName){
for (MaterialUnitEnum unitEnum : MaterialUnitEnum.values()) {
if (unitEnum.typeName.equals(typeName)){
return unitEnum.typeCode;
}
}
return null;
}
public static void main(String[] args) {
MaterialUnitEnum[] values = MaterialUnitEnum.values();
// for (TaskTypeEnum value : values) {
// System.out.println(value + " warehouseCode: " + value.warehouseCode + " warehouseName: " + value.warehouseName);
// }
// System.out.println("======================");
System.out.println("开始时间:"+new Date());
System.out.println(MaterialUnitEnum.getTypeCode("件"));
System.out.println("开始时间:"+new Date());
}
}