/**stream typeId去重,count求和**/
armaGroupDTOS=armaGroupDTOS.stream()
.collect(Collectors.toMap(ArmaGroupDTO::getTypeId, a -> a, (o1,o2)-> {
o1.setCount(o1.getCount() + o2.getCount());
return o1;
})).values().stream().collect(Collectors.toList());
java stream 去重求和
最新推荐文章于 2024-07-10 21:37:49 发布