package com.vci.frameworkcore.lcstatuspck;
|
|
|
import com.vci.starter.web.annotation.VciLifeCycle;
|
import com.vci.starter.web.annotation.VciLifeCycleTrans;
|
import com.vci.starter.web.constant.FrameWorkLcStatusConstant;
|
import com.vci.starter.web.enumpck.BaseEnum;
|
|
import static com.vci.constant.FrameWorkDefaultValueConstant.*;
|
|
/**
|
* 发布生命周期
|
* @author weidy
|
* @date 2020/1/2
|
*/
|
@VciLifeCycle(name= FrameWorkLcStatusConstant.RELEASE_LIFE_CYCLE,text = "发布通用生命周期",startStatus = FRAMEWORK_RELEASE_EDITING,
|
translations = {
|
@VciLifeCycleTrans(source = FRAMEWORK_RELEASE_EDITING, target = FRAMEWORK_RELEASE_AUDITING,name="提交审批"),
|
@VciLifeCycleTrans(source = FRAMEWORK_RELEASE_AUDITING, target =FRAMEWORK_RELEASE_RELEASED,name="审批通过"),
|
@VciLifeCycleTrans(source =FRAMEWORK_RELEASE_EDITING, target = FRAMEWORK_RELEASE_RELEASED,name="直接发布")
|
})
|
public enum ReleaseDataLCStatus implements BaseEnum {
|
/**
|
* 编辑中
|
*/
|
EDITING(FRAMEWORK_RELEASE_EDITING,"编辑中"),
|
|
/**
|
* 审批中
|
*/
|
AUDITING(FRAMEWORK_RELEASE_AUDITING,"审批中"),
|
|
/**
|
* 已发布
|
*/
|
RELEASED(FRAMEWORK_RELEASE_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 "";
|
}
|
}
|