Kaynağa Gözat

优化代码

java110 4 yıl önce
ebeveyn
işleme
8e98c9babc

+ 20 - 0
java110-bean/src/main/java/com/java110/po/store/StorePo.java

@@ -1,6 +1,7 @@
 package com.java110.po.store;
 
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * @ClassName StorePo
@@ -22,6 +23,9 @@ public class StorePo implements Serializable {
     private String mapX;
     private String mapY;
     private String state;
+    private String statusCd = "0";
+
+    private Date createTime;
 
     public String getStoreId() {
         return storeId;
@@ -102,4 +106,20 @@ public class StorePo implements Serializable {
     public void setState(String state) {
         this.state = state;
     }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
 }

+ 11 - 10
java110-generator/src/main/java/com/java110/code/TableToJsonWeb.java

@@ -7,20 +7,21 @@ import com.java110.utils.util.StringUtil;
 public class TableToJsonWeb {
 
     //show create table c_orders  用这个语句获取
-    public static final String createTableSql = "CREATE TABLE `m_menu_user` (\n" +
-            "  `mu_id` varchar(30) NOT NULL COMMENT '编号',\n" +
-            "  `m_id` varchar(30) NOT NULL COMMENT '菜单',\n" +
-            "  `icon` varchar(128) NOT NULL COMMENT '图标',\n" +
-            "  `seq` int(11) NOT NULL COMMENT '列顺序'\n" +
+    public static final String createTableSql = "CREATE TABLE `s_store` (\n" +
+            "  `store_id` varchar(30) NOT NULL COMMENT '商店ID',\n" +
+            "  `name` varchar(100) NOT NULL COMMENT '名称',\n" +
+            "  `address` varchar(200) NOT NULL COMMENT '地址',\n" +
+            "  `tel` varchar(11) NOT NULL COMMENT '电话',\n" +
+            "  `nearby_landmarks` varchar(200) DEFAULT NULL COMMENT '地标',\n" +
             ")";
     public static void main(String[] args) {
-        String templateName = "常用菜单"; //业务名称
-        String templateCode = "menuUser"; //表名大写
-        String templateKey = "muId"; //表主键
+        String templateName = "物业公司"; //业务名称
+        String templateCode = "propertyCompany"; //表名大写
+        String templateKey = "storeId"; //表主键
         String templateKeyName = "编号";//主键说明
-        String searchCode = "muId"; //分片字段
+        String searchCode = "storeId"; //分片字段
         String searchName = "编号"; //分片字段说明
-        String directories = "frame"; //前端生成到那个目录下
+        String directories = "admin"; //前端生成到那个目录下
         // templateName 业务名称 业务编码名称生成后文件名 templateCode 主键 templateKey
         // 业务主键名称 templateKeyName=templateName+ID 主机驼峰 searchCode 主键名称 searchName
         // directories 放在前端那个目录下

+ 63 - 31
java110-generator/src/main/resources/web/template_1.json

@@ -1,71 +1,103 @@
 {
   "templateKeyName": "编号",
-  "templateName": "常用菜单",
+  "templateName": "物业公司",
   "columns": [
     {
       "hasDefaultValue": false,
-      "limitParam": "30",
-      "code": "mId",
-      "limitErrInfo": "菜单不能超过30",
-      "cnCode": "菜单",
+      "limitParam": "100",
+      "code": "name",
+      "limitErrInfo": "名称不能超过100",
+      "cnCode": "名称",
       "limit": "maxLength",
       "show": true,
-      "inputType": "select",
-      "selectValue":"10001,10002",
-      "selectValueName":"小区文化,其他",
+      "inputType": "input",
       "required": true,
-      "desc": "必填,菜单"
+      "desc": "必填,名称"
     },
     {
       "hasDefaultValue": false,
-      "limitParam": "128",
-      "code": "icon",
-      "limitErrInfo": "图标不能超过128",
-      "cnCode": "图标",
+      "limitParam": "200",
+      "code": "address",
+      "limitErrInfo": "地址不能超过200",
+      "cnCode": "地址",
       "limit": "maxLength",
       "show": true,
-      "inputType": "select",
-      "selectValue":"10001,10002",
-      "selectValueName":"小区文化,其他",
+      "inputType": "input",
       "required": true,
-      "desc": "必填,图标"
+      "desc": "必填,地址"
     },
     {
       "hasDefaultValue": false,
       "limitParam": "11",
-      "code": "seq",
-      "limitErrInfo": "列顺序'不能超过11",
-      "cnCode": "列顺序'",
+      "code": "tel",
+      "limitErrInfo": "电话不能超过11",
+      "cnCode": "电话",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,电话"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "64",
+      "code": "corporation",
+      "limitErrInfo": "公司法人不能空",
+      "cnCode": "公司法人",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,公司法人"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "64",
+      "code": "foundingTime",
+      "limitErrInfo": "成立日期不能空",
+      "cnCode": "成立日期",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,成立日期"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "200",
+      "code": "nearbyLandmarks",
+      "limitErrInfo": "地标不能超过200",
+      "cnCode": "地标",
       "limit": "maxLength",
       "show": true,
       "inputType": "input",
       "required": true,
-      "desc": "必填,列顺序'"
+      "desc": "地标"
     }
   ],
   "searchName": "编号",
-  "directories": "frame",
-  "searchCode": "muId",
-  "templateCode": "menuUser",
+  "directories": "admin",
+  "searchCode": "storeId",
+  "templateCode": "propertyCompany",
   "conditions": [
     {
       "whereCondition": "equal",
-      "code": "muId",
-      "name": "编号",
+      "code": "storeId",
+      "name": "物业编号",
       "inputType": "input"
     },
     {
       "whereCondition": "equal",
-      "code": "mId",
-      "name": "菜单",
+      "code": "name",
+      "name": "名称",
       "inputType": "input"
     },
     {
       "whereCondition": "equal",
-      "code": "seq",
-      "name": "列顺序'",
+      "code": "tel",
+      "name": "电话",
       "inputType": "input"
     }
   ],
-  "templateKey": "muId"
+  "templateKey": "storeId"
 }