写法1
List<Long> stockCheckSheetIdList = stockCheckSheetPOList
.stream()
.map(StockCheckSheetPO::getId)
.collect(Collectors.toList());
写法2
// 数组
Long[] stockCheckProductDetailsIds = stockCheckProductDetailsPOList
.stream()
.map(StockCheckProductDetailsPO::getId)
.toArray(Long[]::new);
// 数组转list
ArrayList<Long> arrayList = new ArrayList<Long>(stockCheckProductDetailsIds.length);
Collections.addAll(arrayList, stockCheckProductDetailsIds);