|
|
@@ -132,6 +132,18 @@ public class ExperimentalConfigProvider extends GenericProvider implements IExpe
|
|
|
APIResult<Void> result = new APIResult<Void>();
|
|
|
try{
|
|
|
if(CollectionUtils.isNotEmpty(requestList)){
|
|
|
+
|
|
|
+ //删除操作
|
|
|
+ //查询出t_xnyzpzxx表的所有主键,和传入的id对比,如果在传入id种不存在,则删除操作
|
|
|
+ List<String> allIdList = experimentalDao.getAllConfigIds();
|
|
|
+ List<String> requestIdList = requestList.stream().map(ExperimentalConfigPo::getId).collect(Collectors.toList());
|
|
|
+ List<String> deleteIdList = allIdList.stream().filter(element -> !requestIdList.contains(element)).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isNotEmpty(deleteIdList)){
|
|
|
+ String[] deleteIds = deleteIdList.toArray(new String[deleteIdList.size()]);
|
|
|
+ this.remove(deleteIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新和新增操作
|
|
|
for(ExperimentalConfigPo po:requestList){
|
|
|
//遍历前端传入的数据数据,如果id为空则创建,否则更新
|
|
|
List<String> allConfigIds = experimentalDao.getAllConfigIds();
|
|
|
@@ -142,19 +154,9 @@ public class ExperimentalConfigProvider extends GenericProvider implements IExpe
|
|
|
//创建
|
|
|
//该创建只插入target_ 和 target_key_ ,其它内容在配置页面去填写后在更新
|
|
|
experimentalDao.createConfigforTarget(po.getTarget(),po.getTargetKey());
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- //删除操作
|
|
|
- //查询出t_xnyzpzxx表的所有主键,和传入的id对比,如果在传入id种不存在,则删除操作
|
|
|
- List<String> allIdList = experimentalDao.getAllConfigIds();
|
|
|
- List<String> requestIdList = requestList.stream().map(ExperimentalConfigPo::getId).collect(Collectors.toList());
|
|
|
- List<String> deleteIdList = allIdList.stream().filter(element -> !requestIdList.contains(element)).collect(Collectors.toList());
|
|
|
- if(CollectionUtils.isNotEmpty(deleteIdList)){
|
|
|
- String[] deleteIds = deleteIdList.toArray(new String[deleteIdList.size()]);
|
|
|
- this.remove(deleteIds);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
result.setMessage("批量保存性能验证配置成功");
|
|
|
}catch (Exception e){
|