zhangherong
2025-06-25 23855599412c4d61b38d78f0f3abd3430a48b5b1
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/response/PartsInfoCode.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,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;
    }
}