模板管理优化
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
package com.ruoyi.common.enums;
|
||||
|
||||
import com.ruoyi.common.interfaces.EnumsInterface;
|
||||
|
||||
/**
|
||||
* @Classname AnnexTypeEnum
|
||||
* @Description 附件类型枚举
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/1/12 17:50
|
||||
* @Created wangqiong
|
||||
*/
|
||||
public enum TemplateTypeEnum implements EnumsInterface {
|
||||
MEDIATION_APPLICATION(1, "调解申请书模板"),
|
||||
MEDIATION_AGREEMENT(2, "和解协议模板"),
|
||||
MEDIATE_BOOK(3, "调解书模板"),
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
private final String text;
|
||||
|
||||
TemplateTypeEnum(Integer code, String text)
|
||||
{
|
||||
this.code = code;
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public Integer getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getText()
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取text
|
||||
* @param codeNo
|
||||
* @return
|
||||
*/
|
||||
public static String getTextByCode(Integer codeNo){
|
||||
for (TemplateTypeEnum value : TemplateTypeEnum.values()) {
|
||||
if (value.getCode().equals(codeNo)){
|
||||
return value.getText();
|
||||
}
|
||||
}
|
||||
return codeNo.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据text获取code
|
||||
* @param textStr
|
||||
* @return
|
||||
*/
|
||||
public static String getCodeByText(String textStr){
|
||||
for (TemplateTypeEnum value : TemplateTypeEnum.values()) {
|
||||
if (value.getText().equals(textStr)){
|
||||
return value.getText();
|
||||
}
|
||||
}
|
||||
return textStr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user