| | |
| | | List<PaymentRegistration> paymentRegistrations = paymentRegistrationMapper.selectList(new QueryWrapper<PaymentRegistration>() |
| | | .eq("ticket_registration_id", registrationDto.getTicketRegistrationId())); |
| | | BigDecimal total = paymentRegistrations.stream().map(PaymentRegistration::getCurrentPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | registrationDto.setUnPaymentAmount(registrationDto.getInvoiceAmount().subtract(total)); |
| | | BigDecimal invoiceAmount = (null != registrationDto.getInvoiceAmount())? registrationDto.getInvoiceAmount() : BigDecimal.ZERO; |
| | | registrationDto.setUnPaymentAmount(invoiceAmount.subtract(total)); |
| | | } |
| | | return list; |
| | | } |