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 b909abc716ce3afcdf3ddf757210d31fc675fb2f..ba05c9ef4b70f063c2b2f4c335263f1de2d88c01 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 7c95516cd1c160468ac488093fc0fbeceecbb3f2..96e7b4af05667f258dfeb4fe469b85779455961a 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();