From 2f794c4b73f9cf93ebe83323575bbc5ccbf63952 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Wed, 10 Sep 2025 10:40:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E6=94=B9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=90=8D=E4=B8=BA=E9=A9=BC=E5=B3=B0=E6=97=B6=EF=BC=8C=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/java/VelocityUtils.java | 24 ++++++++++--------- .../gen/modules/gen-table-operate-drawer.vue | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/java/VelocityUtils.java b/docs/java/VelocityUtils.java index a1c47602..2c540be1 100644 --- a/docs/java/VelocityUtils.java +++ b/docs/java/VelocityUtils.java @@ -10,6 +10,7 @@ import org.apache.velocity.VelocityContext; import org.dromara.common.core.utils.DateUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.json.utils.JsonUtils; +import org.dromara.common.mybatis.enums.DataBaseType; import org.dromara.common.mybatis.helper.DataBaseHelper; import org.dromara.generator.constant.GenConstants; import org.dromara.generator.domain.GenTable; @@ -58,7 +59,7 @@ public class VelocityUtils { velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); velocityContext.put("ClassName", genTable.getClassName()); velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); - velocityContext.put("moduleName", genTable.getModuleName()); + velocityContext.put("moduleName", StrUtil.toSymbolCase(genTable.getModuleName(), '-')); velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); velocityContext.put("businessName", genTable.getBusinessName()); velocityContext.put("business_name", StrUtil.toUnderlineCase(genTable.getBusinessName())); @@ -124,11 +125,12 @@ public class VelocityUtils { templates.add("vm/java/serviceImpl.java.vm"); templates.add("vm/java/controller.java.vm"); templates.add("vm/xml/mapper.xml.vm"); - if (DataBaseHelper.isOracle()) { + DataBaseType dataBaseType = DataBaseHelper.getDataBaseType(); + if (dataBaseType.isOracle()) { templates.add("vm/sql/oracle/sql.vm"); - } else if (DataBaseHelper.isPostgerSql()) { + } else if (dataBaseType.isPostgreSql()) { templates.add("vm/sql/postgres/sql.vm"); - } else if (DataBaseHelper.isSqlServer()) { + } else if (dataBaseType.isSqlServer()) { templates.add("vm/sql/sqlserver/sql.vm"); } else { templates.add("vm/sql/sql.vm"); @@ -163,7 +165,7 @@ public class VelocityUtils { String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); String mybatisPath = MYBATIS_PATH + "/" + moduleName; String soybeanPath = "soy"; - + String soybeanModuleName = StrUtil.toSymbolCase(moduleName, '-'); if (template.contains("domain.java.vm")) { fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); } @@ -186,17 +188,17 @@ public class VelocityUtils { } else if (template.contains("sql.vm")) { fileName = businessName + "Menu.sql"; } else if (template.contains("index.vue.vm")) { - fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("index-tree.vue.vm")) { - fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("api.d.ts.vm")) { - fileName = StringUtils.format("{}/typings/api/{}.{}.api.d.ts", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/typings/api/{}.{}.api.d.ts", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("api.ts.vm")) { - fileName = StringUtils.format("{}/service/api/{}/{}.ts", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/service/api/{}/{}.ts", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("search.vue.vm")) { - fileName = StringUtils.format("{}/views/{}/{}/modules/{}-search.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/views/{}/{}/modules/{}-search.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("operate-drawer.vue.vm")) { - fileName = StringUtils.format("{}/views/{}/{}/modules/{}-operate-drawer.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/views/{}/{}/modules/{}-operate-drawer.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-')); } return fileName; } diff --git a/src/views/tool/gen/modules/gen-table-operate-drawer.vue b/src/views/tool/gen/modules/gen-table-operate-drawer.vue index f61b4fbe..2f8171c2 100644 --- a/src/views/tool/gen/modules/gen-table-operate-drawer.vue +++ b/src/views/tool/gen/modules/gen-table-operate-drawer.vue @@ -356,7 +356,7 @@ const columns: NaiveUI.TableColumn[] = [