list 多属性去重

List supplierInventoryList = supplierInventorySyncs.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o-> o.getSkuNo() + ";" + o.getSupplierNo() + ";" + o.getWarehouseNo() + ";" + o.getSyncType()))),ArrayList::new));

你可能感兴趣的:(list 多属性去重)