某个字段求和:
listPro.stream().map(LoanProvisionInfoEntity::getProvisionAmt).reduce(BigDecimal.ZERO,BigDecimal::add);
按照某个字段进行分组
Map> mapGroup=listProQuota.stream().collect(Collectors.groupingBy(LoanProvisionQuotaInfo::getRepayDate));
根据条件进行过滤:
input.getRepayPlanList().stream().filter(o->
o.getStageType().equalsIgnoreCase(SegmentTypeEnums.BILLING_SUB_SEGMENT.getCode())||
o.getStageType().equalsIgnoreCase(SegmentTypeEnums.CONSUME_SUB_SEGMENT.getCode()))
.collect(Collectors.toList());
最小值
loanRepayPlanInfos.stream().min(Comparator.comparing(o -> o.getSterm())).get();