lyh
2025-01-16 1d84a3c62eeee429f7d7d6339bcf9b504a9d7277
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 ComponentInfoCode implements ResultCode {
    COMPONENT_PARENT_NOT_EXIST(false, 25101, "指定的父节点不存在!"),
    COMPONENT_NAME_NONE(false, 25102, "请输入部件名称!"),
    COMPONENT_PRODUCT_NONE(false, 25103, "请选择产品!"),
    COMPONENT_NOT_EXIST(false, 25104, "部件不存在!"),
    COMPONENT_USER_NOT_PERM(false, 25105, "没有该部件的权限!"),
    COMPONENT_DELETE_ERROR(false, 25106, "删除失败!"),
    COMPONENT_DELETE_PERM_NONE(false, 25107, "没有删除权限!"),
    COMPONENT_CHILD_EXIST(false, 25108, "部件存在子部件!"),
    COMPONENT_PARTS_EXIST(false, 25109, "部件有关联的零件信息!"),
    COMPONENT_PROCESS_EXIST(false, 25110, "部件有关联的工序信息!"),
    COMPONENT_CODE_NONE(false, 25111, "请输入部件代号!"),
    COMPONENT_IS_EXIST(false, 25112, "部件已存在!"),
    COMPONENT_PN_NOT_VALID(false, 25113, "PN码不合法!"),
    COMPONENT_PN_NOT_EXIST(false, 25114, "不存在该PN码对应的部件或零件!"),
    COMPONENT_PN_NOT_ONLY(false, 25115, "PN码不唯一!"),
    COMPONENT_USER_NONE(false,25016,"部件无法清空用户权限,请至少保留一位可操作用户!");
 
    //操作代码
    @ApiModelProperty(value = "操作是否成功", example = "true", required = true)
    boolean success;
 
    //操作代码
    @ApiModelProperty(value = "操作代码", example = "22001", required = true)
    int code;
    //提示信息
    @ApiModelProperty(value = "操作提示", example = "操作过于频繁!", required = true)
    String message;
    private ComponentInfoCode(boolean success, int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }
    private static final ImmutableMap<Integer, ComponentInfoCode> CACHE;
 
    static {
        final ImmutableMap.Builder<Integer, ComponentInfoCode> builder = ImmutableMap.builder();
        for (ComponentInfoCode 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;
    }
}