|
@@ -156,7 +156,6 @@ public class PackingBillPdfServiceImpl implements IPackingBillPdfService {
|
|
|
if (CollectionUtils.isEmpty(packingProducts)) {
|
|
|
return new HashMap<>();
|
|
|
}
|
|
|
-
|
|
|
Map<String, List<ShipmentPackingProduct>> map = new HashMap<>();
|
|
|
// 按照箱子id分组
|
|
|
Map<String, List<ShipmentPackingProduct>> collect = packingProducts.stream().collect(Collectors.groupingBy(ShipmentPackingProduct::getShipmentPackingId));
|
|
@@ -211,14 +210,11 @@ public class PackingBillPdfServiceImpl implements IPackingBillPdfService {
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
List<JSONObject> values = new ArrayList<>();
|
|
|
-
|
|
|
// 根据产品id-数量去重
|
|
|
- ArrayList<ShipmentPackingProduct> products = list.stream()
|
|
|
- .collect(Collectors.collectingAndThen(
|
|
|
+ ArrayList<ShipmentPackingProduct> products = list.stream().collect(Collectors.collectingAndThen(
|
|
|
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(obj -> obj.getProductId() + "-" + obj.getQuantity()))),
|
|
|
ArrayList::new)
|
|
|
);
|
|
|
-
|
|
|
// 总箱数,根据箱子id去重
|
|
|
// long boxTotal = list.stream().map(ShipmentPackingProduct::getShipmentPackingId).distinct().count();
|
|
|
ArrayList<ShipmentPackingProduct> box = list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(obj -> obj.getShipmentPackingId()))), ArrayList::new));
|