List<CommonExportDTO> commonList;
// 取字段string转int构建新列表
List<Integer> collect = commonList.stream().map(dto -> Integer.valueOf(dto.getCell6())).collect(Collectors.toList());
// reduce求和
Optional<Integer> reduce = collect.stream().reduce(Integer::sum);
Integer total = reduce.get();

 

相关文章:

  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2021-11-11
  • 2020-07-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2021-12-17
  • 2021-11-30
  • 2021-07-17
相关资源
相似解决方案