chenrui
2025-04-08 9f8f73240c885488fdffc1062826520cf7abb86b
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
package com.ruoyi.basic.enums;
 
public enum TestPorjectTypeEnums {
 
    RAW_MATERIALS("1","原辅材"),
    FINISHED_PRODUCT("2","成品"),
    SEMI_FINISHED_PRODUCT("3","半成品"),
    PURCHASED_PART("4","外购件"),
    PACKAGING_MATERIALS("5","包材");
 
    private String code;
 
    private String name;
 
    TestPorjectTypeEnums(String code, String name) {
        this.code = code;
        this.name = name;
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public static String getNameByCode(String code) {
        for (TestPorjectTypeEnums type : TestPorjectTypeEnums.values()) {
            if (type.getCode().equals(code)) {
                return type.getName();
            }
        }
        return "";
    }
}