ludc
2024-10-15 aecacfb404d19749260189ab1d4ee90efc92ae24
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package com.vci.web.lifeCycle;
 
import com.vci.starter.web.annotation.VciLifeCycle;
import com.vci.starter.web.annotation.VciLifeCycleTrans;
import com.vci.starter.web.enumpck.BaseEnum;
 
/**
 * 发布生命周期
 * @author weidy
 * @date 2020/1/2
 */
@VciLifeCycle(name= "releaseLC",text = "发布通用生命周期",startStatus = "Editing",
        translations = {
                @VciLifeCycleTrans(source = "Editing", target = "Auditing",name="提交审批"),
                @VciLifeCycleTrans(source = "Auditing", target ="Released",name="审批通过"),
                @VciLifeCycleTrans(source = "Auditing", target ="Editing",name="审批不通过"),
                @VciLifeCycleTrans(source ="Editing", target = "Released",name="直接生效")
        })
public enum ReleaseDataLCStatus implements BaseEnum {
    /**
     * 编辑中
     */
    EDITING("Editing","编辑中"),
 
    /**
     * 审批中
     */
    AUDITING("Auditing","审批中"),
 
    /**
     * 已发布
     */
    RELEASED("Released","已发布");
 
    /**
     * 枚举值
     */
    private String value;
 
    /**
     * 枚举显示值
     */
    private String text;
    /**
     * 获取枚举值
     * @return 枚举值
     */
    @Override
    public String getValue() {
        return value;
    }
 
    /**
     * 设置枚举值
     * @param value 枚举值
     */
    public void setValue(String value) {
        this.value = value;
    }
 
    /**
     * 获取显示文本
     * @return 显示文本
     */
    @Override
    public String getText() {
        return text;
    }
 
    /**
     * 设置显示文本
     * @param text 显示文本
     */
    public void setText(String text) {
        this.text = text;
    }
 
    /**
     * 枚举内部构造方法
     * @param value 枚举值
     * @param text 显示文本
     */
    private ReleaseDataLCStatus(String value, String text){
        this.value = value;
        this.text = text;
    }
 
    /**
     * 根据枚举的值获取显示文本
     * @param value 枚举值
     * @return 显示文本
     */
    public static String getTextByValue(String value){
        for(ReleaseDataLCStatus eu:ReleaseDataLCStatus.values()){
            if(eu.value.equalsIgnoreCase(value)){
                return eu.text;
            }
        }
        return "";
    }
 
    /**
     * 根据枚举显示文本获取枚举值
     * @param text 显示文本
     * @return 枚举值
     */
    public static String getValueByText(String text){
        for(ReleaseDataLCStatus eu:ReleaseDataLCStatus.values()){
            if(eu.text.equalsIgnoreCase(text)){
                return eu.value;
            }
        }
        return "";
    }
}