Commit 08ab5f2d by 陶光胜

配置表

parent 5092c583
......@@ -46,7 +46,7 @@ public class CustomSettingApiServiceImpl implements CustomSettingApiService {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), tableName + "不存在");
}
Map<String, Object> map = JSON.parseObject(params, Map.class);
String repeateSetting = tableSetting.getRepeateSetting();
String repeateSetting = tableSetting.getFields();
if(StringUtils.isNotBlank(repeateSetting)){
String[] split = repeateSetting.split(",");
List<Criteria> criteriaList = new ArrayList<>();
......@@ -64,7 +64,14 @@ public class CustomSettingApiServiceImpl implements CustomSettingApiService {
queryDTO.setConllectionName(tableName);
ServiceResponse<List<Map>> query = mongoOperApiService.query(queryDTO);
if(CollectionUtils.isNotEmpty(query.getResult())){
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "存在重复记录");
if(tableSetting.getRepeateOpt() != null && tableSetting.getRepeateOpt() == 1){
//等于1表示重复更新
Map exitMap = query.getResult().get(0);
map.forEach((k, v) -> exitMap.put(k, v));
map = exitMap;
} else {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "存在重复记录");
}
}
}
if(map.get(PRIMARYKEY) != null){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment