diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockFormEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockFormEnumUtil.java index 1d698a4..672767d 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockFormEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockFormEnumUtil.java @@ -501,6 +501,87 @@ public class BlockFormEnumUtil { } /** + * 元素类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum ELEMENT_TYPE { + GRID(1, "TABLE", "表格"), + TREE(2, "TREE", "树"); + + private int value; + private String code; + private String description; + + private ELEMENT_TYPE(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getCode() { + return code; + } + + public String getDescription() { + return description; + } + + public static String valueOfCode(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].code; + } + } + return tmp; + } + + public static int codeOfValue(String code) { + int tmp = 1; + for (int i = 0; i < values().length; i++) { + if (values()[i].code.equals(code)) { + tmp = values()[i].value; + } + } + return tmp; + } + + public static String valueOfDescription(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static ELEMENT_TYPE valueOf(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + return values()[i]; + } + } + return null; + } + + public static String codeOfDescription(String code) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].code.equals(code)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** * 元素删除信息 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) @@ -889,32 +970,57 @@ public class BlockFormEnumUtil { } /** - * 属性类型信息 + * 属性类型信息(属性转换器) + * + *
Form 核心转换器 + *
数据库字段类型转换Java 属性类型 + *
Java 属性 转换为控件类型 + *
*/ @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum PROPERTY_TYPE { - STRING(10, "String", "字符串", "java.lang.String", String.class), - CHAR(11, "Character", "单字符", "java.lang.Character", Character.class), - INTEGER(20, "Integer", "短整型", "java.lang.Integer", Integer.class), - LONG(21, "Long", "长整型", "java.lang.Long", Long.class), - DOUBLE(30, "Double", "大浮点型", "java.lang.Double", Double.class), - FLOAT(31, "Float", "小浮点型", "java.lang.Float", Float.class), - BOOLEAN(40, "Boolean", "布尔值", "java.lang.Boolean", Boolean.class), - BYTE(50, "Byte", "字节", "java.lang.Byte", Byte.class), - DATE(60, "Date", "日期", "java.sql.Timestamp", Date.class); - + STRING(10, "String", "字符串", "java.lang.String", String.class,PROPERTY_CONTROL_TYPE.TEXT), + CHAR(11, "Character", "单字符", "java.lang.Character", Character.class,PROPERTY_CONTROL_TYPE.TEXT), + INTEGER(20, "Integer", "短整型", "java.lang.Integer", Integer.class,PROPERTY_CONTROL_TYPE.NUMBER), + LONG(21, "Long", "长整型", "java.lang.Long", Long.class,PROPERTY_CONTROL_TYPE.NUMBER), + DOUBLE(30, "Double", "大浮点型", "java.lang.Double", Double.class,PROPERTY_CONTROL_TYPE.NUMBER), + FLOAT(31, "Float", "小浮点型", "java.lang.Float", Float.class,PROPERTY_CONTROL_TYPE.NUMBER), + BOOLEAN(40, "Boolean", "布尔值", "java.lang.Boolean", Boolean.class,PROPERTY_CONTROL_TYPE.RADIO), + BYTE(50, "Byte", "字节", "java.lang.Byte", Byte.class,PROPERTY_CONTROL_TYPE.TEXT), + DATE(60, "Date", "日期", "java.lang.String", String.class,PROPERTY_CONTROL_TYPE.DATE_TIME); + + /** + * 属性类型值 + */ private int value; + /** + * 属性类型代码 + */ private String code; + /** + * 属性类型描述 + */ private String description; + /** + * 属性类型ClassPath + */ private String classPath; + /** + * 属性类型 Class + */ private Class clzFullName; + /** + * 属性类型 对应的 控件类型 + */ + private PROPERTY_CONTROL_TYPE controlType; - private PROPERTY_TYPE(int value, String code, String description,String classPath,Class clzFullName) { + private PROPERTY_TYPE(int value, String code, String description,String classPath,Class clzFullName,PROPERTY_CONTROL_TYPE controlType) { this.value = value; this.code = code; this.description = description; this.classPath = classPath; this.clzFullName = clzFullName; + this.controlType = controlType; } public int getValue() { @@ -949,6 +1055,16 @@ public class BlockFormEnumUtil { return tmp; } + public static PROPERTY_CONTROL_TYPE valueOfControlType(int val) { + PROPERTY_CONTROL_TYPE tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].controlType; + } + } + return tmp; + } + public static int codeOfValue(String code) { int tmp = 1; for (int i = 0; i < values().length; i++) { diff --git a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElement.java b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElement.java index cfc903f..7bfc237 100644 --- a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElement.java +++ b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElement.java @@ -52,6 +52,10 @@ public class BfElement extends BaseBean { @ApiParam(value ="元素名称") private String elementName; + @Column(name="ELEMENT_CODE") + @ApiParam(value ="元素编码") + private String elementCode; + @Column(name="ELEMENT_ATTR_ID") @ApiParam(value ="默认排序属性") private String elementAttrId; diff --git a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementGrid.java b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementGrid.java index c80b7d9..69d0ca8 100644 --- a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementGrid.java +++ b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementGrid.java @@ -52,12 +52,8 @@ public class BfElementGrid extends BaseBean { @ApiParam(value = "是否删除") private Integer isObjectDel; - @Column(name = "ELEMENT_TYPE") - @ApiParam(value = "是否查询") - private Integer elementType; - @Column(name = "IS_OBJECT_FIND") - @ApiParam(value = "元素类型") + @ApiParam(value = "是否查询") private Integer isObjectFind; } diff --git a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementProperty.java b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementProperty.java index 94dfe6d..1b33377 100644 --- a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementProperty.java +++ b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementProperty.java @@ -47,6 +47,14 @@ public class BfElementProperty extends BaseBean { @JsonSerialize(using = ToStringSerializer.class) private Long dataObjectPropertyId; + @Column(name="PROPERTY_TYPE") + @ApiParam(value ="属性类型") + private Integer propertyType; + + @Column(name="PROPERTY_TYPE_NAME_RDD") + @ApiParam(value ="属性类型名称") + private String propertyTypeNameRdd; + @Column(name="PROPERTY_NAME") @ApiParam(value ="元素描述") private String propertyName; diff --git a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementPropertyVirtual.java b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementPropertyVirtual.java index 00e71ce..cd877fa 100644 --- a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementPropertyVirtual.java +++ b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementPropertyVirtual.java @@ -60,6 +60,11 @@ public class BfElementPropertyVirtual extends BaseBean { @Transient @ApiParam(value = "虚拟属性列表") - @AnnoOutputColumn(hidden = true) - private List detailList; + private List propertyList; + + @Transient + @ApiParam(value = "虚拟属性ID列表") + @JsonSerialize(using = ToStringSerializer.class) + private List propertyIdList; + } diff --git a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementTree.java b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementTree.java index bb7beda..8883376 100644 --- a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementTree.java +++ b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfElementTree.java @@ -13,6 +13,7 @@ import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; +import javax.persistence.Transient; /** * @Description : @@ -38,15 +39,18 @@ public class BfElementTree extends BaseBean { @Column(name = "TREE_PARENT_ID") @ApiParam(value = "父级属性ID") - private Integer treeParentId; + @JsonSerialize(using = ToStringSerializer.class) + private Long treeParentId; @Column(name = "TREE_ATTR_NAME_ID") @ApiParam(value = "显示属性ID") - private Integer treeAttrNameId; + @JsonSerialize(using = ToStringSerializer.class) + private Long treeAttrNameId; @Column(name = "TREE_ATTR_VALUE_ID") @ApiParam(value = "取值属性ID") - private Integer treeAttrValueId; + @JsonSerialize(using = ToStringSerializer.class) + private Long treeAttrValueId; @Column(name="TREE_DEFAULT_DIRECTION") @ApiParam(value ="树默认方向") @@ -55,4 +59,16 @@ public class BfElementTree extends BaseBean { @Column(name = "TREE_IS_DIRECTION") @ApiParam(value = "树是否开启切换方向") private Integer treeIsDirection; + + @Transient + @ApiParam(value = "父级属性") + private String treeParentIdStr; + + @Transient + @ApiParam(value = "显示属性") + private String treeAttrNameIdStr; + + @Transient + @ApiParam(value = "取值属性") + private String treeAttrValueIdStr; } diff --git a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfMethodDetailProperty.java b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfMethodDetailProperty.java index 1dbf45d..d73b51f 100644 --- a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfMethodDetailProperty.java +++ b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/bean/BfMethodDetailProperty.java @@ -26,7 +26,7 @@ import javax.persistence.Table; @DynamicInsert @DynamicUpdate @EqualsAndHashCode(callSuper = true) -@Table(name="BR_METHOD_DETAIL_PROPERTY") +@Table(name="BF_METHOD_DETAIL_PROPERTY") @Api(value="表单功能明细关联属性",description = "表单功能明细关联属性") public class BfMethodDetailProperty extends BaseBean { diff --git a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/sqlpack/FormHqlPack.java b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/sqlpack/FormHqlPack.java index 21c8c2a..6fdcbef 100644 --- a/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/sqlpack/FormHqlPack.java +++ b/modules/i3plus-pojo-form/src/main/java/cn/estsh/i3plus/pojo/form/sqlpack/FormHqlPack.java @@ -1,10 +1,7 @@ package cn.estsh.i3plus.pojo.form.sqlpack; import cn.estsh.i3plus.pojo.base.tool.HqlPack; -import cn.estsh.i3plus.pojo.form.bean.BfLayout; -import cn.estsh.i3plus.pojo.form.bean.BfLayoutRow; -import cn.estsh.i3plus.pojo.form.bean.BfMenu; -import cn.estsh.i3plus.pojo.form.bean.BfMethod; +import cn.estsh.i3plus.pojo.form.bean.*; import org.apache.commons.lang3.StringUtils; /** @@ -63,32 +60,31 @@ public final class FormHqlPack { /** * 根据表单布局查询表单布局行 - * @param bfLayout 表单布局 + * @param bfLayoutRow 表单布局 * @return hql */ - public static String packHqlBfLayoutRowByBfLayout(BfLayout bfLayout) { + public static String packHqlBfLayoutRow(BfLayoutRow bfLayoutRow) { StringBuffer result = new StringBuffer(); - HqlPack.getNumEqualPack(bfLayout.getId(), "layoutId", result); - HqlPack.getNumEqualPack(bfLayout.getIsDeleted(), "isDeleted", result); + HqlPack.getNumEqualPack(bfLayoutRow.getLayoutId(), "layoutId", result); + HqlPack.getNumEqualPack(bfLayoutRow.getIsDeleted(), "isDeleted", result); - result.append(bfLayout.orderBy()); + result.append(bfLayoutRow.orderBy()); return result.toString(); } /** * 根据表单布局行查询表单布局列 - * @param bfLayoutRow 表单布局行 + * @param bfLayoutColumn 表单布局行 * @return hql */ - public static String packHqlBfLayoutColumnByBfLayoutRow(BfLayoutRow bfLayoutRow) { + public static String packHqlBfLayoutColumn(BfLayoutColumn bfLayoutColumn) { StringBuffer result = new StringBuffer(); - HqlPack.getNumEqualPack(bfLayoutRow.getLayoutId(), "layoutId", result); - HqlPack.getNumEqualPack(bfLayoutRow.getId(), "layoutRowId", result); - HqlPack.getNumEqualPack(bfLayoutRow.getIsDeleted(), "isDeleted", result); + HqlPack.getNumEqualPack(bfLayoutColumn.getLayoutRowId(), "layoutRowId", result); + HqlPack.getNumEqualPack(bfLayoutColumn.getIsDeleted(), "isDeleted", result); - result.append(bfLayoutRow.orderBy()); + result.append(bfLayoutColumn.orderBy()); return result.toString(); } @@ -103,6 +99,7 @@ public final class FormHqlPack { HqlPack.getStringLikerPack(bfMenu.getMenuName(), "menuName", result); HqlPack.getNumEqualPack(bfMenu.getParentId(), "parentId", result); HqlPack.getNumEqualPack(bfMenu.getIsDeleted(), "isDeleted", result); + result.append(bfMenu.orderBy()); return result.toString(); } @@ -118,6 +115,23 @@ public final class FormHqlPack { HqlPack.getStringLikerPack(bfMethod.getMethodName(), "methodName", result); HqlPack.getNumEqualPack(bfMethod.getLayoutId(), "layoutId", result); HqlPack.getNumEqualPack(bfMethod.getIsDeleted(), "isDeleted", result); + result.append(bfMethod.orderBy()); + + return result.toString(); + } + + /** + * 表单拦截器复杂查询 + * @param bfIntercept 查询条件 + * @return hql + */ + public static String packHqlBfIntercept(BfIntercept bfIntercept) { + StringBuffer result = new StringBuffer(); + + HqlPack.getStringLikerPack(bfIntercept.getInterceptName(), "interceptName", result); + HqlPack.getNumEqualPack(bfIntercept.getExecuteMode(), "executeMode", result); + HqlPack.getNumEqualPack(bfIntercept.getIsDeleted(), "isDeleted", result); + result.append(bfIntercept.orderBy()); return result.toString(); } diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/ElementModel.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/ElementModel.java new file mode 100644 index 0000000..b87214e --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/ElementModel.java @@ -0,0 +1,40 @@ +package cn.estsh.i3plus.pojo.model.form; + +import cn.estsh.i3plus.pojo.form.bean.*; +import io.swagger.annotations.ApiParam; +import lombok.Data; + +import java.util.List; + +/** + * @Description : 元素Model + * @Reference : 元素整体封装 + * @Author : Adair Peng + * @CreateDate : 2019-03-21 13:14 + * @Modify: + **/ +@Data +public class ElementModel{ + + @ApiParam(value = "元素基础信息") + private BfElement element; + + @ApiParam(value = "元素Tree信息") + private BfElementTree elementTree; + + @ApiParam(value = "元素Grid信息") + private BfElementGrid elementGrid; + + @ApiParam(value = "元素基础属性信息") + private List propertyList; + + @ApiParam(value = "元素基础虚拟属性信息") + private List virtualList; + + @ApiParam(value = "数据对象信息") + private BfDataObject dataObject; + + @ApiParam(value = "元素类型") + private Integer elementType; + +}