Browse Source

代码微调

dev
jianjun 4 years ago
parent
commit
3497e41e5d
  1. 10
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java

10
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java

@ -81,16 +81,16 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
//3.新增不存在的,删除不在tableColumnMap的
Map<String,IcResiCategoryStatsConfigEntity> statsTableColumnMap = new HashMap<>();
statsConfigEntityList.stream().forEach(item->{
statsConfigEntityList.forEach(item->{
statsTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
Map<String,IcResiCategoryWarnConfigEntity> warnTableColumnMap = new HashMap<>();
warnConfigEntityList.stream().forEach(item->{
warnConfigEntityList.forEach(item->{
warnTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
//差集
//新增
List<String> newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.keySet().contains(item)).collect(Collectors.toList());
List<String> newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.containsKey(item)).collect(Collectors.toList());
List<IcResiCategoryStatsConfigEntity> newStatsEntityList = new ArrayList<>();
newStatsList.forEach(item->{
@ -114,8 +114,8 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
List<String> delStatsEntityIdList = new ArrayList<>();
List<String> delWarnEntityIdList = new ArrayList<>();
//需要删除的
List<String> delStatsList = statsTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.keySet().contains(item)).collect(Collectors.toList());
List<String> delWarnList = warnTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.keySet().contains(item)).collect(Collectors.toList());
List<String> delStatsList = statsTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.containsKey(item)).collect(Collectors.toList());
List<String> delWarnList = warnTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.containsKey(item)).collect(Collectors.toList());
delStatsList.forEach(item->{
delStatsEntityIdList.add(statsTableColumnMap.get(item).getId());
});

Loading…
Cancel
Save