Procházet zdrojové kódy

fix:公共新增修改接口驼峰转换

韩帛霖 před 1 rokem
rodič
revize
f04e415ef3

+ 9 - 1
zkqy-system/src/main/java/com/zkqy/system/service/impl/CommonServiceImpl.java

@@ -97,16 +97,24 @@ public class CommonServiceImpl implements ICommonService {
         fields.keySet().forEach(item -> {
             endfields.put(toUnderScoreCase(item), fields.get(item));
         });
+        Map<String, Object> endConditions = new HashMap<>();
+        conditions.keySet().forEach(item -> {
+            endConditions.put(toUnderScoreCase(item), conditions.get(item));
+        });
         endfields.put("update_by", SecurityUtils.getUsername());
         endfields.put("update_time", DateUtils.getTime());
         endfields.put("update_by_id", SecurityUtils.getUserId());
-        return commonMapper.edit(endfields, tableName, conditions);
+        return commonMapper.edit(endConditions, tableName, conditions);
     }
 
     @Override
     public int batchDelete(CommonEntity commonEntity) {
         String tableName = (String) commonEntity.getBasicMap().get("tableName");
         Map<String, Object> conditions = JSONObject.parseObject(JSON.toJSONString(commonEntity.getConditionMap()));
+        Map<String, Object> endConditions = new HashMap<>();
+        conditions.keySet().forEach(item -> {
+            endConditions.put(toUnderScoreCase(item), conditions.get(item));
+        });
         return commonMapper.batchDelete(tableName, conditions);
     }