maven
14 小时以前 ccf8e35d90bcfe06d9c28af3029c806d1ceb1b11
src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java
@@ -265,8 +265,14 @@
        // 修改产品信息
        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);
@@ -354,6 +360,7 @@
            if (ticketRegistration.getStatus()) {
                ticketRegistrationIPage.getRecords().removeIf(receiptPaymentDto1 -> new BigDecimal("0.00").equals(receiptPaymentDto1.getUnPaymentAmountTotal()));
                ticketRegistrationIPage.setTotal(ticketRegistrationIPage.getRecords().size());
            }
        }
        return ticketRegistrationIPage;