模板Pojo 调整

模板 枚举 添加
添加枚举接口
yun-zuoyi
wei.peng 6 years ago
parent c5f3897bc9
commit dd9c35e6e1

@ -2,6 +2,9 @@ package cn.estsh.i3plus.pojo.base.enumutil;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.ArrayList;
import java.util.List;
/**
* @Description :
* @Reference :
@ -199,6 +202,141 @@ public class BlockReportEnumUtil {
}
/**
*
* 1
* 2
* 3
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TEMPLATE_TYPE {
TABLE(1, "表格", "表格模板");
private int value;
private String name;
private String description;
TEMPLATE_TYPE() {
}
TEMPLATE_TYPE(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].getName();
}
}
return tmp;
}
public static TEMPLATE_TYPE enumOf(int val) {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TEMPLATE_STYLE {
TABLE_LEFT(1, TEMPLATE_TYPE.TABLE, "left", "表单左对齐"),
TABLE_RIGHT(2, TEMPLATE_TYPE.TABLE, "right", "表单右对齐"),
TABLE_CENTER(3, TEMPLATE_TYPE.TABLE, "center", "表单居中");
private int value;
private TEMPLATE_TYPE group;
private String name;
private String description;
TEMPLATE_STYLE() {
}
TEMPLATE_STYLE(int value,TEMPLATE_TYPE group, String name, String description) {
this.value = value;
this.group = group;
this.name = name;
this.description = description;
}
public static TEMPLATE_STYLE[] getGroup(TEMPLATE_TYPE type){
if(type != null){
List<TEMPLATE_STYLE> list = new ArrayList<>();
for (TEMPLATE_STYLE style : TEMPLATE_STYLE.values()) {
if(style.group.equals(type)){
list.add(style);
}
}
return list.toArray(new TEMPLATE_STYLE[list.size()]);
}
return null;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].getName();
}
}
return tmp;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
* HQL WHERE
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@ -320,6 +458,9 @@ public class BlockReportEnumUtil {
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HQL_AGGREGATION{
@ -375,4 +516,59 @@ public class BlockReportEnumUtil {
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HQL_ORDER{
ASC(1, "ASC", "升序"),
DESC(2, "DESC", "降序");
private int value;
private String name;
private String description;
HQL_ORDER() {
}
HQL_ORDER(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].getName();
}
}
return tmp;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
}

@ -84,6 +84,10 @@ public class BrTemplate extends BaseBean {
@ApiParam(value ="模板描述" , access ="模板描述")
private String templateDescription;
@Column(name="TEMPLATE_HQL",columnDefinition = "TEXT")
@ApiParam(value ="模板执行HQL" , access ="模板执行HQL")
private String templateHql;
@Column(name="TEMPLATE_HTML",columnDefinition = "TEXT")
@ApiParam(value ="模板HTML" , access ="模板HTML")
private String templateHtml;

Loading…
Cancel
Save