diff --git a/.gitignore b/.gitignore index d9357f1..448fafd 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,8 @@ out gen target .idea -.iml -.jar -.class -.md -.log *.iml +*.jar +*.class +.md +*.log diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/dynamic/DynamicBean.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/dynamic/DynamicBean.java index 5da8fca..d5dd465 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/dynamic/DynamicBean.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/dynamic/DynamicBean.java @@ -85,13 +85,6 @@ public class DynamicBean { if(null != 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); return generator.create(); } diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/dynamic/DynamicEntity.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/dynamic/DynamicEntity.java index ac21b0b..1e82aa4 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/dynamic/DynamicEntity.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/dynamic/DynamicEntity.java @@ -1,8 +1,11 @@ package cn.estsh.i3plus.pojo.base.dynamic; import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import com.google.common.base.CaseFormat; import lombok.Getter; import lombok.Setter; +import lombok.val; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.slf4j.Logger; 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 IllegalAccessException @@ -131,18 +71,15 @@ public class DynamicEntity extends BaseBean implements Serializable { */ public void initDynamic() { Field[] fields = this.getClass().getDeclaredFields(); - Method setMethod = null; String setMethodName,propName; Object fieldVal = null; for(Field f : fields) { 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中 - setMethodName = "set" + propName.substring(0,1).toUpperCase() + propName.substring(1); - f.setAccessible(true); try { fieldVal = f.get(this); @@ -160,9 +97,9 @@ public class DynamicEntity extends BaseBean implements Serializable { } else if (f.getType() == Double.class) { fieldVal = 0.0d; } else if (f.getType() == String.class) { - fieldVal = "1"; + fieldVal = ""; }else if (f.getType() == Character.class) { - fieldVal = "1"; + fieldVal = ""; }else if (f.getType() == Boolean.class) { fieldVal = true; }else if (f.getType() == Byte.class) { @@ -170,7 +107,7 @@ public class DynamicEntity extends BaseBean implements Serializable { }else if (f.getType() == Date.class) { fieldVal = new Date(); }else { - fieldVal = "1"; + fieldVal = ""; } } @@ -239,8 +176,18 @@ public class DynamicEntity extends BaseBean implements Serializable { return result; } + + public void setDynProperty(Map params) { + if (params != null && params.size() > 0){ + params.forEach((k,v)->{{ + setDynProperty(k,v); + }}); + } + } + /** * 根据属性名,设置属性值 + * //TODO wei.peng 设置为空时会无效 * @param propName * @param val * @throws InvocationTargetException @@ -248,9 +195,9 @@ public class DynamicEntity extends BaseBean implements Serializable { * @throws NoSuchMethodException */ public void setDynProperty(String propName,Object val){ - //初始化set方法 - String setMethodName = "set" + propName.substring(0, 1).toUpperCase() + propName.substring(1); - //获取方法 + //初始化set方法 + String setMethodName = "set" + CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, propName); + //获取方法 Method setMethod = null; try { setMethod = this.getClass().getDeclaredMethod(setMethodName, new Class[]{val.getClass()}); 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 11363f8..53777c6 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 @@ -334,6 +334,86 @@ public class BlockFormEnumUtil { 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) public enum PROPERTY_VIRTUAL_OPERATE_TYPE { - STRING_SPLICE(10, "SPLICE", "字符串拼接"), - NUM_ADD(20, "ADD", "加法计算"), - NUM_LESS(30, "MIN", "减法计算"), - NUM_MAKE(40, "MUL", "乘法计算"), - NUM_DIVISION(50, "DIVISION", "除法计算"); + STRING_SPLICE(10, "SPLICE", "字符串拼接",String.class), + NUM_ADD(20, "ADD", "加法计算",Double.class), + NUM_LESS(30, "MIN", "减法计算",Double.class), + NUM_MAKE(40, "MUL", "乘法计算",Double.class), + NUM_DIVISION(50, "DIVISION", "除法计算",Double.class); private int value; private String code; 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.code = code; this.description = description; + this.clzFullName = clzFullName; } public int getValue() { @@ -915,6 +997,14 @@ public class BlockFormEnumUtil { return description; } + public Class getClzFullName() { + return clzFullName; + } + + public void setClzFullName(Class clzFullName) { + this.clzFullName = clzFullName; + } + public static String valueOfCode(int val) { String tmp = null; for (int i = 0; i < values().length; i++) { @@ -964,6 +1054,8 @@ public class BlockFormEnumUtil { } return tmp; } + + } /** @@ -983,8 +1075,8 @@ public class BlockFormEnumUtil { 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); + 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); /** * 属性类型值 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 7bfc237..f787cff 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 @@ -15,6 +15,7 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.Transient; +import java.util.List; /** * @Description : @@ -74,16 +75,21 @@ public class BfElement extends BaseBean { @Transient @ApiParam(value = "数据对象") - @AnnoOutputColumn(hidden = true) private BfDataObject dataObject; @Transient @ApiParam(value = "元素表单") - @AnnoOutputColumn(hidden = true) private BfElementGrid elementGrid; @Transient @ApiParam(value = "元素树") - @AnnoOutputColumn(hidden = true) private BfElementTree elementTree; + + @Transient + @ApiParam(value = "元素属性信息") + private List propertyList; + + @Transient + @ApiParam(value = "元素虚拟属性信息") + private List propertyVirtualList; } 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 a979a2c..d0eb771 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 @@ -40,6 +40,10 @@ public class BfElementGrid extends BaseBean { @ApiParam(value = "显示行号") private Integer isLineShowNumber; + @Column(name = "IS_LINE_MULTIPLE") + @ApiParam(value = "是否单选") + private Integer isLineMultiple; + @Column(name = "IS_OBJECT_ADD") @ApiParam(value = "是否新增") private Integer isObjectAdd; 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 1b33377..1ec1af9 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 @@ -56,11 +56,15 @@ public class BfElementProperty extends BaseBean { private String propertyTypeNameRdd; @Column(name="PROPERTY_NAME") - @ApiParam(value ="元素描述") + @ApiParam(value ="元素名称") private String propertyName; + @Column(name="PROPERTY_CODE_RDD") + @ApiParam(value ="类属性名称") + private String propertyCodeRdd; + @Column(name="PROPERTY_DEFAULT_VALUE") - @ApiParam(value ="元素描述") + @ApiParam(value ="元素默认值") private String propertyDefaultValue; @Column(name = "PROPERTY_VALUE_NOT_NULL") @@ -77,7 +81,11 @@ public class BfElementProperty extends BaseBean { @Column(name = "PROPERTY_INPUT_TXT") @ApiParam(value = "输入提示") - private Integer propertyInputTxt; + private String propertyInputTxt; + + @Column(name="PROPERTY_LABEL_TXT") + @ApiParam(value ="元素提示") + private String propertyLabelTxt; @Column(name = "PROPERTY_LENGTH") @ApiParam(value = "属性长度") 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 cd877fa..604535d 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 @@ -38,6 +38,14 @@ public class BfElementPropertyVirtual extends BaseBean { @JsonSerialize(using = ToStringSerializer.class) 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") @ApiParam(value = "虚拟元素类型") private Integer propertyVirtualType; 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 index b87214e..ec48bf9 100644 --- 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 @@ -31,6 +31,9 @@ public class ElementModel{ @ApiParam(value = "元素基础虚拟属性信息") private List virtualList; + @ApiParam(value = "动态对象Class") + private Class dynClass; + @ApiParam(value = "数据对象信息") private BfDataObject dataObject; diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/SqlColumnModel.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/SqlColumnModel.java index 9c50dec..0ea73ba 100644 --- a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/SqlColumnModel.java +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/SqlColumnModel.java @@ -52,6 +52,10 @@ public class SqlColumnModel { @ApiParam(value = "枚举:BlockFormEnumUtil.PROPERTY_TYPE") private Integer columnClassType; + @ApiParam(value = "属性值") + private Object value; + @ApiParam(value = "属性默认值") + private Object defaultValue; } diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/SqlScriptModel.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/SqlScriptModel.java new file mode 100644 index 0000000..90d9313 --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/form/SqlScriptModel.java @@ -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 params; + +} diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/report/BeanBrPojoAttrModel.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/report/BeanBrPojoAttrModel.java index 49e1cc3..83aeee0 100644 --- a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/report/BeanBrPojoAttrModel.java +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/report/BeanBrPojoAttrModel.java @@ -10,7 +10,7 @@ import lombok.Data; import java.util.List; /** - * @Description ://TODO 提交注意修改 临时使用 带改动 + * @Description :// * @Reference : * @Author : Adair Peng * @CreateDate : 2019-01-25 18:19 diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java index c30c597..839fb10 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java @@ -299,20 +299,21 @@ public class WmsHqlPack { * @param wmsLocate * @return */ - public static String packHqlWmsLocates(WmsLocate wmsLocate) { - StringBuffer result = new StringBuffer(); + public static DdlPackBean packHqlWmsLocates(WmsLocate wmsLocate) { + //查询参数封装 + DdlPackBean result = new DdlPackBean(); //查询参数封装 - HqlPack.getStringLikerPack(wmsLocate.getLocateNo(), "locateNo", result); - HqlPack.getStringLikerPack(wmsLocate.getLocateName(), "locateName", result); - HqlPack.getNumEqualPack(wmsLocate.getLocateType(), "locateType", result); - HqlPack.getStringLikerPack(wmsLocate.getWhNo(), "whNo", result); - HqlPack.getStringLikerPack(wmsLocate.getZoneNo(), "zoneNo", result); - HqlPack.getNumEqualPack(wmsLocate.getStatus(), "status", result); + DdlPreparedPack.getStringLikerPack(wmsLocate.getLocateNo(), "locateNo", result); + DdlPreparedPack.getStringLikerPack(wmsLocate.getLocateName(), "locateName", result); + DdlPreparedPack.getNumEqualPack(wmsLocate.getLocateType(), "locateType", result); + DdlPreparedPack.getStringLikerPack(wmsLocate.getWhNo(), "whNo", result); + DdlPreparedPack.getStringLikerPack(wmsLocate.getZoneNo(), "zoneNo", result); + DdlPreparedPack.getNumEqualPack(wmsLocate.getStatus(), "status", result); getStringBuilderPack(wmsLocate, result); - return result.toString(); + return result; } /**