package com.vci.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
|
*/
|
@VciLifeCycle(name= FrameWorkLcStatusConstant.FRAME_WORK_LIFE_CYCLE_NAME,text = "平台基础数据通用生命周期",startStatus = FRAMEWORK_DATA_ENABLED,
|
translations = {
|
@VciLifeCycleTrans(source = FRAMEWORK_DATA_ENABLED, target = FRAMEWORK_DATA_DISABLED,name="停用"),
|
@VciLifeCycleTrans(source = FRAMEWORK_DATA_DISABLED, target =FRAMEWORK_DATA_ENABLED,name="启用")
|
})
|
public enum FrameworkDataLCStatus implements BaseEnum {
|
|
|
/**
|
* 启用
|
*/
|
ENABLED(FRAMEWORK_DATA_ENABLED,"启用"),
|
|
/**
|
* 停用
|
*/
|
DISABLED(FRAMEWORK_DATA_DISABLED,"停用");
|
|
/**
|
* 枚举值
|
*/
|
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 FrameworkDataLCStatus(String value, String text){
|
this.value = value;
|
this.text = text;
|
}
|
|
/**
|
* 根据枚举的值获取显示文本
|
* @param value 枚举值
|
* @return 显示文本
|
*/
|
public static String getTextByValue(String value){
|
for(FrameworkDataLCStatus eu:FrameworkDataLCStatus.values()){
|
if(eu.value.equalsIgnoreCase(value)){
|
return eu.text;
|
}
|
}
|
return "";
|
}
|
|
/**
|
* 根据枚举显示文本获取枚举值
|
* @param text 显示文本
|
* @return 枚举值
|
*/
|
public static String getValueByText(String text){
|
for(FrameworkDataLCStatus eu:FrameworkDataLCStatus.values()){
|
if(eu.text.equalsIgnoreCase(text)){
|
return eu.value;
|
}
|
}
|
return "";
|
}
|
|
}
|