master
yixian 7 years ago
parent ba6e50ab5c
commit c011802240

@ -82,13 +82,14 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
List<JSONObject> unsettleReports = transactionMapper.listClientUnsettleDataByDate(clientId);
unsettleReports.parallelStream().forEach(report -> {
report.put("clearing_amount", CurrencyAmountUtils.scalePlatformCurrency(report.getBigDecimal("clearing_amount")));
report.put("settle_amount", CurrencyAmountUtils.scalePlatformCurrency(report.getBigDecimal("settle_amount")));
BigDecimal settleAmount = report.getBigDecimal("settle_amount");
report.put("settle_amount", CurrencyAmountUtils.scalePlatformCurrency(settleAmount == null ? BigDecimal.ZERO : settleAmount));
report.put("date_str", DateFormatUtils.format(report.getDate("trans_date"), "yyyy-MM-dd"));
});
todayTask.put("unsettle", unsettleReports);
BigDecimal totalClearing = unsettleReports.stream().map(report -> report.getBigDecimal("clearing_amount")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
todayTask.put("total_clearing_amount", CurrencyAmountUtils.scalePlatformCurrency(totalClearing));
BigDecimal totalSettle = unsettleReports.stream().map(report -> report.getBigDecimal("settle_amount") == null ? BigDecimal.ZERO : report.getBigDecimal("settle_amount")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
BigDecimal totalSettle = unsettleReports.stream().map(report -> report.getBigDecimal("settle_amount")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
todayTask.put("total_settle_amount", CurrencyAmountUtils.scalePlatformCurrency(totalSettle));
todayTask.put("desc", LocaleSupport.localeMessage("manual_settle.notice"));
}

Loading…
Cancel
Save