天天看点

list集合数据分组重新合并

ysList.parallelStream().collect(Collectors.groupingBy(o->(o.getXsbm()+o.getShdz()+o.getLxr()),Collectors.toList())).forEach(
        (id,transfer) -> transfer.stream().reduce((a, b) -> new YfOrder(a.getPt(),a.getXsbm(),a.getDhkh(),(a.getDh()+","+b.getDh()),a.getDdrq(),a.getFhrq(),a.getShdz(),a.getLxr(),a.getBz(),a.getLxdh())).ifPresent(wfhOrderList::add)
);
           

初次使用,记录不到位的地方,望指教