From dd9c35e6e17f026c15b90d1f86a5dc97c80afcc9 Mon Sep 17 00:00:00 2001 From: "wei.peng" Date: Sat, 19 Jan 2019 11:00:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BFPojo=20=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=20=E6=9E=9A=E4=B8=BE=20=E6=B7=BB=E5=8A=A0=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9E=9A=E4=B8=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/base/enumutil/BlockReportEnumUtil.java | 196 +++++++++++++++++++++ .../estsh/i3plus/pojo/report/bean/BrTemplate.java | 4 + 2 files changed, 200 insertions(+) diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockReportEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockReportEnumUtil.java index 97c8fad..4a09da5 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockReportEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockReportEnumUtil.java @@ -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 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; + } + } + } diff --git a/modules/i3plus-pojo-report/src/main/java/cn/estsh/i3plus/pojo/report/bean/BrTemplate.java b/modules/i3plus-pojo-report/src/main/java/cn/estsh/i3plus/pojo/report/bean/BrTemplate.java index 3ad76f8..2cd232d 100644 --- a/modules/i3plus-pojo-report/src/main/java/cn/estsh/i3plus/pojo/report/bean/BrTemplate.java +++ b/modules/i3plus-pojo-report/src/main/java/cn/estsh/i3plus/pojo/report/bean/BrTemplate.java @@ -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;