Map<String, List<CustomerQuotation>> collect1 = customerQuotationList.stream().filter(c -> c.getApprovalId() != null).collect(Collectors.groupingBy(CustomerQuotation::getApprovalId));//根据报价单配置表id分组
Map<String, List<CustomerQuotation>> collect2 = customerQuotationList.stream().filter(c -> c.getApprovalIdPi() != null).collect(Collectors.groupingBy(CustomerQuotation::getApprovalIdPi));
Map<String, List<CustomerQuotation>> collect = new HashMap<String, List<CustomerQuotation>>();
collect.putAll(collect2);
collect.putAll(collect1);
Java map合并操作
最新推荐文章于 2024-08-13 22:38:50 发布