3254194295 пре 5 месеци
родитељ
комит
75324727d1

+ 12 - 10
platform-rest/src/main/java/com/platform/rest/controller/workflow/DatabaseController.java

@@ -39,7 +39,7 @@ public class DatabaseController {
 
 
     public static void main(String[] args) {
-        String h ="shabi";
+        String h ="shabi_ga_gawe";
         String[] arr =h.split("_");
         String str = h;
         if (arr.length>1){
@@ -62,19 +62,21 @@ public class DatabaseController {
         if (tableName==null){
             throw new BusinessException("表名为空!");
         }
-        List<String> columnNames = DatabaseUtil.getColumnNames(tableName);
-        columnNames.forEach(item->{
-            String[] arr =item.split("_");
+        List<String> columnNames2 = DatabaseUtil.getColumnNames(tableName);
+        List<String> columnNames = new ArrayList<>();
+        for (String item:columnNames2) {
+            String[] arr = item.split("_");
             String str = item;
-            if (arr.length>1){
+            if (arr.length > 1) {
                 str = arr[0];
-                for (int i=1;i<arr.length;i++){
-                    arr[i] = arr[i].substring(0,1).toUpperCase()+arr[i].substring(1);
-                    str+=arr[i];
+                for (int i = 1; i < arr.length; i++) {
+                    arr[i] = arr[i].substring(0, 1).toUpperCase() + arr[i].substring(1);
+                    str += arr[i];
                 }
-                item = str;
+                columnNames.add(str);
             }
-        });
+        }
+
         List<String> columnComments = DatabaseUtil.getColumnComments(tableName);
         List<JSONObject> list = new ArrayList<>();
         for (int i = 0;i<columnNames.size();i++){