java110 лет назад: 4
Родитель
Сommit
3c43470ce4

+ 6 - 2
java110-utils/src/main/java/com/java110/utils/util/StringUtil.java

@@ -615,8 +615,9 @@ public class StringUtil {
     /**
      * 下划线转驼峰
      */
-    public static void lineToHump(JSONObject json) {
+    public static JSONObject lineToHump(JSONObject json) {
         Pattern linePattern = Pattern.compile("_(\\w)");
+        JSONObject newJson = new JSONObject();
         for(String str : json.keySet()) {
             str = str.toLowerCase();
             Matcher matcher = linePattern.matcher(str);
@@ -625,8 +626,11 @@ public class StringUtil {
                 matcher.appendReplacement(sb, matcher.group(1).toUpperCase());
             }
             matcher.appendTail(sb);
-            json.put(sb.toString(),json.getString(str));
+            newJson.put(sb.toString(),json.getString(str));
+            newJson.put(str,json.getString(str));
         }
+
+        return newJson;
     }
 
     /**

+ 4 - 4
service-order/src/main/java/com/java110/order/smo/impl/AsynNotifySubServiceImpl.java

@@ -133,12 +133,12 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
                 JSONObject logText = JSONObject.parseObject(orderItem.get("logText").toString());
                 if ("ADD".equals(orderItem.get("action")) || "MOD".equals(orderItem.get("action"))) {
                     data = logText.getJSONArray("afterValue").getJSONObject(0);
-                    StringUtil.lineToHump(data);
+                    data = StringUtil.lineToHump(data);
                     businessObj.setData(data);
                 }
                 if ("DEL".equals(orderItem.get("action"))) {
                     data = logText.getJSONArray("preValue").getJSONObject(0);
-                    StringUtil.lineToHump(data);
+                    data = StringUtil.lineToHump(data);
                     businessObj.setData(data);
                 }
                 businessObjs.add(businessObj);
@@ -212,7 +212,7 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
             String keySql = "( ";
             String valueSql = " values (";
             for (String key : keyValue.keySet()) {
-                if ("status_cd".equals(key) || "create_time".equals(key)) {
+                if ("status_cd".equals(key) || "create_time".equals(key) || "b_id".equals(key)) {
                     continue;
                 }
                 keySql += (key + ",");
@@ -259,7 +259,7 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
             String keySql = "( ";
             String valueSql = " values (";
             for (String key : keyValue.keySet()) {
-                if ("status_cd".equals(key) || "create_time".equals(key)) {
+                if ("status_cd".equals(key) || "create_time".equals(key) || "b_id".equals(key)) {
                     continue;
                 }
                 keySql += (key + ",");