| | |
| | | @Override |
| | | public int insertPaymentRegistration(PaymentRegistration paymentRegistration) { |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(paymentRegistration.getPurchaseLedgerId()); |
| | | if(purchaseLedger == null){ |
| | | throw new RuntimeException("关联采购台账不存在"); |
| | | } |
| | | SalesLedger salesLedger = salesLedgerMapper.selectOne(new QueryWrapper<SalesLedger>(). |
| | | eq("sales_contract_no", purchaseLedger.getSalesContractNo())); |
| | | // if (salesLedger == null) { |
| | |
| | | // 应付总金额金额计算 |
| | | 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; |