From c45d95bce85561142b1ace6eb4354ae5fa94c59f Mon Sep 17 00:00:00 2001 From: redfox <24202935@qq.com> Date: Wed, 28 Oct 2020 22:56:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=8F=9C=E5=8D=95=E7=94=9F?= =?UTF-8?q?=E6=88=90sql=E9=94=99=E8=AF=AF=E5=92=8CparentMenuId=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/pearadmin/generator/util/VelocityUtils.java | 6 ++++-- .../pear-generator/src/main/resources/vm/sql/sql.vm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pear-modules/pear-generator/src/main/java/com/pearadmin/generator/util/VelocityUtils.java b/pear-modules/pear-generator/src/main/java/com/pearadmin/generator/util/VelocityUtils.java index b909abc7..ba05c9ef 100644 --- a/pear-modules/pear-generator/src/main/java/com/pearadmin/generator/util/VelocityUtils.java +++ b/pear-modules/pear-generator/src/main/java/com/pearadmin/generator/util/VelocityUtils.java @@ -76,8 +76,10 @@ public class VelocityUtils public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) { String options = genTable.getOptions(); - JSONObject paramsObj = JSONObject.parseObject(options); - String parentMenuId = getParentMenuId(paramsObj); + // 说明,parentMenu没有保存在options中 + // JSONObject paramsObj = JSONObject.parseObject(options); + // String parentMenuId = getParentMenuId(paramsObj); + String parentMenuId = genTable.getParentMenuId(); context.put("parentMenuId", parentMenuId); } diff --git a/pear-modules/pear-generator/src/main/resources/vm/sql/sql.vm b/pear-modules/pear-generator/src/main/resources/vm/sql/sql.vm index 7c95516c..96e7b4af 100644 --- a/pear-modules/pear-generator/src/main/resources/vm/sql/sql.vm +++ b/pear-modules/pear-generator/src/main/resources/vm/sql/sql.vm @@ -1,6 +1,6 @@ -- 菜单 SQL INSERT INTO `sys_power` -VALUES ('${ids.get(0)}', '${functionName}菜单', '1', '${permissionPrefix}:main', '/${moduleName}/${businessName}/main', '_iframe‘, '${parentMenuId}', 'layui-icon layui-icon-set-fill', 1, NULL, NULL, NULL, NULL, NULL, '1'); +VALUES ('${ids.get(0)}', '${functionName}菜单', '1', '${permissionPrefix}:main', '/${moduleName}/${businessName}/main', '_iframe', '${parentMenuId}', 'layui-icon layui-icon-set-fill', 1, NULL, NULL, NULL, NULL, NULL, '1'); -- 按钮父菜单ID SELECT @parentId := LAST_INSERT_ID(); -- Gitee