| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | |
| | | public AjaxResult getAmountHalfYear() { |
| | | return AjaxResult.success(salesLedgerService.getAmountHalfYear()); |
| | | } |
| | | |
| | | /** |
| | | * 查询销售台账列表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public IPage<SalesLedger> listPage(Page page, SalesLedgerDto salesLedgerDto) { |
| | | IPage<SalesLedger> iPage = salesLedgerService.selectSalesLedgerListPage(page,salesLedgerDto); |
| | | // 计算已开票金额/未开票金额(已填写发票金额为准) |
| | | if(CollectionUtils.isEmpty(iPage.getRecords())){ |
| | | return iPage; |
| | | } |
| | | List<Long> salesLedgerIds = iPage.getRecords().stream().map(SalesLedger::getId).collect(Collectors.toList()); |
| | | List<InvoiceLedgerDto> invoiceLedgerDtoList = invoiceLedgerMapper.invoicedTotal(salesLedgerIds); |
| | | if(CollectionUtils.isEmpty(invoiceLedgerDtoList)){ |
| | | return iPage; |
| | | } |
| | | for (SalesLedger salesLedger : iPage.getRecords()) { |
| | | for (InvoiceLedgerDto invoiceLedgerDto : invoiceLedgerDtoList) { |
| | | if (salesLedger.getId().intValue() == invoiceLedgerDto.getSalesLedgerId()) { |
| | | BigDecimal noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal()); |
| | | salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal); |
| | | } |
| | | } |
| | | } |
| | | return iPage; |
| | | } |
| | | } |