zhangherong
2025-06-25 23855599412c4d61b38d78f0f3abd3430a48b5b1
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/response/ComponentInfoCode.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
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_DOC_EXIST(false, 251111, "部件有关联的文档信息!"),
    COMPONENT_CODE_NONE(false, 25112, "请输入部件代号!"),
    COMPONENT_IS_EXIST(false, 25113, "部件已存在!"),
    COMPONENT_BORROW_EXIST(false, 25114, "部件已被借用,请先删除借用再删除!"),
    COMPONENT_PN_NOT_VALID(false, 25115, "PN码不合法!"),
    COMPONENT_PN_NOT_EXIST(false, 25116, "不存在该PN码对应的部件或零件!"),
    COMPONENT_PN_NOT_ONLY(false, 25117, "PN码不唯一!"),
    COMPONENT_USER_NONE(false,25018,"部件无法清空用户权限,请至少保留一位可操作用户!");
    //操作代码
    @ApiModelProperty(value = "操作是否成功", example = "true", required = true)
    boolean success;
    //操作代码
    @ApiModelProperty(value = "操作代码", example = "22001", required = true)
    int code;
    //提示信息
    @ApiModelProperty(value = "操作提示", example = "操作过于频繁!", required = true)
    String message;
    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;
    }
}