浏览代码

修复 生成器业务名 只会截取表下划线的最后一个 导致很多controller 会重名 问题

疯狂的狮子li 4 年之前
父节点
当前提交
e85334bacd
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java

+ 2 - 2
ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java

@@ -147,10 +147,10 @@ public class GenUtils
      */
      */
     public static String getBusinessName(String tableName)
     public static String getBusinessName(String tableName)
     {
     {
-        int lastIndex = tableName.lastIndexOf("_");
+        int lastIndex = tableName.indexOf("_");
         int nameLength = tableName.length();
         int nameLength = tableName.length();
         String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength);
         String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength);
-        return businessName;
+        return StringUtils.toCamelCase(businessName);
     }
     }
 
 
     /**
     /**