fix 修复 代码生成默认菜单上级id错误

This commit is contained in:
疯狂的狮子Li
2026-06-10 09:37:26 +08:00
parent a87dcea74b
commit 83eb74c56d
2 changed files with 34 additions and 33 deletions
@@ -615,11 +615,13 @@ public class GenTableServiceImpl implements IGenTableService {
*/
public void setTableFromOptions(GenTable genTable) {
Dict paramsObj = JsonUtils.parseMap(genTable.getOptions());
if (ObjectUtil.isNotNull(paramsObj)) {
if (ObjectUtil.isNull(paramsObj)) {
paramsObj = new Dict();
}
String treeCode = paramsObj.getStr(GenConstants.TREE_CODE);
String treeParentCode = paramsObj.getStr(GenConstants.TREE_PARENT_CODE);
String treeName = paramsObj.getStr(GenConstants.TREE_NAME);
Long parentMenuId = paramsObj.getLong(GenConstants.PARENT_MENU_ID);
Long parentMenuId = Convert.toLong(TemplateEngineUtils.getParentMenuId(paramsObj));
String parentMenuName = paramsObj.getStr(GenConstants.PARENT_MENU_NAME);
Boolean enableExport = Convert.toBool(paramsObj.get(GenConstants.ENABLE_EXPORT), true);
Boolean enableStatus = Convert.toBool(paramsObj.get(GenConstants.ENABLE_STATUS), false);
@@ -648,6 +650,5 @@ public class GenTableServiceImpl implements IGenTableService {
genTable.setTreeAncestorsField(treeAncestorsField);
genTable.setTreeOrderField(treeOrderField);
}
}
}
@@ -49,7 +49,7 @@ public class TemplateEngineUtils {
/**
* 默认上级菜单,系统工具
*/
private static final String DEFAULT_PARENT_MENU_ID = "3";
private static final String DEFAULT_PARENT_MENU_ID = "1761400000000000003";
// 模板引擎
private static final TemplateEngine TEMPLATE_ENGINE;