|
@@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.alibaba.fastjson2.TypeReference;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.system.entity.CommonEntity;
|
|
|
import com.ruoyi.system.entity.TableSql;
|
|
@@ -44,9 +45,10 @@ public class CommonServiceImpl implements ICommonService {
|
|
|
List<Map<String, String>> list = commonEntity.getAddListMap();
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
for (Object obj : list) {
|
|
|
- System.out.println(obj);
|
|
|
Map<String, Object> map1 = (Map<String, Object>) obj;
|
|
|
- mapList.add(map1);
|
|
|
+ map1.keySet().forEach(item -> {
|
|
|
+ mapList.add((Map<String, Object>) JSON.parse(toUnderScoreCase(item) + map1.get(item)));
|
|
|
+ });
|
|
|
}
|
|
|
Set<String> fieldNames = new LinkedHashSet<>();
|
|
|
mapList.stream().forEach(map1 -> {
|
|
@@ -62,6 +64,12 @@ public class CommonServiceImpl implements ICommonService {
|
|
|
String tableName = (String) commonEntity.getBasicMap().get("tableName");
|
|
|
Map<String, Object> conditions = JSONObject.parseObject(JSON.toJSONString(commonEntity.getConditionMap()));
|
|
|
Map<String, Object> fields = JSONObject.parseObject(JSON.toJSONString(commonEntity.getCommMap()));
|
|
|
+ Map<String, Object> endfields = null;
|
|
|
+ fields.keySet().forEach(item -> {
|
|
|
+// Map<String, Object> asd = JSONObject.parseObject("{ \"" + toUnderScoreCase(item) + "\":\"" + fields.get(item) + "\"}", new TypeReference<Map<String, Object>>() {
|
|
|
+// });
|
|
|
+ endfields.put(toUnderScoreCase(item), fields.get(item));
|
|
|
+ });
|
|
|
return commonMapper.edit(fields, tableName, conditions);
|
|
|
}
|
|
|
|