jinpengyong
2024-02-29 b8e97933ddcffb65754a82b9993e3a37097cc2d2
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
68
69
70
71
72
73
74
75
76
77
78
79
package com.moral.api.pojo.enums;
 
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.moral.api.exception.BusinessException;
import lombok.Getter;
 
import java.util.HashMap;
import java.util.Map;
 
/**
 * @ClassName InvestigationEnum
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-20 14:47
 * @Version 1.0
 */
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AllocationApproveEnum implements IntegerValueEnum{
    /**
     *草稿
     */
    DRAFT(9, "草稿"),
    /**
     *新建
     */
//    NEW_BUILT(10, "新建"),
    /**
     *整改中
     */
   // CHANGE(19, "整改"),
    /**
     *整改中
     */
    UNDER_RECTIFICATION(20, "整改"),
    /**
     *审批中
     */
    IN_APPROVAL(30, "审批中"),
    /**
     *通过
     */
    PASS(40, "通过"),
    /**
     *拒绝
     */
    REFUSE(50, "拒绝"),
 
    ;
 
    @EnumValue
    public  final Integer value;
    public  final String name;
 
    AllocationApproveEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
 
    private static Map<Integer, AllocationApproveEnum> valueMap = new HashMap<>();
    static {
        for (AllocationApproveEnum v : AllocationApproveEnum.values()) {
            valueMap.put(v.value, v);
        }
    }
    @JsonCreator
    public static AllocationApproveEnum getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        AllocationApproveEnum result = valueMap.get(value);
        if (result == null) {
            throw new BusinessException("枚举转换异常" + value);
        }
        return result;
    }
}