| | |
| | | if (!ObjectUtils.isEmpty(byId.getId())){ |
| | | receiptPaymentDto1.setNoReceiptAmount(receiptPaymentDto1.getNoReceiptAmount().add(byId.getReceiptPaymentAmount())); |
| | | } |
| | | if (receiptPaymentDto1.getNoReceiptAmount().compareTo(receiptPayment.getReceiptPaymentAmount())<0){ |
| | | throw new RuntimeException("本次回款金额不能大于待回款金额"); |
| | | } |
| | | // if (receiptPaymentDto1.getNoReceiptAmount().compareTo(receiptPayment.getReceiptPaymentAmount())<0){ |
| | | // throw new RuntimeException("本次回款金额不能大于待回款金额"); |
| | | // } |
| | | if(null==receiptPayment.getId()){ |
| | | |
| | | return receiptPaymentMapper.insert(receiptPayment); |
| | |
| | | if (receiptPaymentDto.getStatus()) { |
| | | receiptPaymentDtoIPage.getRecords().removeIf(receiptPaymentDto1 -> new BigDecimal("0.00").equals(receiptPaymentDto1.getNoReceiptAmount())); |
| | | } |
| | | receiptPaymentDtoIPage.getRecords().forEach(item -> { |
| | | // 比较回款金额 == 待回款金额 |
| | | if (item.getInvoiceTotal().compareTo(item.getReceiptPaymentAmountTotal()) == 0) { |
| | | item.setStatusName("已完成回款"); |
| | | }else{ |
| | | item.setStatusName("未完成回款"); |
| | | } |
| | | |
| | | }); |
| | | return receiptPaymentDtoIPage; |
| | | } |
| | | |