lyh
2025-04-11 2cf1565485060fd56e1f1f1cffbba7a4d70d42a6
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
package org.jeecg.modules.dnc.response;
 
import com.google.common.collect.ImmutableMap;
import io.swagger.annotations.ApiModelProperty;
import lombok.ToString;
 
@ToString
public enum PartsInfoCode implements ResultCode {
    PARTS_NAME_NONE(false,25201,"请输入零件名称!"),
    PARTS_PRODUCT_NONE(false,25202,"请输选择产品!"),
    PARTS_COMPONENT_NONE(false,25203,"请输选择部件!"),
    PARTS_NOT_EXIST(false,25204,"零件不存在!"),
    PARTS_USER_NOT_PERM(false,25205,"没有该零件的权限!"),
    PARTS_DELETE_ERROR(false,25206,"删除零件失败!"),
    PARTS_PROCESS_EXIST(false,25207,"零件有关联的工艺规程版本信息!"),
    PARTS_DOC_EXIST(false,25208,"零件有关联的文档数据"),
    PARTS_CODE_NONE(false,25209,"请输入零件代号!"),
    PARTS_IS_EXIST(false,25210,"零件已存在!"),
    PROCESSSPECVERSION_NOT_EXIST(false,25211,"工艺规程不存在!"),
    PROCESSSPECVERSION_IS_EXIST(false,25212,"工艺规程已存在!"),
    PROCESSSPECVERSION_CODE_NONE(false,25213,"请输入工艺规程版本号!"),
    PROCESSSPECVERSION_NONE(false,25214,"请输入工艺规程版本名称!"),
    PROCESSSPECVERSION_PROCESS_EXIST(false,25215,"工艺规程版本有关联的工序信息!"),
    PARTS_USER_NONE(false,25216,"零件无法清空用户权限,请至少保留一位可操作用户!");
 
    //操作代码
    @ApiModelProperty(value = "操作是否成功", example = "true", required = true)
    boolean success;
 
    //操作代码
    @ApiModelProperty(value = "操作代码", example = "22001", required = true)
    int code;
    //提示信息
    @ApiModelProperty(value = "操作提示", example = "操作过于频繁!", required = true)
    String message;
    PartsInfoCode(boolean success, int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }
    private static final ImmutableMap<Integer, PartsInfoCode> CACHE;
 
    static {
        final ImmutableMap.Builder<Integer, PartsInfoCode> builder = ImmutableMap.builder();
        for (PartsInfoCode commonCode : values()) {
            builder.put(commonCode.code(), commonCode);
        }
        CACHE = builder.build();
    }
 
    @Override
    public boolean success() {
        return success;
    }
 
    @Override
    public int code() {
        return code;
    }
 
    @Override
    public String message() {
        return message;
    }
}