| | |
| | | package com.ruoyi.generator.util; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.ruoyi.common.constant.GenConstants; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.JsonUtils; |
| | |
| | | */ |
| | | public static String getPackagePrefix(String packageName) { |
| | | int lastIndex = packageName.lastIndexOf("."); |
| | | String basePackage = StringUtils.substring(packageName, 0, lastIndex); |
| | | return basePackage; |
| | | return StringUtils.substring(packageName, 0, lastIndex); |
| | | } |
| | | |
| | | /** |
| | |
| | | List<GenTableColumn> columns = genTable.getColumns(); |
| | | GenTable subGenTable = genTable.getSubTable(); |
| | | HashSet<String> importList = new HashSet<String>(); |
| | | if (StringUtils.isNotNull(subGenTable)) { |
| | | if (ObjectUtil.isNotNull(subGenTable)) { |
| | | importList.add("java.util.List"); |
| | | } |
| | | for (GenTableColumn column : columns) { |
| | |
| | | * @return 上级菜单ID字段 |
| | | */ |
| | | public static String getParentMenuId(Map<String, Object> paramsObj) { |
| | | if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) |
| | | if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) |
| | | && StringUtils.isNotEmpty(Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID)))) { |
| | | return Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID)); |
| | | } |
| | |
| | | * @return 树编码 |
| | | */ |
| | | public static String getTreecode(Map<String, Object> paramsObj) { |
| | | if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) { |
| | | if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) { |
| | | return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_CODE))); |
| | | } |
| | | return StringUtils.EMPTY; |
| | |
| | | * @return 树父编码 |
| | | */ |
| | | public static String getTreeParentCode(Map<String, Object> paramsObj) { |
| | | if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { |
| | | if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { |
| | | return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_PARENT_CODE))); |
| | | } |
| | | return StringUtils.EMPTY; |
| | |
| | | * @return 树名称 |
| | | */ |
| | | public static String getTreeName(Map<String, Object> paramsObj) { |
| | | if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) { |
| | | if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) { |
| | | return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_NAME))); |
| | | } |
| | | return StringUtils.EMPTY; |