自定义表单 数据对象 新增接口完成

yun-zuoyi
wei.peng 6 years ago
parent e4a3b95f16
commit e4adb35413

@ -46,8 +46,10 @@ public class DynamicBean {
* @param value * @param value
*/ */
public void setValue(String property, Object value) { public void setValue(String property, Object value) {
if(!beanMap.containsKey(property)){
beanMap.put(property, value); beanMap.put(property, value);
} }
}
/** /**
* *

@ -14,6 +14,7 @@ import java.lang.reflect.Method;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -158,6 +159,16 @@ public class DynamicEntity extends BaseBean implements Serializable {
fieldVal = 0.0f; fieldVal = 0.0f;
} else if (f.getType() == Double.class) { } else if (f.getType() == Double.class) {
fieldVal = 0.0d; fieldVal = 0.0d;
} else if (f.getType() == String.class) {
fieldVal = "";
}else if (f.getType() == Character.class) {
fieldVal = "";
}else if (f.getType() == Boolean.class) {
fieldVal = true;
}else if (f.getType() == Byte.class) {
fieldVal = 0;
}else if (f.getType() == Date.class) {
fieldVal = new Date();
}else { }else {
fieldVal = ""; fieldVal = "";
} }
@ -165,13 +176,24 @@ public class DynamicEntity extends BaseBean implements Serializable {
try { try {
setMethod = this.getClass().getDeclaredMethod(setMethodName, new Class[]{f.getType()}); setMethod = this.getClass().getDeclaredMethod(setMethodName, new Class[]{f.getType()});
System.out.println("Method Name:" + setMethod.getName() + "\t\t Value : " + fieldVal);
setMethod.invoke(this, fieldVal); setMethod.invoke(this, fieldVal);
} catch (ClassCastException e) {
e.printStackTrace();
LOGGER.error("ClassCastException {}", setMethodName, e);
} catch (IllegalArgumentException e) {
e.printStackTrace();
LOGGER.error("IllegalArgumentException {}", setMethodName, e);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
LOGGER.error("没有方法:{}", setMethodName, e); LOGGER.error("没有方法:{}", setMethodName, e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
LOGGER.error("入参出错:{}:{}:{}", f, f.getType(), fieldVal, e); LOGGER.error("入参出错:{}:{}:{}", f, f.getType(), fieldVal, e);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
LOGGER.error("方法返回出错:{}", setMethodName, e); LOGGER.error("方法返回出错:{}", setMethodName, e);
}catch (RuntimeException e) {
LOGGER.error("RuntimeException {}", setMethodName, e);
}catch (Exception e) {
LOGGER.error("Exception {}", setMethodName, e);
} }
} }
} }

@ -1,6 +1,9 @@
package cn.estsh.i3plus.pojo.base.enumutil; package cn.estsh.i3plus.pojo.base.enumutil;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import javafx.scene.chart.Chart;
import java.util.Date;
/** /**
* @Description : * @Description :
@ -805,7 +808,7 @@ public class BlockFormEnumUtil {
* *
*/ */
@JsonFormat(shape = JsonFormat.Shape.OBJECT) @JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PROPERTY_VIRTUAL_TYPE { public enum PROPERTY_VIRTUAL_OPERATE_TYPE {
STRING_SPLICE(10, "SPLICE", "字符串拼接"), STRING_SPLICE(10, "SPLICE", "字符串拼接"),
NUM_ADD(20, "ADD", "加法计算"), NUM_ADD(20, "ADD", "加法计算"),
NUM_LESS(30, "MIN", "减法计算"), NUM_LESS(30, "MIN", "减法计算"),
@ -816,7 +819,7 @@ public class BlockFormEnumUtil {
private String code; private String code;
private String description; private String description;
private PROPERTY_VIRTUAL_TYPE(int value, String code, String description) { private PROPERTY_VIRTUAL_OPERATE_TYPE(int value, String code, String description) {
this.value = value; this.value = value;
this.code = code; this.code = code;
this.description = description; this.description = description;
@ -864,7 +867,7 @@ public class BlockFormEnumUtil {
return tmp; return tmp;
} }
public static PROPERTY_VIRTUAL_TYPE valueOf(int val) { public static PROPERTY_VIRTUAL_OPERATE_TYPE valueOf(int val) {
String tmp = null; String tmp = null;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) { if (values()[i].value == val) {
@ -890,24 +893,28 @@ public class BlockFormEnumUtil {
*/ */
@JsonFormat(shape = JsonFormat.Shape.OBJECT) @JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PROPERTY_TYPE { public enum PROPERTY_TYPE {
STRING(10, "String", "字符串"), STRING(10, "String", "字符串", "java.lang.String", String.class),
CHAR(11, "Character", "单字符"), CHAR(11, "Character", "单字符", "java.lang.Character", Character.class),
INTEGER(20, "Integer", "短整型"), INTEGER(20, "Integer", "短整型", "java.lang.Integer", Integer.class),
LONG(21, "Long", "长整型"), LONG(21, "Long", "长整型", "java.lang.Long", Long.class),
DOUBLE(30, "Double", "大浮点型"), DOUBLE(30, "Double", "大浮点型", "java.lang.Double", Double.class),
FLOAT(31, "Float", "小浮点型"), FLOAT(31, "Float", "小浮点型", "java.lang.Float", Float.class),
BOOLEAN(40, "Boolean", "布尔值"), BOOLEAN(40, "Boolean", "布尔值", "java.lang.Boolean", Boolean.class),
BYTE(50, "Byte", "字节"), BYTE(50, "Byte", "字节", "java.lang.Byte", Byte.class),
DATE(60, "Date", "日期"); DATE(60, "Date", "日期", "java.sql.Timestamp", Date.class);
private int value; private int value;
private String code; private String code;
private String description; private String description;
private String classPath;
private Class clzFullName;
private PROPERTY_TYPE(int value, String code, String description) { private PROPERTY_TYPE(int value, String code, String description,String classPath,Class clzFullName) {
this.value = value; this.value = value;
this.code = code; this.code = code;
this.description = description; this.description = description;
this.classPath = classPath;
this.clzFullName = clzFullName;
} }
public int getValue() { public int getValue() {
@ -932,6 +939,16 @@ public class BlockFormEnumUtil {
return tmp; return tmp;
} }
public static Class valueOfClzFullName(int val) {
Class tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].clzFullName;
}
}
return tmp;
}
public static int codeOfValue(String code) { public static int codeOfValue(String code) {
int tmp = 1; int tmp = 1;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
@ -942,6 +959,16 @@ public class BlockFormEnumUtil {
return tmp; return tmp;
} }
public static int codeOfClassPath(String classPath) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].classPath.equals(classPath)) {
tmp = values()[i].value;
}
}
return tmp;
}
public static String valueOfDescription(int val) { public static String valueOfDescription(int val) {
String tmp = null; String tmp = null;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {

@ -67,4 +67,5 @@ public class BfDataObject extends BaseBean {
@ApiParam(value = "数据对象属性") @ApiParam(value = "数据对象属性")
@AnnoOutputColumn(hidden = true) @AnnoOutputColumn(hidden = true)
private List<BfDataObjectProperty> propertyList; private List<BfDataObjectProperty> propertyList;
} }

@ -64,6 +64,10 @@ public class BfDataObjectProperty extends BaseBean {
@ApiParam(value ="属性类型") @ApiParam(value ="属性类型")
private Integer propertyType; private Integer propertyType;
@Column(name="PROPERTY_TYPE_NAME_RDD")
@ApiParam(value ="属性类型名称")
private String propertyTypeNameRdd;
@Column(name="PROPERTY_DESCRIPTION") @Column(name="PROPERTY_DESCRIPTION")
@ApiParam(value ="属性描述") @ApiParam(value ="属性描述")
private String propertyDescription; private String propertyDescription;

@ -38,7 +38,7 @@ public class BfElementPropertyVirtual extends BaseBean {
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long elementId; private Long elementId;
@Column(name = "PROPERTY_VIRTUAL_TYPE") @Column(name = "PROPERTY_VIRTUAL_OPERATE_TYPE")
@ApiParam(value = "虚拟元素类型") @ApiParam(value = "虚拟元素类型")
private Integer propertyVirtualType; private Integer propertyVirtualType;

@ -48,5 +48,10 @@ public class SqlColumnModel {
// 字段Java 类型 // 字段Java 类型
@ApiParam(value = "字段Java 类型") @ApiParam(value = "字段Java 类型")
private String columnClassName; private String columnClassName;
// 字段Java 类型
@ApiParam(value = "枚举:BlockFormEnumUtil.PROPERTY_TYPE")
private Integer columnClassType;
} }

Loading…
Cancel
Save