From aa50dc17620d7e4e004b1480d9490876b885c7b7 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Thu, 30 Nov 2023 14:35:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lzbi/common/constant/GenConstants.java | 18 ++- .../com/lzbi/generator/util/GenUtils.java | 4 +- .../src/main/resources/vm/vue/index.vue.vm | 140 +++++++++++++++--- 3 files changed, 134 insertions(+), 28 deletions(-) diff --git a/lzbi-common/src/main/java/com/lzbi/common/constant/GenConstants.java b/lzbi-common/src/main/java/com/lzbi/common/constant/GenConstants.java index cbc00d7..2bb8fa1 100644 --- a/lzbi-common/src/main/java/com/lzbi/common/constant/GenConstants.java +++ b/lzbi-common/src/main/java/com/lzbi/common/constant/GenConstants.java @@ -44,19 +44,29 @@ public class GenConstants public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer", "bit", "bigint", "float", "double", "decimal" }; + /** 页面不需要新增字段 */ + public static final String[] COLUMNNAME_NOT_ADD = { "id", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark", "delete_by", "delete_time","tenant_id", "revision","created_by", "created_time","updated_by", + "updated_time"}; + + /** 页面不需要编辑字段 */ - public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; + public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark", "delete_by", "delete_time","tenant_id", "revision","created_by", "created_time","updated_by", + "updated_time"}; /** 页面不需要显示的列表字段 */ public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", - "update_time" }; + "update_time", "remark", "delete_by", "delete_time","tenant_id", "revision","created_by", "created_time","updated_by", + "updated_time"}; /** 页面不需要查询字段 */ public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", - "update_time", "remark" }; + "update_time", "remark", "delete_by", "delete_time","tenant_id", "revision","created_by", "created_time","updated_by", + "updated_time"}; /** Entity基类字段 */ - public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; + public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark", "tenantId", "revision","deleteBy" ,"deleteTime" }; /** Tree基类字段 */ public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" }; diff --git a/lzbi-generator/src/main/java/com/lzbi/generator/util/GenUtils.java b/lzbi-generator/src/main/java/com/lzbi/generator/util/GenUtils.java index 8a538cb..19ee20a 100644 --- a/lzbi-generator/src/main/java/com/lzbi/generator/util/GenUtils.java +++ b/lzbi-generator/src/main/java/com/lzbi/generator/util/GenUtils.java @@ -79,7 +79,9 @@ public class GenUtils } // 插入字段(默认所有字段都需要插入) - column.setIsInsert(GenConstants.REQUIRE); + if(!arraysContains(GenConstants.COLUMNNAME_NOT_ADD, columnName) && !column.isPk()) { + column.setIsInsert(GenConstants.REQUIRE); + } // 编辑字段 if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) diff --git a/lzbi-generator/src/main/resources/vm/vue/index.vue.vm b/lzbi-generator/src/main/resources/vm/vue/index.vue.vm index 26db658..466424b 100644 --- a/lzbi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/lzbi-generator/src/main/resources/vm/vue/index.vue.vm @@ -1,6 +1,7 @@