| | |
| | | |
| | | // 修改产品信息 |
| | | for (ProductRecord productRecord : productRecords) { |
| | | ticketRegistrations.get(0).setInvoiceAmount(ticketRegistrations.get(0).getInvoiceAmount().subtract(productRecords.get(0).getTicketsAmount())); |
| | | ticketRegistrationMapper.updateById(ticketRegistrations.get(0)); |
| | | BigDecimal subtract = ticketRegistrations.get(0).getInvoiceAmount().subtract(productRecords.get(0).getTicketsAmount()); |
| | | // 小于等于0删除 ,大于0修改 |
| | | if(subtract.compareTo(BigDecimal.ZERO) <= 0){ |
| | | ticketRegistrationMapper.deleteById(ticketRegistrations.get(0)); |
| | | }else if(subtract.compareTo(BigDecimal.ZERO) > 0){ |
| | | ticketRegistrations.get(0).setInvoiceAmount(subtract); |
| | | ticketRegistrationMapper.updateById(ticketRegistrations.get(0)); |
| | | } |
| | | LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | salesLedgerProductLambdaQueryWrapper.eq(SalesLedgerProduct::getId, productRecord.getSaleLedgerProjectId()) |
| | | .eq(SalesLedgerProduct::getType, 2); |
| | |
| | | |
| | | if (ticketRegistration.getStatus()) { |
| | | ticketRegistrationIPage.getRecords().removeIf(receiptPaymentDto1 -> new BigDecimal("0.00").equals(receiptPaymentDto1.getUnPaymentAmountTotal())); |
| | | ticketRegistrationIPage.setTotal(ticketRegistrationIPage.getRecords().size()); |
| | | } |
| | | } |
| | | return ticketRegistrationIPage; |