From 6a53dc3f7b42d236fb7eae565200ef48f008d15a Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 8 May 2024 15:40:13 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os-generator/src/main/resources/generator.yml | 4 +- .../main/resources/vm/java/controller.java.vm | 5 + .../src/main/resources/vm/java/domain.java.vm | 4 +- os-generator/src/main/resources/vm/sql/sql.vm | 3 +- .../main/resources/vm/vue/index-tree.vue.vm | 1081 +++++++------ .../src/main/resources/vm/vue/index.vue.vm | 1343 +++++++++-------- pom.xml | 10 +- 7 files changed, 1356 insertions(+), 1094 deletions(-) diff --git a/os-generator/src/main/resources/generator.yml b/os-generator/src/main/resources/generator.yml index 0a6e39c..8315ff2 100644 --- a/os-generator/src/main/resources/generator.yml +++ b/os-generator/src/main/resources/generator.yml @@ -1,9 +1,9 @@ # 代码生成 gen: # 作者 - author: ruoyi + author: Yinq # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool - packageName: com.os.system + packageName: com.os.ems.base # 自动去除表前缀,默认是false autoRemovePre: false # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) diff --git a/os-generator/src/main/resources/vm/java/controller.java.vm b/os-generator/src/main/resources/vm/java/controller.java.vm index c1def0f..76ed82a 100644 --- a/os-generator/src/main/resources/vm/java/controller.java.vm +++ b/os-generator/src/main/resources/vm/java/controller.java.vm @@ -16,6 +16,7 @@ import com.os.common.annotation.Log; import com.os.common.core.controller.BaseController; import com.os.common.core.domain.AjaxResult; import com.os.common.enums.BusinessType; +import com.os.common.utils.DateUtils; import ${packageName}.domain.${ClassName}; import ${packageName}.service.I${ClassName}Service; import com.os.common.utils.poi.ExcelUtil; @@ -88,6 +89,8 @@ public class ${ClassName}Controller extends BaseController @PostMapping public AjaxResult add(@RequestBody ${ClassName} ${className}) { + ${className}.setCreatedBy(getUsername()); + ${className}.setCreatedTime(DateUtils.getNowDate()); return toAjax(${className}Service.insert${ClassName}(${className})); } @@ -99,6 +102,8 @@ public class ${ClassName}Controller extends BaseController @PutMapping public AjaxResult edit(@RequestBody ${ClassName} ${className}) { + ${className}.setUpdatedBy(getUsername()); + ${className}.setUpdatedTime(DateUtils.getNowDate()); return toAjax(${className}Service.update${ClassName}(${className})); } diff --git a/os-generator/src/main/resources/vm/java/domain.java.vm b/os-generator/src/main/resources/vm/java/domain.java.vm index ce6d8f5..f1d084e 100644 --- a/os-generator/src/main/resources/vm/java/domain.java.vm +++ b/os-generator/src/main/resources/vm/java/domain.java.vm @@ -40,8 +40,8 @@ public class ${ClassName} extends ${Entity} #if($parentheseIndex != -1) @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") #elseif($column.javaType == 'Date') - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") #else @Excel(name = "${comment}") #end diff --git a/os-generator/src/main/resources/vm/sql/sql.vm b/os-generator/src/main/resources/vm/sql/sql.vm index 3a2314e..a293c08 100644 --- a/os-generator/src/main/resources/vm/sql/sql.vm +++ b/os-generator/src/main/resources/vm/sql/sql.vm @@ -3,7 +3,8 @@ insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame values('${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', getdate(), '', null, '${functionName}菜单'); -- 按钮父菜单ID -SELECT @parentId := LAST_INSERT_ID(); +DECLARE @parentId INT; +SET @parentId = SCOPE_IDENTITY(); -- 按钮 SQL insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) diff --git a/os-generator/src/main/resources/vm/vue/index-tree.vue.vm b/os-generator/src/main/resources/vm/vue/index-tree.vue.vm index cbfb7cd..1f89a50 100644 --- a/os-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/os-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -1,505 +1,594 @@ + }; + \ No newline at end of file diff --git a/os-generator/src/main/resources/vm/vue/index.vue.vm b/os-generator/src/main/resources/vm/vue/index.vue.vm index 70ff30d..a9215c9 100644 --- a/os-generator/src/main/resources/vm/vue/index.vue.vm +++ b/os-generator/src/main/resources/vm/vue/index.vue.vm @@ -1,602 +1,769 @@ + ; + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1b80e1b..6d20260 100644 --- a/pom.xml +++ b/pom.xml @@ -58,11 +58,11 @@ import - - org.ssssssss - magic-api-spring-boot-starter - ${magic.version} - + + + + +