diff --git a/o2server/x_attendance_core_entity/pom.xml b/o2server/x_attendance_core_entity/pom.xml index 3d8d22b1a06651fb44156be2727d65e1c32e1036..af482a2b9e349e4110e70b9d3c4ad284aa0c220d 100644 --- a/o2server/x_attendance_core_entity/pom.xml +++ b/o2server/x_attendance_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/annotation/ApiBuilder.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/annotation/ApiBuilder.java index c16b238e161928169de98370ed791d8f85028e72..c1d2a306f108332c7de36963b8bfd03c189e79d3 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/annotation/ApiBuilder.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/annotation/ApiBuilder.java @@ -75,7 +75,7 @@ public class ApiBuilder { builder.scan(dir); - FileUtils.copyDirectory(sourcedir, new File(dir, "sources")); + //FileUtils.copyDirectory(sourcedir, new File(dir, "sources")); } diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/annotation/TableBuilder.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/annotation/TableBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..49f28372bdd0452c2346e546af138435bcd4c27c --- /dev/null +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/annotation/TableBuilder.java @@ -0,0 +1,373 @@ +package com.x.base.core.project.annotation; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Parameter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import javax.persistence.Table; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Lob; +import javax.persistence.OrderColumn; +import org.apache.openjpa.persistence.jdbc.ElementColumn; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.HEAD; +import javax.ws.rs.OPTIONS; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import org.apache.openjpa.persistence.jdbc.ContainerTable; + +import org.apache.commons.collections4.list.SetUniqueList; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.ClassUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.reflect.MethodUtils; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import com.google.gson.JsonElement; +import com.x.base.core.project.annotation.DescribeBuilder.JaxrsMethod; +import com.x.base.core.project.bean.WrapCopier; +import com.x.base.core.project.gson.XGsonBuilder; +import com.x.base.core.project.jaxrs.StandardJaxrsAction; +import com.x.base.core.project.logger.Logger; +import com.x.base.core.project.logger.LoggerFactory; +import com.x.base.core.project.tools.DefaultCharset; +import com.x.base.core.project.tools.ListTools; + +import io.github.classgraph.ClassGraph; +import io.github.classgraph.ClassInfo; +import io.github.classgraph.ScanResult; + +public class TableBuilder { + + private static Logger logger = LoggerFactory.getLogger(TableBuilder.class); + + public static void main(String[] args) throws IOException { + String filePath = args[0]; + String fileName = filePath.substring(filePath.lastIndexOf(File.separator), filePath.length()); + filePath = filePath.substring(0, filePath.lastIndexOf(File.separator)); + filePath = filePath + File.separator+"x_program_center"; + + File basedir = new File(args[0]); + File sourcedir = new File(args[1]); + File dir = new File(filePath ,"src/main/webapp/describe/table"); + + FileUtils.forceMkdir(dir); + TableBuilder builder = new TableBuilder(); + + builder.scan(dir,fileName); + } + + private void scan(File dir,String fileName) { + try { + List jaxrsClasses = new ArrayList<>(); + List> classes = this.scanJaxrsClass(); + for (Class> clz : classes) { + jaxrsClasses.add(this.jaxrsClass(clz)); + } + + LinkedHashMap> map = new LinkedHashMap<>(); + map.put("tables", jaxrsClasses); + File file = new File(dir, fileName + ".json"); + FileUtils.writeStringToFile(file, XGsonBuilder.toJson(map), DefaultCharset.charset); + + if (dir.isDirectory()) { + LinkedHashMap mapList = new LinkedHashMap<>(); + File[] fs = dir.listFiles(); + for(File f:fs){ + if(f.isFile()) { + String fileNameJosn = f.getName(); + if(!fileNameJosn.equalsIgnoreCase("tableList.json")) { + mapList.put(fileNameJosn.substring(0,fileNameJosn.lastIndexOf(".")), fileNameJosn); + } + } + } + File fileList = new File(dir, "tableList.json"); + FileUtils.writeStringToFile(fileList, XGsonBuilder.toJson(mapList), DefaultCharset.charset); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + + private List> scanJaxrsClass() throws Exception { + try (ScanResult scanResult = new ClassGraph().disableJarScanning().enableAnnotationInfo().scan()) { + SetUniqueList> classes = SetUniqueList.setUniqueList(new ArrayList>()); + for (ClassInfo info : scanResult.getClassesWithAnnotation(Entity.class.getName())) { + Class> o = ClassUtils.getClass(info.getName()); + Entity entity = o.getAnnotation(Entity.class); + if (null != entity) { + classes.add(o); + } + } + return classes; + } + } + + private JaxrsClass jaxrsClass(Class> clz) throws Exception { + logger.print("describe class:{}.", clz.getName()); + Table table = clz.getAnnotation(Table.class); + JaxrsClass jaxrsClass = new JaxrsClass(); + jaxrsClass.setModuleName(clz.getSimpleName()); + jaxrsClass.setTableName(table.name()); + for (Field field : clz.getDeclaredFields()) { + + Column column = field.getAnnotation(Column.class); + FieldDescribe fieldDescribe = field.getAnnotation(FieldDescribe.class); + Lob lob = field.getAnnotation(Lob.class); + ContainerTable containerTable = field.getAnnotation(ContainerTable.class); + + if (null != column) { + ColumnProperty columnElement = new ColumnProperty(); + columnElement.setName(column.name()); + if(lob != null) { + columnElement.setType("Lob"); + }else { + columnElement.setType(javaTypeToSqlType(field.getType().getCanonicalName())); + } + columnElement.setLength(column.length()+""); + columnElement.setRemark(fieldDescribe.value()); + jaxrsClass.getColumn().add(columnElement); + }else { + //关联表 + if(null != containerTable) { + ColumnProperty columnElement = new ColumnProperty(); + columnElement.setName(field.getName()); + columnElement.setType("ContainerTable"); + columnElement.setLength(""); + columnElement.setRemark(fieldDescribe.value()); + + ContainerTableProperty containerTableProperty = new ContainerTableProperty(); + containerTableProperty.setName(containerTable.name()); + + ContainerTableColumnProperty idColumnProperty= new ContainerTableColumnProperty(); + idColumnProperty.setName(clz.getSimpleName() + "_XID"); + idColumnProperty.setType("VARCHAR"); + idColumnProperty.setRemark("主键");; + containerTableProperty.getContainerTableColumnProperty().add(idColumnProperty); + + OrderColumn orderColumn = field.getAnnotation(OrderColumn.class); + if(null != orderColumn) { + ContainerTableColumnProperty orderColumnProperty= new ContainerTableColumnProperty(); + orderColumnProperty.setName(orderColumn.name()); + orderColumnProperty.setType("INTEGER"); + orderColumnProperty.setRemark("排序");; + containerTableProperty.getContainerTableColumnProperty().add(orderColumnProperty); + } + + ElementColumn elementColumn = field.getAnnotation(ElementColumn.class); + if(null != elementColumn) { + ContainerTableColumnProperty elementColumnProperty= new ContainerTableColumnProperty(); + elementColumnProperty.setName(elementColumn.name()); + elementColumnProperty.setType("VARCHAR"); + elementColumnProperty.setRemark("值"); + elementColumnProperty.setLength(elementColumn.length()+""); + containerTableProperty.getContainerTableColumnProperty().add(elementColumnProperty); + } + columnElement.setContainerTable(containerTableProperty); + jaxrsClass.getColumn().add(columnElement); + } + + + } + } + return jaxrsClass; + } + + private String javaTypeToSqlType(String javaType) { + String sqlTye = javaType; + if(javaType.equalsIgnoreCase("java.lang.String")) { + sqlTye = "VARCHAR"; + }else if(javaType.equalsIgnoreCase("java.lang.byte[]")) { + sqlTye = "BLOB"; + }else if(javaType.equalsIgnoreCase("java.lang.Long")) { + sqlTye = "INTEGER"; + }else if(javaType.equalsIgnoreCase("java.lang.Integer")) { + sqlTye = "INTEGER"; + }else if(javaType.equalsIgnoreCase("java.math.BigInteger")) { + sqlTye = "BIGINT"; + }else if(javaType.equalsIgnoreCase("java.lang.Float")) { + sqlTye = "FLOAT"; + }else if(javaType.equalsIgnoreCase("java.lang.Double")) { + sqlTye = "DOUBLE"; + }else if(javaType.equalsIgnoreCase("java.math.BigDecimal")) { + sqlTye = "DECIMAL"; + }else if(javaType.equalsIgnoreCase("java.lang.Integer")) { + sqlTye = "DECIMAL"; + }else if(javaType.equalsIgnoreCase("java.sql.Date") || javaType.equalsIgnoreCase("java.util.Date")) { + sqlTye = "DATE"; + }else if(javaType.equalsIgnoreCase("java.sql.Time")) { + sqlTye = "TIME"; + }else if(javaType.equalsIgnoreCase("java.sql.Timestamp")) { + sqlTye = "DATETIME"; + }else if(javaType.equalsIgnoreCase("java.lang.Boolean")) { + sqlTye = "BOOLEAN"; + } + return sqlTye; + } + + + public class JaxrsClass { + + private String moduleName; + private String tableName; + + private List columnProperty = new ArrayList<>(); + + public String getModuleName() { + return moduleName; + } + + public void setModuleName(String moduleName) { + this.moduleName = moduleName; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public List getColumn() { + return columnProperty; + } + + public void setColumn(List columnProperty) { + this.columnProperty = columnProperty; + } + + } + + + public class ColumnProperty{ + private String name; + private String type; + private String length; + private String remark; + private ContainerTableProperty containerTableProperty; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getLength() { + return length; + } + public void setLength(String length) { + this.length = length; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + + public ContainerTableProperty getContainerTable() { + return containerTableProperty; + } + public void setContainerTable(ContainerTableProperty containerTableProperty) { + this.containerTableProperty = containerTableProperty; + } + } + + public class ContainerTableProperty{ + private String name; + private String remark; + private List containerTableColumnProperty = new ArrayList<>(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + + public List getContainerTableColumnProperty() { + return containerTableColumnProperty; + } + + public void setContainerTableColumnProperty(List containerTableColumnProperty) { + this.containerTableColumnProperty = containerTableColumnProperty; + } + } + + + public class ContainerTableColumnProperty{ + private String name; + private String type; + private String length; + private String remark; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getLength() { + return length; + } + public void setLength(String length) { + this.length = length; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + } + +} \ No newline at end of file diff --git a/o2server/x_bbs_core_entity/pom.xml b/o2server/x_bbs_core_entity/pom.xml index 939aad44e33f073215a2f4e392a3aa6abd064e93..63e7317e2835784393738ba906373b56552fdab1 100644 --- a/o2server/x_bbs_core_entity/pom.xml +++ b/o2server/x_bbs_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_calendar_core_entity/pom.xml b/o2server/x_calendar_core_entity/pom.xml index a2f20d82bcd594cf991c88cbbeb7d033f51c6fa7..d60c2af80239b6f0e670c4c1123ac6cdddf0f281 100644 --- a/o2server/x_calendar_core_entity/pom.xml +++ b/o2server/x_calendar_core_entity/pom.xml @@ -23,6 +23,24 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + + metaModelBuilder generate-sources diff --git a/o2server/x_cms_core_entity/pom.xml b/o2server/x_cms_core_entity/pom.xml index 3c97a2e1bc480531bb34d8ab229806dc0c7513ba..77d5a48aa656446635aaf1d7ad4c3f3822973a04 100644 --- a/o2server/x_cms_core_entity/pom.xml +++ b/o2server/x_cms_core_entity/pom.xml @@ -27,6 +27,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_component_core_entity/pom.xml b/o2server/x_component_core_entity/pom.xml index bb9a2d40d6f1959ca78c5170fc5a84431c39820a..3405a6e1dc268ffc1f9e47f1b8362da6795c93e5 100644 --- a/o2server/x_component_core_entity/pom.xml +++ b/o2server/x_component_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_file_core_entity/pom.xml b/o2server/x_file_core_entity/pom.xml index 193d778c18820803d111e9f28bc550131da4abb2..753f2df300c40890b2579cb7fc2f86044113cef8 100644 --- a/o2server/x_file_core_entity/pom.xml +++ b/o2server/x_file_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_general_core_entity/pom.xml b/o2server/x_general_core_entity/pom.xml index d27b904240e1b624cecbdabe8a6a5d469cccdc5c..97dce992350b43ff4c8c697b2420c3bca450aa7d 100644 --- a/o2server/x_general_core_entity/pom.xml +++ b/o2server/x_general_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_hotpic_core_entity/pom.xml b/o2server/x_hotpic_core_entity/pom.xml index d4e4d2863c8b741a5555da0db58b2fd2472b1563..a0610caaa19fb2ad4376b769008259c5b3d0e44d 100644 --- a/o2server/x_hotpic_core_entity/pom.xml +++ b/o2server/x_hotpic_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_jpush_core_entity/pom.xml b/o2server/x_jpush_core_entity/pom.xml index 9be437dc22b4d392d1934d70fb5d500c0f07c5b2..32f6d5644a27852d1c2a64fa84b05fe96ec47cf2 100644 --- a/o2server/x_jpush_core_entity/pom.xml +++ b/o2server/x_jpush_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_meeting_core_entity/pom.xml b/o2server/x_meeting_core_entity/pom.xml index 019eee7a0759e3b39f0ea43c0aa1a8f0bd8342f7..a9304d1489c474d48bc2fe771db010bceac13f85 100644 --- a/o2server/x_meeting_core_entity/pom.xml +++ b/o2server/x_meeting_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_message_core_entity/pom.xml b/o2server/x_message_core_entity/pom.xml index 26895efee96fb1e22c6b00721d29324a64bc0d2a..3356572d7c9f636a8aa45e8d85847ece948eba6e 100644 --- a/o2server/x_message_core_entity/pom.xml +++ b/o2server/x_message_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_mind_core_entity/pom.xml b/o2server/x_mind_core_entity/pom.xml index 24c48be03ca8d23ae60ed8a3114243c9cf44bb82..de116a8c7d5527eb533d101dc5b6081d22ab94e3 100644 --- a/o2server/x_mind_core_entity/pom.xml +++ b/o2server/x_mind_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_okr_core_entity/pom.xml b/o2server/x_okr_core_entity/pom.xml index 740ddc4798c9e1bc92302b79f06e2ca63f8a8350..3411282456ca1068543d648f539c62d90421aed7 100644 --- a/o2server/x_okr_core_entity/pom.xml +++ b/o2server/x_okr_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_organization_core_entity/pom.xml b/o2server/x_organization_core_entity/pom.xml index af241ffc7e90bd1a02c7f84bf6e2ecb62b94ad1e..5eb8eef38bab74547f679dc8955b1b5844c124a3 100644 --- a/o2server/x_organization_core_entity/pom.xml +++ b/o2server/x_organization_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_portal_core_entity/pom.xml b/o2server/x_portal_core_entity/pom.xml index 6bcb18311824c2ece59487a597b179bdd74b00e5..f4cb0281fefde5c020308192bd50c907947e0600 100644 --- a/o2server/x_portal_core_entity/pom.xml +++ b/o2server/x_portal_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_processplatform_core_entity/pom.xml b/o2server/x_processplatform_core_entity/pom.xml index 68ca3ccba4eec480afde76b09f33ddb409655dee..88d46ecde3f10d394818e9efbb08bb5ec0a6430d 100644 --- a/o2server/x_processplatform_core_entity/pom.xml +++ b/o2server/x_processplatform_core_entity/pom.xml @@ -27,6 +27,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_program_center/src/main/webapp/jest/describeTable.js b/o2server/x_program_center/src/main/webapp/jest/describeTable.js new file mode 100644 index 0000000000000000000000000000000000000000..c3d559d7affc2a9ded29effd243f726e631708f7 --- /dev/null +++ b/o2server/x_program_center/src/main/webapp/jest/describeTable.js @@ -0,0 +1,107 @@ +var Describe = function() { + // 20180730 +} +Describe.splitValue = function(str) { + if (str) { + if (str.length > 0) { + return str.split(','); + } + } + return []; +} +Describe.joinValue = function(o, split) { + var s = ','; + if (split) { + s = '' + split; + } + if (o) { + if (toString.apply(o) === '[object Array]') { + return o.join(s); + } + } + return o; +} +Describe.getUrlParam = function(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); + var r = window.location.search.substr(1).match(reg); + if (r != null) return unescape(r[2]); return null; //返回参数值 +} + +Describe.prototype = { + "load" : function() { + var str = ''; + //var url = '../describe/table/x_calendar_core_entity.json'; + var url = '../describe/table/'+ Describe.getUrlParam("param"); + $.getJSON(url+'?rd=' + Math.random(), function(json) { + Describe.json = json; + $.each(json.tables, function(ji, j) { + str += '' + "表:" +j.tableName + ' (类:' + j.moduleName+ ')'; + str += '' + }); + str += ''; + $("#menu").html(str); + + $.each(json.tables, function(mi, m) { + $('#' + m.tableName + '_' + m.moduleName).click( + function() { + $('#result').html(''); + var txt = ""; + txt += ''; + txt += '序号列名类型长度用途'; + $.each(m.columnProperty, function(ci, c) { + if(c.type == "ContainerTable"){ + txt += ''+(ci+1)+''+c.name+''+c.type+''+c.length+''+c.remark+ "("+ c.containerTableProperty.name+')' + txt +=''; + txt += '序号列名类型用途'; + $.each(c.containerTableProperty.containerTableColumnProperty, function(cti, ct) { + txt += ''+(cti+1)+''+ct.name+''+ct.type+''+ct.remark+''; + }); + + txt +=''; + + }else{ + txt += ''+(ci+1)+''+c.name+''+c.type+''+c.length+''+c.remark+''; + } + }); + + txt += ''; + $('#result').html(txt); + }); + + }); + + $("[xtype='menu']").click( + function(event) { + if(event.stopPropagation){ + event.stopPropagation(); + }else{ + event.cancelBubble = true; + } + $(this).children().each(function(i){ + debugger; + //if(this.tagName != "SPAN"){ + //$(this).toggle(); + //} + }); + }); + $("[xtype='li']").click( function(event) { + if(event.stopPropagation){ + event.stopPropagation(); + }else{ + event.cancelBubble = true; + } + }) + $("[xtype='menu']").each(function(i){ + if(i!=0){ + $(this).children().each(function(i){ + + //if(this.tagName != "SPAN"){ + //$(this).toggle(); + //} + }); + } + } + ); + }); + } +} diff --git a/o2server/x_program_center/src/main/webapp/jest/listTable.html b/o2server/x_program_center/src/main/webapp/jest/listTable.html new file mode 100644 index 0000000000000000000000000000000000000000..3cb777aebb598559af3d689557a4031682c730ae --- /dev/null +++ b/o2server/x_program_center/src/main/webapp/jest/listTable.html @@ -0,0 +1,111 @@ + + + + + + + + + + + + + O2OA Table structure URL + + + \ No newline at end of file diff --git a/o2server/x_program_center/src/main/webapp/jest/listTableDetail.html b/o2server/x_program_center/src/main/webapp/jest/listTableDetail.html new file mode 100644 index 0000000000000000000000000000000000000000..65ff6cd07617fbe1e23f3e42c122916811e76dca --- /dev/null +++ b/o2server/x_program_center/src/main/webapp/jest/listTableDetail.html @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + table List + + + + + + + + + + 字段列表 copy + + + + + + + + + + + \ No newline at end of file diff --git a/o2server/x_program_center_core_entity/pom.xml b/o2server/x_program_center_core_entity/pom.xml index 1f838500f744923f233c3ee1bba3b6c470f36370..803ea2cb96cd7b560cf2b45ef82be220f48ae8e0 100644 --- a/o2server/x_program_center_core_entity/pom.xml +++ b/o2server/x_program_center_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_query_core_entity/pom.xml b/o2server/x_query_core_entity/pom.xml index 6a081eac216c6cf76aad702214048976e0b7aef8..6ac0fe4211cf6b4b11ddd7b180cfa5a7a618cf56 100644 --- a/o2server/x_query_core_entity/pom.xml +++ b/o2server/x_query_core_entity/pom.xml @@ -23,6 +23,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources diff --git a/o2server/x_teamwork_core_entity/pom.xml b/o2server/x_teamwork_core_entity/pom.xml index 87cc6dedd90d3b4480901adc4fab76f85b822f7f..74f01da86d831adc30f44316350d010f116d9303 100644 --- a/o2server/x_teamwork_core_entity/pom.xml +++ b/o2server/x_teamwork_core_entity/pom.xml @@ -22,6 +22,23 @@ org.codehaus.mojo exec-maven-plugin + + TableBuilder + prepare-package + + java + + + true + true + true + com.x.base.core.project.annotation.TableBuilder + + ${basedir} + ${project.build.sourceDirectory} + + + metaModelBuilder generate-sources