From 0d7e773a496593b86da6d9676b742e9dee72c80d Mon Sep 17 00:00:00 2001 From: "wei.peng" Date: Tue, 11 Dec 2018 18:09:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=A1=A8=E5=8D=95=20?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E5=8A=9F=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/model/dynamic/table/DynTableCell.java | 29 ++++++++ .../pojo/model/dynamic/table/DynTablePackTool.java | 82 ++++++++++++++++++++++ .../pojo/model/dynamic/table/DynTableRow.java | 48 +++++++++++++ .../pojo/model/dynamic/table/ImppDynTable.java | 33 +++++++++ 4 files changed, 192 insertions(+) create mode 100644 modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTableCell.java create mode 100644 modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTablePackTool.java create mode 100644 modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTableRow.java create mode 100644 modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/ImppDynTable.java diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTableCell.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTableCell.java new file mode 100644 index 0000000..105afef --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTableCell.java @@ -0,0 +1,29 @@ +package cn.estsh.i3plus.pojo.model.dynamic.table; + +import lombok.Data; + +import java.util.Date; + +/** + * @Description : + * @Reference : + * @Author : Adair Peng + * @CreateDate : 2018-12-11 15:37 + * @Modify: + * 动态 Table 单元格 + **/ +@Data +public class DynTableCell { + + // 排序 + private Integer cellSeq; + // 单元格名称 + private String cellName; + // 单元格名称英文 + private String cellNameEn; + // 单元格数据 + private Object cellValue; + // 单元格数据 + private Integer cellValueType; + +} diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTablePackTool.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTablePackTool.java new file mode 100644 index 0000000..93e5814 --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTablePackTool.java @@ -0,0 +1,82 @@ +package cn.estsh.i3plus.pojo.model.dynamic.table; + +/** + * @Description : + * @Reference : + * @Author : Adair Peng + * @CreateDate : 2018-12-11 16:43 + * @Modify: + * 动态表单 工具类 + **/ +public class DynTablePackTool { + + + /** + * 获取 Table 空行对象 + * @return + */ + public static DynTableRow getTableRow(){ + return new DynTableRow(); + } + + /** + * 获取 Table 空行对象 + * @return + */ + public static DynTableRow getTableRow(String rowKey){ + DynTableRow row = getTableRow(); + row.setKey(rowKey); + return row; + } + + public static DynTableRow getDynTableRow(ImppDynTable table, String key){ + if(table != null && key != null){ + return table.getTable().get(key); + } + return null; + } + + /** + * 表单 中添加行数据 + * @param table + * @param row + * @return + */ + public static DynTableRow putDynTableRow(ImppDynTable table,DynTableRow row){ + return table.getTable().put(row.getKey(),row); + } + + /** + * 创建单元格 + * @param seq + * @param name + * @param value + * @return + */ + public static DynTableCell getTableCell(Integer seq,String name,Object value) { + return getTableCell(seq, name, null, value,null); + } + + public static DynTableCell getTableCell(Integer seq,String name,Object value,Integer valueType) { + return getTableCell(seq, name, null, value,valueType); + } + + /** + * 创建一个单元格 + * @param seq 单元格排序 + * @param name 单元格名称 + * @param nameEn 单元格名称En + * @param value 单元格数据 + * @return + */ + public static DynTableCell getTableCell(Integer seq,String name,String nameEn,Object value,Integer valueType){ + DynTableCell cell = new DynTableCell(); + cell.setCellSeq(seq); + cell.setCellName(name); + cell.setCellNameEn(nameEn); + cell.setCellValue(value); + cell.setCellValueType(valueType); + return cell; + } + +} diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTableRow.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTableRow.java new file mode 100644 index 0000000..3ab4697 --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/DynTableRow.java @@ -0,0 +1,48 @@ +package cn.estsh.i3plus.pojo.model.dynamic.table; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description : + * @Reference : + * @Author : Adair Peng + * @CreateDate : 2018-12-11 15:37 + * @Modify: + * 动态Table Row + **/ +@Data +public class DynTableRow { + + private String key; + + // 行号 + private Integer index = 0; + + // 行Size + private Integer cellSize = 0; + + // 行数据 + private List cellList = new ArrayList<>(); + + + public DynTableRow addList(DynTableCell cell){ + this.cellList.add(cell); + return this; + } + + public Integer getCellSize() { + return cellList != null ? cellList.size() : 0; + } + + /** + * 禁止外部给 Size 赋值 + * @param cellSize + */ + private void setCellSize(Integer cellSize) { } + +} diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/ImppDynTable.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/ImppDynTable.java new file mode 100644 index 0000000..3ea67da --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/dynamic/table/ImppDynTable.java @@ -0,0 +1,33 @@ +package cn.estsh.i3plus.pojo.model.dynamic.table; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description : + * @Reference : + * @Author : Adair Peng + * @CreateDate : 2018-12-11 15:37 + * @Modify: + * 动态Table Row + **/ +@Data +public class ImppDynTable { + + // 行数据 + private Map table = new HashMap<>(); + + // 表单标题 + private String tableTitle; + + public ImppDynTable() { + } + + public ImppDynTable(String tableTitle) { + this.tableTitle = tableTitle; + } +} From d9214fd7466ef70755c6c991cbc93a7ff0299f2d Mon Sep 17 00:00:00 2001 From: "wei.peng" Date: Tue, 11 Dec 2018 18:10:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=A1=A8=E5=8D=95=20?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E5=8A=9F=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/CommonEnumUtil.java | 2 +- .../i3plus/pojo/base/enumutil/ImppEnumUtil.java | 69 ++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/CommonEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/CommonEnumUtil.java index ae21e54..1a96c35 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/CommonEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/CommonEnumUtil.java @@ -263,7 +263,7 @@ public class CommonEnumUtil { // EXPIRE(5, "服务到期", "服务到期_EXPIRE"), LOCKING(3, "fa cell-fa fa-lock", "锁定"), ENABLE(1, "fa fa-success cell-fa fa-check", "启用"), - DISABLE(2, "fa fa-disabled cell-fa fa-times-circle", "禁止"); + DISABLE(2, "fa fa-disabled cell-fa fa-times-circle", "禁用"); private int value; private String code; diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/ImppEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/ImppEnumUtil.java index 7df2552..ba15b22 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/ImppEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/ImppEnumUtil.java @@ -747,4 +747,73 @@ public class ImppEnumUtil { return tmp; } } + + /** + * 动态表单类型 + * 1. String + * 2. Number + * 3. Date + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum DYN_TABLE_CELL_TYPE { + + STRING(1,"String","字符串类型"), + NUMBER(2,"Number","数字类型"), + DATE(3,"Date","时间类型"); + + private int value; + private String name; + private String description; + + DYN_TABLE_CELL_TYPE() { + } + + DYN_TABLE_CELL_TYPE(int value, String name, String description) { + this.value = value; + this.name = name; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getName() { + return name; + } + + 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].name; + } + } + 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 String codeOfDescription(String code) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].name.equals(code)) { + tmp = values()[i].description; + } + } + return tmp; + } + } } From 47dd4c68b5fe689348d76a67bf4f53f753deb6ce Mon Sep 17 00:00:00 2001 From: "wei.peng" Date: Tue, 11 Dec 2018 18:18:08 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20Test=20to=20dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/i3plus-pojo-base/pom.xml | 2 +- modules/i3plus-pojo-mes/pom.xml | 2 +- modules/i3plus-pojo-model/pom.xml | 2 +- modules/i3plus-pojo-platform/pom.xml | 2 +- modules/i3plus-pojo-wms/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/i3plus-pojo-base/pom.xml b/modules/i3plus-pojo-base/pom.xml index 85a76cc..888e1bd 100644 --- a/modules/i3plus-pojo-base/pom.xml +++ b/modules/i3plus-pojo-base/pom.xml @@ -5,7 +5,7 @@ i3plus-pojo i3plus.pojo - 1.0-TEST-SNAPSHOT + 1.0-DEV-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/modules/i3plus-pojo-mes/pom.xml b/modules/i3plus-pojo-mes/pom.xml index 82fdbe8..62ebe64 100644 --- a/modules/i3plus-pojo-mes/pom.xml +++ b/modules/i3plus-pojo-mes/pom.xml @@ -5,7 +5,7 @@ i3plus-pojo i3plus.pojo - 1.0-TEST-SNAPSHOT + 1.0-DEV-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/modules/i3plus-pojo-model/pom.xml b/modules/i3plus-pojo-model/pom.xml index e0f7b38..485fdd6 100644 --- a/modules/i3plus-pojo-model/pom.xml +++ b/modules/i3plus-pojo-model/pom.xml @@ -5,7 +5,7 @@ i3plus-pojo i3plus.pojo - 1.0-TEST-SNAPSHOT + 1.0-DEV-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/modules/i3plus-pojo-platform/pom.xml b/modules/i3plus-pojo-platform/pom.xml index ec9e100..e310bfd 100644 --- a/modules/i3plus-pojo-platform/pom.xml +++ b/modules/i3plus-pojo-platform/pom.xml @@ -5,7 +5,7 @@ i3plus-pojo i3plus.pojo - 1.0-TEST-SNAPSHOT + 1.0-DEV-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/modules/i3plus-pojo-wms/pom.xml b/modules/i3plus-pojo-wms/pom.xml index fa05f2a..7409467 100644 --- a/modules/i3plus-pojo-wms/pom.xml +++ b/modules/i3plus-pojo-wms/pom.xml @@ -5,7 +5,7 @@ i3plus-pojo i3plus.pojo - 1.0-TEST-SNAPSHOT + 1.0-DEV-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 5773499..ead6373 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ i3plus.pojo i3plus-pojo pom - 1.0-TEST-SNAPSHOT + 1.0-DEV-SNAPSHOT modules/i3plus-pojo-base