根据三个条件依次去重
list = list.stream()
.collect(Collectors.collectingAndThen(
Collectors.toCollection(() ->
new TreeSet<>(Comparator
.comparing(PosImportExcel::getStoreCode)
.thenComparing(PosImportExcel::getBarCode)
.thenComparing(PosImportExcel::getMonth)
)), ArrayList::new));
stream根据字段去重
于 2020-08-07 16:43:20 首次发布