mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	fix 回滚代码生成部分优化 修复优化导致的问题
This commit is contained in:
		@@ -78,14 +78,14 @@ public class VelocityUtils {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) {
 | 
					    public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) {
 | 
				
			||||||
        String options = genTable.getOptions();
 | 
					        String options = genTable.getOptions();
 | 
				
			||||||
        Map<String, String> paramsObj = JsonUtils.parseMap(options);
 | 
					        Map<String, Object> paramsObj = JsonUtils.parseMap(options);
 | 
				
			||||||
        String parentMenuId = getParentMenuId(paramsObj);
 | 
					        String parentMenuId = getParentMenuId(paramsObj);
 | 
				
			||||||
        context.put("parentMenuId", parentMenuId);
 | 
					        context.put("parentMenuId", parentMenuId);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) {
 | 
					    public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) {
 | 
				
			||||||
        String options = genTable.getOptions();
 | 
					        String options = genTable.getOptions();
 | 
				
			||||||
        Map<String, String> paramsObj = JsonUtils.parseMap(options);
 | 
					        Map<String, Object> paramsObj = JsonUtils.parseMap(options);
 | 
				
			||||||
        String treeCode = getTreecode(paramsObj);
 | 
					        String treeCode = getTreecode(paramsObj);
 | 
				
			||||||
        String treeParentCode = getTreeParentCode(paramsObj);
 | 
					        String treeParentCode = getTreeParentCode(paramsObj);
 | 
				
			||||||
        String treeName = getTreeName(paramsObj);
 | 
					        String treeName = getTreeName(paramsObj);
 | 
				
			||||||
@@ -270,9 +270,9 @@ public class VelocityUtils {
 | 
				
			|||||||
     * @param paramsObj 生成其他选项
 | 
					     * @param paramsObj 生成其他选项
 | 
				
			||||||
     * @return 上级菜单ID字段
 | 
					     * @return 上级菜单ID字段
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static String getParentMenuId(Map<String, String> paramsObj) {
 | 
					    public static String getParentMenuId(Map<String, Object> paramsObj) {
 | 
				
			||||||
        if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
 | 
					        if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
 | 
				
			||||||
            && StringUtils.isNotEmpty(paramsObj.get(GenConstants.PARENT_MENU_ID))) {
 | 
					            && StringUtils.isNotEmpty(Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID)))) {
 | 
				
			||||||
            return Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID));
 | 
					            return Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return DEFAULT_PARENT_MENU_ID;
 | 
					        return DEFAULT_PARENT_MENU_ID;
 | 
				
			||||||
@@ -284,9 +284,9 @@ public class VelocityUtils {
 | 
				
			|||||||
     * @param paramsObj 生成其他选项
 | 
					     * @param paramsObj 生成其他选项
 | 
				
			||||||
     * @return 树编码
 | 
					     * @return 树编码
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static String getTreecode(Map<String, String> paramsObj) {
 | 
					    public static String getTreecode(Map<String, Object> paramsObj) {
 | 
				
			||||||
        if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) {
 | 
					        if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) {
 | 
				
			||||||
            return StringUtils.toCamelCase(paramsObj.get(GenConstants.TREE_CODE));
 | 
					            return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_CODE)));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return StringUtils.EMPTY;
 | 
					        return StringUtils.EMPTY;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -297,9 +297,9 @@ public class VelocityUtils {
 | 
				
			|||||||
     * @param paramsObj 生成其他选项
 | 
					     * @param paramsObj 生成其他选项
 | 
				
			||||||
     * @return 树父编码
 | 
					     * @return 树父编码
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static String getTreeParentCode(Map<String, String> paramsObj) {
 | 
					    public static String getTreeParentCode(Map<String, Object> paramsObj) {
 | 
				
			||||||
        if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
 | 
					        if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
 | 
				
			||||||
            return StringUtils.toCamelCase(paramsObj.get(GenConstants.TREE_PARENT_CODE));
 | 
					            return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_PARENT_CODE)));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return StringUtils.EMPTY;
 | 
					        return StringUtils.EMPTY;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -310,9 +310,9 @@ public class VelocityUtils {
 | 
				
			|||||||
     * @param paramsObj 生成其他选项
 | 
					     * @param paramsObj 生成其他选项
 | 
				
			||||||
     * @return 树名称
 | 
					     * @return 树名称
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static String getTreeName(Map<String, String> paramsObj) {
 | 
					    public static String getTreeName(Map<String, Object> paramsObj) {
 | 
				
			||||||
        if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) {
 | 
					        if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) {
 | 
				
			||||||
            return StringUtils.toCamelCase(paramsObj.get(GenConstants.TREE_NAME));
 | 
					            return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_NAME)));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return StringUtils.EMPTY;
 | 
					        return StringUtils.EMPTY;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -325,8 +325,8 @@ public class VelocityUtils {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public static int getExpandColumn(GenTable genTable) {
 | 
					    public static int getExpandColumn(GenTable genTable) {
 | 
				
			||||||
        String options = genTable.getOptions();
 | 
					        String options = genTable.getOptions();
 | 
				
			||||||
        Map<String, String> paramsObj = JsonUtils.parseMap(options);
 | 
					        Map<String, Object> paramsObj = JsonUtils.parseMap(options);
 | 
				
			||||||
        String treeName = paramsObj.get(GenConstants.TREE_NAME);
 | 
					        String treeName = Convert.toStr(paramsObj.get(GenConstants.TREE_NAME));
 | 
				
			||||||
        int num = 0;
 | 
					        int num = 0;
 | 
				
			||||||
        for (GenTableColumn column : genTable.getColumns()) {
 | 
					        for (GenTableColumn column : genTable.getColumns()) {
 | 
				
			||||||
            if (column.isList()) {
 | 
					            if (column.isList()) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user