1,java8 把多个list合并为一个list
List<String> allWayBill = Stream.of(list1, list2, list3).flatMap(Collection::stream).collect(Collectors.toList());
2,处理List<List<Object>> list嵌套,取Object中某熟悉
Map<String, List<User>> userMap;
List<String> usreNames = userMap.values().stream().flatMap(Collection::stream).map(User::getUserName).distinct().collect(Collectors.toList());
3,List<Object>
门店商品对应多个库存地点,匹配库存地点,如果匹配多个,取第一个
List<ResShopProductStockVO.Detail> details = productStockMap.get(value.getLocationCode() + value.getProductCode());
double repertory = Optional.ofNullable(details).flatMap(stock -> stock.stream().filter(v -> Objects.equals(v
.getStorage(), value.getSendStockLocation())).findFirst()).map(stock -> stock.getRepertory()).orElse(0d);