stream 常用操作 1.收集对象属性2.对象属性分组 1.收集对象属性 List ids = dataList.stream().map(TradeSalesExwarehouseInfoForRailwayVo::getRelatedDocId).collect(Collectors.toList()); 2.对象属性分组 Map<String, List<TradeExwarehouseBatchInfoDto>> groupBy = batchInfoDtos.stream().collect(Collectors.groupingBy(TradeExwarehouseBatchInfoDto::getExwarehouseNo));