From 6c3ecdac63eda8b80833ea11e622bfaf49a59901 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Fri, 27 Sep 2024 15:05:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=96=B0=E5=A2=9EclassNameSimple=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=B8=A6=E6=A8=A1=E5=9D=97=E5=90=8D=E7=9A=84?= =?UTF-8?q?=E7=B1=BB=E5=90=8D=E3=80=82=E5=AD=90=E8=A1=A8List=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=90=8D=E4=B8=8D=E5=B8=A6=E6=A8=A1=E5=9D=97=E5=90=8D?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/modules/gen/crud/controller.xml | 2 +- .../templates/modules/gen/crud/entity.xml | 10 ++--- .../templates/modules/gen/crud/service.xml | 4 +- .../templates/modules/gen/crud/vueApi.xml | 2 +- .../templates/modules/gen/crud/vueForm.xml | 38 +++++++++---------- .../modules/gen/crud/vueFormRoute.xml | 38 +++++++++---------- .../modules/gen/crud_cloud/controller.xml | 2 +- .../modules/gen/crud_cloud/entity.xml | 10 ++--- .../modules/gen/crud_cloud/service.xml | 4 +- .../modules/gen/include/formChildTable.html | 4 +- .../gen/include/formChildTableScript.html | 12 +++--- .../modules/gen/query/controller.xml | 2 +- .../templates/modules/gen/query/service.xml | 2 +- 13 files changed, 65 insertions(+), 65 deletions(-) diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml b/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml index 1f61a435..4aa4d01a 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml @@ -146,7 +146,7 @@ public class ${ClassName}Controller extends BaseController { * 查询子表数据 */ @RequiresPermissions("${permissionPrefix}:view") - @RequestMapping(value = "${@StringUtils.uncap(child.className)}ListData") + @RequestMapping(value = "${@StringUtils.uncap(child.classNameSimple)}ListData") @ResponseBody public Page<${@StringUtils.cap(child.className)}> subListData(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}, HttpServletRequest request, HttpServletResponse response) { ${@StringUtils.uncap(child.className)}.setPage(new Page<>(request, response)); diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/entity.xml b/modules/core/src/main/resources/templates/modules/gen/crud/entity.xml index ec91b0fa..0d38519a 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/entity.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/entity.xml @@ -213,7 +213,7 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab // 生成子表列表字段 for(child in table.childList){ %> - private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表 + private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List = ListUtils.newArrayList(); // 子表列表 <% } @@ -366,12 +366,12 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab %> @Valid - public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() { - return ${@StringUtils.uncap(child.className)}List; + public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.classNameSimple)}List() { + return ${@StringUtils.uncap(child.classNameSimple)}List; } - public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) { - this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List; + public void set${@StringUtils.cap(child.classNameSimple)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List) { + this.${@StringUtils.uncap(child.classNameSimple)}List = ${@StringUtils.uncap(child.classNameSimple)}List; } <% } %> diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/service.xml b/modules/core/src/main/resources/templates/modules/gen/crud/service.xml index 75afabc3..8bd4111f 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/service.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/service.xml @@ -70,7 +70,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv <% for (child in table.childList){ %> ${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} = new ${@StringUtils.cap(child.className)}(entity); ${@StringUtils.uncap(child.className)}.setStatus(${@StringUtils.cap(child.className)}.STATUS_NORMAL); - entity.set${@StringUtils.cap(child.className)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)})); + entity.set${@StringUtils.cap(child.classNameSimple)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)})); <% } %> } return entity; @@ -168,7 +168,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv <% } %> <% for (child in table.childList) { %> // 保存 ${ClassName}子表 - for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.className)}List()){ + for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.classNameSimple)}List()){ if (!${@StringUtils.cap(child.className)}.STATUS_DELETE.equals(${@StringUtils.uncap(child.className)}.getStatus())){ <% for(c in child.columnList){ diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueApi.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueApi.xml index 5952854c..a5293e74 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueApi.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueApi.xml @@ -72,7 +72,7 @@ for(c in table.columnList){ %> <% // 生成子表列表字段 for(child in table.childList){ %> - ${@StringUtils.uncap(child.className)}List?: any[]; // 子表列表 + ${@StringUtils.uncap(child.classNameSimple)}List?: any[]; // 子表列表 <% } %> } diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml index e16abc67..47845f76 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml @@ -28,7 +28,7 @@ <% if (table.childList.~size > 0){ %> <% for (child in table.childList){ %> -