| | |
| | | // 应付总金额金额计算 |
| | | BigDecimal amountTotal = BigDecimal.ZERO; |
| | | if(CollectionUtils.isNotEmpty(paymentRecordList)) { |
| | | // 核心分组求和逻辑 |
| | | Map<LocalDate, List<PaymentHistoryRecordVo>> dateListMap = paymentRecordList.stream().collect( |
| | | Collectors.groupingBy( |
| | | PaymentHistoryRecordVo::getHappenTime, |
| | | LinkedHashMap::new, |
| | | Collectors.toList() |
| | | ) |
| | | ); |
| | | Collectors.groupingBy( |
| | | PaymentHistoryRecordVo::getHappenTime, |
| | | LinkedHashMap::new, |
| | | Collectors.toList() |
| | | ) |
| | | ); |
| | | for (LocalDate localDate : dateListMap.keySet()) { |
| | | BigDecimal currentPaymentAmount = BigDecimal.ZERO; |
| | | BigDecimal invoiceAmount = BigDecimal.ZERO; |
| | |
| | | SELECT * FROM( |
| | | SELECT |
| | | T1.issue_date AS happenTime, |
| | | IFNULL(T1.invoice_amount,0) AS invoiceAmount, |
| | | sum(IFNULL(T1.invoice_amount,0)) AS invoiceAmount, |
| | | '1' AS type, |
| | | 0 AS currentPaymentAmount |
| | | FROM |
| | |
| | | payment_date AS happenTime, |
| | | 0 AS invoiceAmount, |
| | | '0' AS type, |
| | | current_payment_amount AS currentPaymentAmount |
| | | sum(ifnull(current_payment_amount,0)) AS currentPaymentAmount |
| | | FROM payment_registration |
| | | WHERE supplier_id = #{supplierId} |
| | | ) T1 |