maven
3 天以前 83a2ac0bbf44d550a4d0add970d14623298a8574
src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
@@ -29,6 +29,7 @@
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -102,6 +103,20 @@
        List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedgerDto);
        ExcelUtil<SalesLedger> util = new ExcelUtil<SalesLedger>(SalesLedger.class);
        util.exportExcel(response, list, "销售台账数据");
    }
    /**
     * 导出开票登记列表
     */
    @Log(title = "导出开票登记列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportOne")
    public void exportOne(HttpServletResponse response, SalesLedgerDto salesLedgerDto) {
        Page page = new Page();
        page.setCurrent(-1);
        page.setSize(-1);
        IPage<SalesLedger> salesLedgerIPage = listPage(page, salesLedgerDto);
        ExcelUtil<SalesLedger> util = new ExcelUtil<SalesLedger>(SalesLedger.class);
        util.exportExcel(response, salesLedgerIPage == null ? new ArrayList<>() : salesLedgerIPage.getRecords(), "导出开票登记列表");
    }
    /**
@@ -191,15 +206,17 @@
        List<Long> salesLedgerIds = iPage.getRecords().stream().map(SalesLedger::getId).collect(Collectors.toList());
        List<InvoiceLedgerDto> invoiceLedgerDtoList = invoiceLedgerMapper.invoicedTotal(salesLedgerIds);
        if(CollectionUtils.isEmpty(invoiceLedgerDtoList)){
            iPage.setTotal(iPage.getRecords().size());
            return iPage;
            invoiceLedgerDtoList = new ArrayList<>();
        }
        // 计算回款金额,待回款金额
        List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(new LambdaQueryWrapper<InvoiceRegistrationProduct>()
                .in(InvoiceRegistrationProduct::getSalesLedgerId, salesLedgerIds));
        List<InvoiceLedger> invoiceLedgers = new ArrayList<>();
        if(!CollectionUtils.isEmpty(invoiceRegistrationProducts)){
            invoiceLedgers = invoiceLedgerMapper.selectList(new LambdaQueryWrapper<InvoiceLedger>()
                    .in(InvoiceLedger::getInvoiceRegistrationProductId, invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getId).collect(Collectors.toList())));
        }
        List<InvoiceLedger> invoiceLedgers = invoiceLedgerMapper.selectList(new LambdaQueryWrapper<InvoiceLedger>()
                .in(InvoiceLedger::getInvoiceRegistrationProductId, invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getId).collect(Collectors.toList())));
        List<ReceiptPayment> receiptPayments = new ArrayList<>();
        if(!CollectionUtils.isEmpty(invoiceLedgers)){
            receiptPayments = receiptPaymentMapper.selectList(new LambdaQueryWrapper<ReceiptPayment>()