自定义表单拦截器开发1.1完成

优化动态表单页面接口
yun-zuoyi
wei.peng 6 years ago
parent 3a704f8542
commit 97e992f05f

@ -1,9 +1,11 @@
package cn.estsh.i3plus.pojo.base.dynamic;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.Transient;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@ -28,6 +30,8 @@ public class DynamicEntity extends BaseBean implements Serializable {
public String tableName;
public List<String> propertyList;
@ApiParam(value ="子集列表")
private List<DynamicEntity> childList = new ArrayList<>();
public DynamicEntity(){
try {
@ -42,13 +46,6 @@ public class DynamicEntity extends BaseBean implements Serializable {
this.tableName = tableName;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
/**
* 便
@ -60,8 +57,7 @@ public class DynamicEntity extends BaseBean implements Serializable {
Field[] fields = this.getClass().getDeclaredFields();
for(Field f : fields) {
String propName = f.getName().replace(ATTR_PREFIX, "");
if(!"LOGGER".equals(propName) && !"ATTR_PREFIX".equals(propName)
&& !"propertyList".equals(propName) && !"dynProperty".equals(propName) ) {
if (!isDefaultField(propName)) {
// 添加到属性list中
this.getPropertyList().add(propName);
// 属性初始化
@ -77,8 +73,7 @@ public class DynamicEntity extends BaseBean implements Serializable {
Field[] fields = this.getClass().getDeclaredFields();
for(Field f : fields) {
String fieldName = f.getName().replace(ATTR_PREFIX, "");
if (!"LOGGER".equals(fieldName) && !"ATTR_PREFIX".equals(fieldName)
&& !"propertyList".equals(fieldName) && !"dynProperty".equals(fieldName)) {
if (!isDefaultField(fieldName)) {
result += "\"" + fieldName + "\":\"" + getDynProperty(fieldName) + "\",";
}
@ -92,7 +87,6 @@ public class DynamicEntity extends BaseBean implements Serializable {
return result;
}
public void setDynProperty(Map<String,Object> params) {
if (params != null && params.size() > 0){
params.forEach((k,v)->{{
@ -140,14 +134,6 @@ public class DynamicEntity extends BaseBean implements Serializable {
return getValue(propName,result);
}
public List<String> getPropertyList() {
return propertyList;
}
public void setPropertyList(List<String> propertyList) {
this.propertyList = propertyList;
}
/**
*
* @param propName
@ -188,4 +174,43 @@ public class DynamicEntity extends BaseBean implements Serializable {
return val;
}
/**
*
* @param fieldName
* @return
*/
public boolean isDefaultField(String fieldName){
if (!ATTR_PREFIX.equals(fieldName)) {
if("propertyList".equals(fieldName) || "dynProperty".equals(fieldName) || "childList".equals(fieldName)
|| "LOGGER".equals(fieldName)){
return true;
}
}
return false;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public List<String> getPropertyList() {
return propertyList;
}
public void setPropertyList(List<String> propertyList) {
this.propertyList = propertyList;
}
public List<DynamicEntity> getChildList() {
return childList;
}
public void setChildList(List<DynamicEntity> childList) {
this.childList = childList;
}
}

@ -832,6 +832,7 @@ public class BlockFormEnumUtil {
PASSWORD(230, "PASSWORD", "密码"),
DATE(300, "DATE", "日期(yyyy-MM-dd)"),
DATE_TIME(310, "DATE_TIME", "时间(yyyy-MM-dd hh:mm:ss)"),
// ELEMENT(700, "DICT_SELECT", "元素"),
DICTIONARY(800, "DICT_SELECT", "字典"),
CASCADE(900, "CASCADE", "级联");
//FILE(400, "file", "文件"),

@ -115,10 +115,9 @@ public class BfElementProperty extends BaseBean {
@ApiParam(value = "控件显示格式")
private String propertyControlFormat;
@Column(name = "PROPERTY_CONTROL_REF_ID")
@ApiParam(value = "控件引用RefId")
@JsonSerialize(using = ToStringSerializer.class)
private Long propertyControlRefId;
@Column(name = "PROPERTY_CONTROL_REF_KEY")
@ApiParam(value = "控件引用RefKey")
private String propertyControlRefKey;
@Column(name = "PROPERTY_DESCRIPTION")
@ApiParam(value = "属性描述")

@ -52,6 +52,10 @@ public class BfElementTree extends BaseBean {
@JsonSerialize(using = ToStringSerializer.class)
private Long treeAttrValueId;
@Column(name="TREE_IS_OPEN_ALL")
@ApiParam(value ="是否全部展开")
private Integer treeIsOpenAll;
@Column(name="TREE_DEFAULT_DIRECTION")
@ApiParam(value ="树默认方向")
private Integer treeDefaultDirection;

@ -1,9 +1,6 @@
package cn.estsh.i3plus.pojo.model.form;
import cn.estsh.i3plus.pojo.form.bean.BfButton;
import cn.estsh.i3plus.pojo.form.bean.BfLayout;
import cn.estsh.i3plus.pojo.form.bean.BfMethod;
import cn.estsh.i3plus.pojo.form.bean.BfMethodDetail;
import cn.estsh.i3plus.pojo.form.bean.*;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -54,4 +51,6 @@ public class FormModel {
@ApiParam(value = "元素Model")
private List<ElementModel> elementModelList;
@ApiParam(value = "表单功能明细关联属性")
private List<BfMethodDetailProperty> methodDetailPropertyRefList;
}

Loading…
Cancel
Save