JAVA 8 STREAM

// 2 根据贷款号 期号 查询本金和利息(目前先计算本金 不计算利息)
List<NotifyChargeDueInfo> infos = loanTaskMapper.querySimpleChargeDueInfoWithApplicationId(applicationId);
  List<NotifyChargeDueInfo> newInfos = infos.stream().filter(x -> x.getFeeType().equals("principal") && indexs.contains(x.getIndex())) // 注意根据index去重
    (Collectors.toList()); // principal||interest目前只取本金

// 3 计算回购总金额
BigDecimal amount = newInfos.stream().map(NotifyChargeDueInfo::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);

  

posted on 2018-01-09 13:46  jis117  阅读(152)  评论(0编辑  收藏  举报

导航