| | |
| | | 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; |
| | |
| | | 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(), "导出开票登记列表"); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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>() |