| | |
| | | if (!orderList.getRecords().isEmpty()) { |
| | | // 总金额 |
| | | totalMoney = orderList.getRecords().stream().map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal reduce = orderList.getRecords().stream().map(Order::getSubsidy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal reduce = orderList.getRecords().stream().filter(e->e.getSubsidy()!=null).map(Order::getSubsidy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | totalMoney = reduce.add(totalMoney); |
| | | // 未提现金额withdrawn |
| | | withdrawn = orderList.getRecords().stream().filter(data -> Constants.ZERO.equals(data.getIsWithdrawal())) |
| | | .map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal reduce1 = orderList.getRecords().stream().filter(data -> Constants.ZERO.equals(data.getIsWithdrawal())) |
| | | BigDecimal reduce1 = orderList.getRecords().stream().filter(data -> Constants.ZERO.equals(data.getIsWithdrawal())&&data.getSubsidy()!=null) |
| | | .map(Order::getSubsidy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | withdrawn = reduce1.add(withdrawn); |
| | | // 已提现金额 |
| | | undelivered = orderList.getRecords().stream().filter(data -> Constants.ONE.equals(data.getIsWithdrawal())) |
| | | .map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal reduce2 = orderList.getRecords().stream().filter(data -> Constants.ONE.equals(data.getIsWithdrawal())) |
| | | BigDecimal reduce2 = orderList.getRecords().stream().filter(data -> Constants.ONE.equals(data.getIsWithdrawal())&&data.getSubsidy()!=null) |
| | | .map(Order::getSubsidy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | undelivered = reduce2.add(undelivered); |
| | | } |