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
66
67
package org.jeecg.modules.dnc.response;
 
import com.google.common.collect.ImmutableMap;
import io.swagger.annotations.ApiModelProperty;
import lombok.ToString;
 
@ToString
public enum  ActivitiCode implements ResultCode {
    ACT_APPLY_USER_NONE(false,21001,"申请人不能为空!"),
    ACT_APPROVE_USERS_NONE(false,21002,"请先指定部门审批人!"),
    ACT_BUSINESS_SAVE_ERROR(false,21003,"启动流程失败,申请的业务数据存在问题!"),
    ACT_ASSIGN_DEVICE_NONE(false,21004,"指派的设备不存在!"),
    ACT_NODE_DEPART_NONE(false,21005,"请先指定节点所属部门!"),
    ACT_USER_NOT_PERM(false,21006,"用户没有指派该文件的权限!"),
    ACT_APPLY_ERROR(false,21007,"启动流程失败!"),
    ACT_PROC_INST_ERROR(false, 21008, "获取流程实例失败!"),
    ACT_BUSINESS_DETAIL_ERROR(false, 21009, "获取审批数据失败!"),
    ACT_STATUS_ERROR(false, 21010, "审批状态非法"),
    ACT_TASK_ERROR(false, 21011, "获取任务失败,该任务已被审批!"),
    ACT_APPROVE_ERROR(false, 21012, "审批失败!"),
    ACT_FILE_ERROR(false, 21013, "指派的文件不存在!"),
    ACT_DOC_ID_NONE(false, 21014, "文档编号不存在!"),
    ACT_DOC_ERROR(false,21015,"启动流程失败,文档信息错误!"),
    ACT_DEVICE_DOC_ERROR(false,21016,"启动流程失败,设备已存在该文档!"),
    ACT_DOC_ERROR_DELEVE(false,21017,"启动流程失败,重复数据删除失败!"),
    ACT_DEVICE_DOC_FILELABLE(false,21018,"密标系统异常,!");
 
    //操作代码
    @ApiModelProperty(value = "操作是否成功", example = "true", required = true)
    boolean success;
 
    //操作代码
    @ApiModelProperty(value = "操作代码", example = "22001", required = true)
    int code;
    //提示信息
    @ApiModelProperty(value = "操作提示", example = "操作过于频繁!", required = true)
    String message;
    ActivitiCode(boolean success, int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }
    private static final ImmutableMap<Integer, ActivitiCode> CACHE;
 
    static {
        final ImmutableMap.Builder<Integer, ActivitiCode> builder = ImmutableMap.builder();
        for (ActivitiCode 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;
    }
}