yun-zuoyi
yihang.lv 6 years ago
commit 6e8e425f1e

9
.gitignore vendored

@ -7,9 +7,8 @@ out
gen gen
target target
.idea .idea
.iml
.jar
.class
.md
.log
*.iml *.iml
*.jar
*.class
.md
*.log

@ -85,13 +85,6 @@ public class DynamicBean {
if(null != superclass) { if(null != superclass) {
generator.setSuperclass(superclass); generator.setSuperclass(superclass);
} }
/*Set keySet = propertyMap.keySet();
for (Iterator i = keySet.iterator(); i.hasNext(); ) {
String key = (String) i.next();
generator.addProperty(key, (Class) propertyMap.get(key));
}*/
BeanGenerator.addProperties(generator, propertyMap); BeanGenerator.addProperties(generator, propertyMap);
return generator.create(); return generator.create();
} }

@ -1,8 +1,11 @@
package cn.estsh.i3plus.pojo.base.dynamic; package cn.estsh.i3plus.pojo.base.dynamic;
import cn.estsh.i3plus.pojo.base.bean.BaseBean; import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.google.common.base.CaseFormat;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -61,69 +64,6 @@ public class DynamicEntity extends BaseBean implements Serializable {
} }
/** /**
*
*
* @return
*//*
public DynamicEntity get(String method, String uri, Object[] args, Object result, String operator, String appName) {
setMethod(method);
setUri(uri);
setArgs(args);
setResult(result);
setOperator(operator);
setAppName(appName);
return this;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public Object[] getArgs() {
return args;
}
public void setArgs(Object[] args) {
this.args = args;
}
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}*/
/**
* 便 * 便
* @throws InvocationTargetException * @throws InvocationTargetException
* @throws IllegalAccessException * @throws IllegalAccessException
@ -131,18 +71,15 @@ public class DynamicEntity extends BaseBean implements Serializable {
*/ */
public void initDynamic() { public void initDynamic() {
Field[] fields = this.getClass().getDeclaredFields(); Field[] fields = this.getClass().getDeclaredFields();
Method setMethod = null; Method setMethod = null;
String setMethodName,propName; String setMethodName,propName;
Object fieldVal = null; Object fieldVal = null;
for(Field f : fields) { for(Field f : fields) {
propName = f.getName().replace("$cglib_prop_", ""); propName = f.getName().replace("$cglib_prop_", "");
if(!"LOGGER".equals(propName) && !"propertyList".equals(propName)) { if(!"LOGGER".equals(propName) && !"propertyList".equals(propName) && !"dynProperty".equals(propName)) {
this.getPropertyList().add(propName); //添加到属性list中 this.getPropertyList().add(propName); //添加到属性list中
setMethodName = "set" + propName.substring(0,1).toUpperCase() + propName.substring(1); setMethodName = "set" + propName.substring(0,1).toUpperCase() + propName.substring(1);
f.setAccessible(true); f.setAccessible(true);
try { try {
fieldVal = f.get(this); fieldVal = f.get(this);
@ -160,9 +97,9 @@ public class DynamicEntity extends BaseBean implements Serializable {
} else if (f.getType() == Double.class) { } else if (f.getType() == Double.class) {
fieldVal = 0.0d; fieldVal = 0.0d;
} else if (f.getType() == String.class) { } else if (f.getType() == String.class) {
fieldVal = "1"; fieldVal = "";
}else if (f.getType() == Character.class) { }else if (f.getType() == Character.class) {
fieldVal = "1"; fieldVal = "";
}else if (f.getType() == Boolean.class) { }else if (f.getType() == Boolean.class) {
fieldVal = true; fieldVal = true;
}else if (f.getType() == Byte.class) { }else if (f.getType() == Byte.class) {
@ -170,7 +107,7 @@ public class DynamicEntity extends BaseBean implements Serializable {
}else if (f.getType() == Date.class) { }else if (f.getType() == Date.class) {
fieldVal = new Date(); fieldVal = new Date();
}else { }else {
fieldVal = "1"; fieldVal = "";
} }
} }
@ -239,8 +176,18 @@ public class DynamicEntity extends BaseBean implements Serializable {
return result; return result;
} }
public void setDynProperty(Map<String,Object> params) {
if (params != null && params.size() > 0){
params.forEach((k,v)->{{
setDynProperty(k,v);
}});
}
}
/** /**
* *
* //TODO wei.peng 设置为空时会无效
* @param propName * @param propName
* @param val * @param val
* @throws InvocationTargetException * @throws InvocationTargetException
@ -248,9 +195,9 @@ public class DynamicEntity extends BaseBean implements Serializable {
* @throws NoSuchMethodException * @throws NoSuchMethodException
*/ */
public void setDynProperty(String propName,Object val){ public void setDynProperty(String propName,Object val){
//初始化set方法 //初始化set方法
String setMethodName = "set" + propName.substring(0, 1).toUpperCase() + propName.substring(1); String setMethodName = "set" + CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, propName);
//获取方法 //获取方法
Method setMethod = null; Method setMethod = null;
try { try {
setMethod = this.getClass().getDeclaredMethod(setMethodName, new Class[]{val.getClass()}); setMethod = this.getClass().getDeclaredMethod(setMethodName, new Class[]{val.getClass()});

@ -334,6 +334,86 @@ public class BlockFormEnumUtil {
return tmp; return tmp;
} }
} }
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ELEMENT_SHOW_STATUS {
ON(1, "ON", "开启"),
OFF(2, "OFF", "关闭");
private int value;
private String code;
private String description;
private ELEMENT_SHOW_STATUS(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_SHOW_STATUS 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;
}
}
/** /**
* *
@ -887,20 +967,22 @@ public class BlockFormEnumUtil {
*/ */
@JsonFormat(shape = JsonFormat.Shape.OBJECT) @JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PROPERTY_VIRTUAL_OPERATE_TYPE { public enum PROPERTY_VIRTUAL_OPERATE_TYPE {
STRING_SPLICE(10, "SPLICE", "字符串拼接"), STRING_SPLICE(10, "SPLICE", "字符串拼接",String.class),
NUM_ADD(20, "ADD", "加法计算"), NUM_ADD(20, "ADD", "加法计算",Double.class),
NUM_LESS(30, "MIN", "减法计算"), NUM_LESS(30, "MIN", "减法计算",Double.class),
NUM_MAKE(40, "MUL", "乘法计算"), NUM_MAKE(40, "MUL", "乘法计算",Double.class),
NUM_DIVISION(50, "DIVISION", "除法计算"); NUM_DIVISION(50, "DIVISION", "除法计算",Double.class);
private int value; private int value;
private String code; private String code;
private String description; private String description;
private Class clzFullName;
private PROPERTY_VIRTUAL_OPERATE_TYPE(int value, String code, String description) { private PROPERTY_VIRTUAL_OPERATE_TYPE(int value, String code, String description,Class clzFullName) {
this.value = value; this.value = value;
this.code = code; this.code = code;
this.description = description; this.description = description;
this.clzFullName = clzFullName;
} }
public int getValue() { public int getValue() {
@ -915,6 +997,14 @@ public class BlockFormEnumUtil {
return description; return description;
} }
public Class getClzFullName() {
return clzFullName;
}
public void setClzFullName(Class clzFullName) {
this.clzFullName = clzFullName;
}
public static String valueOfCode(int val) { public static String valueOfCode(int val) {
String tmp = null; String tmp = null;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
@ -964,6 +1054,8 @@ public class BlockFormEnumUtil {
} }
return tmp; return tmp;
} }
} }
/** /**
@ -983,8 +1075,8 @@ public class BlockFormEnumUtil {
DOUBLE(30, "Double", "大浮点型", "java.lang.Double", Double.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), FLOAT(31, "Float", "小浮点型", "java.lang.Float", Float.class,PROPERTY_CONTROL_TYPE.NUMBER),
BOOLEAN(40, "Boolean", "布尔值", "java.lang.Boolean", Boolean.class,PROPERTY_CONTROL_TYPE.RADIO), BOOLEAN(40, "Boolean", "布尔值", "java.lang.Boolean", Boolean.class,PROPERTY_CONTROL_TYPE.RADIO),
BYTE(50, "Byte", "字节", "java.lang.Byte", Byte.class,PROPERTY_CONTROL_TYPE.TEXT), 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); // DATE(60, "Date", "日期", "java.lang.String", String.class,PROPERTY_CONTROL_TYPE.DATE_TIME);
/** /**
* *

@ -15,6 +15,7 @@ import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.util.List;
/** /**
* @Description : * @Description :
@ -74,16 +75,21 @@ public class BfElement extends BaseBean {
@Transient @Transient
@ApiParam(value = "数据对象") @ApiParam(value = "数据对象")
@AnnoOutputColumn(hidden = true)
private BfDataObject dataObject; private BfDataObject dataObject;
@Transient @Transient
@ApiParam(value = "元素表单") @ApiParam(value = "元素表单")
@AnnoOutputColumn(hidden = true)
private BfElementGrid elementGrid; private BfElementGrid elementGrid;
@Transient @Transient
@ApiParam(value = "元素树") @ApiParam(value = "元素树")
@AnnoOutputColumn(hidden = true)
private BfElementTree elementTree; private BfElementTree elementTree;
@Transient
@ApiParam(value = "元素属性信息")
private List<BfElementProperty> propertyList;
@Transient
@ApiParam(value = "元素虚拟属性信息")
private List<BfElementPropertyVirtual> propertyVirtualList;
} }

@ -40,6 +40,10 @@ public class BfElementGrid extends BaseBean {
@ApiParam(value = "显示行号") @ApiParam(value = "显示行号")
private Integer isLineShowNumber; private Integer isLineShowNumber;
@Column(name = "IS_LINE_MULTIPLE")
@ApiParam(value = "是否单选")
private Integer isLineMultiple;
@Column(name = "IS_OBJECT_ADD") @Column(name = "IS_OBJECT_ADD")
@ApiParam(value = "是否新增") @ApiParam(value = "是否新增")
private Integer isObjectAdd; private Integer isObjectAdd;

@ -56,11 +56,15 @@ public class BfElementProperty extends BaseBean {
private String propertyTypeNameRdd; private String propertyTypeNameRdd;
@Column(name="PROPERTY_NAME") @Column(name="PROPERTY_NAME")
@ApiParam(value ="元素描述") @ApiParam(value ="元素名称")
private String propertyName; private String propertyName;
@Column(name="PROPERTY_CODE_RDD")
@ApiParam(value ="类属性名称")
private String propertyCodeRdd;
@Column(name="PROPERTY_DEFAULT_VALUE") @Column(name="PROPERTY_DEFAULT_VALUE")
@ApiParam(value ="元素描述") @ApiParam(value ="元素默认值")
private String propertyDefaultValue; private String propertyDefaultValue;
@Column(name = "PROPERTY_VALUE_NOT_NULL") @Column(name = "PROPERTY_VALUE_NOT_NULL")
@ -77,7 +81,11 @@ public class BfElementProperty extends BaseBean {
@Column(name = "PROPERTY_INPUT_TXT") @Column(name = "PROPERTY_INPUT_TXT")
@ApiParam(value = "输入提示") @ApiParam(value = "输入提示")
private Integer propertyInputTxt; private String propertyInputTxt;
@Column(name="PROPERTY_LABEL_TXT")
@ApiParam(value ="元素提示")
private String propertyLabelTxt;
@Column(name = "PROPERTY_LENGTH") @Column(name = "PROPERTY_LENGTH")
@ApiParam(value = "属性长度") @ApiParam(value = "属性长度")

@ -38,6 +38,14 @@ public class BfElementPropertyVirtual extends BaseBean {
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long elementId; private Long elementId;
@Column(name="PROPERTY_NAME")
@ApiParam(value ="元素名称")
private String propertyName;
@Column(name="PROPERTY_TYPE")
@ApiParam(value ="属性类型")
private Integer propertyType;
@Column(name = "PROPERTY_VIRTUAL_OPERATE_TYPE") @Column(name = "PROPERTY_VIRTUAL_OPERATE_TYPE")
@ApiParam(value = "虚拟元素类型") @ApiParam(value = "虚拟元素类型")
private Integer propertyVirtualType; private Integer propertyVirtualType;

@ -31,6 +31,9 @@ public class ElementModel{
@ApiParam(value = "元素基础虚拟属性信息") @ApiParam(value = "元素基础虚拟属性信息")
private List<BfElementPropertyVirtual> virtualList; private List<BfElementPropertyVirtual> virtualList;
@ApiParam(value = "动态对象Class")
private Class dynClass;
@ApiParam(value = "数据对象信息") @ApiParam(value = "数据对象信息")
private BfDataObject dataObject; private BfDataObject dataObject;

@ -52,6 +52,10 @@ public class SqlColumnModel {
@ApiParam(value = "枚举:BlockFormEnumUtil.PROPERTY_TYPE") @ApiParam(value = "枚举:BlockFormEnumUtil.PROPERTY_TYPE")
private Integer columnClassType; private Integer columnClassType;
@ApiParam(value = "属性值")
private Object value;
@ApiParam(value = "属性默认值")
private Object defaultValue;
} }

@ -0,0 +1,37 @@
package cn.estsh.i3plus.pojo.model.form;
import cn.estsh.i3plus.pojo.base.dynamic.DynamicEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-04-03 17:30
* @Modify:
**/
@Data
public class SqlScriptModel {
@ApiParam(value = "对象元素ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long elementId;
@ApiParam(value = "元素内容")
private String elementContent ;
@ApiParam(value = "动态对象Class")
private Class dynClass;
@ApiParam(value = "动态对象")
private DynamicEntity dynObj;
@ApiParam(value = "封装数据", example = "-1")
private List<SqlColumnModel> params;
}

@ -10,7 +10,7 @@ import lombok.Data;
import java.util.List; import java.util.List;
/** /**
* @Description ://TODO 提交注意修改 临时使用 带改动 * @Description ://
* @Reference : * @Reference :
* @Author : Adair Peng * @Author : Adair Peng
* @CreateDate : 2019-01-25 18:19 * @CreateDate : 2019-01-25 18:19

@ -299,20 +299,21 @@ public class WmsHqlPack {
* @param wmsLocate * @param wmsLocate
* @return * @return
*/ */
public static String packHqlWmsLocates(WmsLocate wmsLocate) { public static DdlPackBean packHqlWmsLocates(WmsLocate wmsLocate) {
StringBuffer result = new StringBuffer(); //查询参数封装
DdlPackBean result = new DdlPackBean();
//查询参数封装 //查询参数封装
HqlPack.getStringLikerPack(wmsLocate.getLocateNo(), "locateNo", result); DdlPreparedPack.getStringLikerPack(wmsLocate.getLocateNo(), "locateNo", result);
HqlPack.getStringLikerPack(wmsLocate.getLocateName(), "locateName", result); DdlPreparedPack.getStringLikerPack(wmsLocate.getLocateName(), "locateName", result);
HqlPack.getNumEqualPack(wmsLocate.getLocateType(), "locateType", result); DdlPreparedPack.getNumEqualPack(wmsLocate.getLocateType(), "locateType", result);
HqlPack.getStringLikerPack(wmsLocate.getWhNo(), "whNo", result); DdlPreparedPack.getStringLikerPack(wmsLocate.getWhNo(), "whNo", result);
HqlPack.getStringLikerPack(wmsLocate.getZoneNo(), "zoneNo", result); DdlPreparedPack.getStringLikerPack(wmsLocate.getZoneNo(), "zoneNo", result);
HqlPack.getNumEqualPack(wmsLocate.getStatus(), "status", result); DdlPreparedPack.getNumEqualPack(wmsLocate.getStatus(), "status", result);
getStringBuilderPack(wmsLocate, result); getStringBuilderPack(wmsLocate, result);
return result.toString(); return result;
} }
/** /**

Loading…
Cancel
Save