From 366b67926809852c1090f14c5a24fe00109a81b5 Mon Sep 17 00:00:00 2001 From: maven <2163098428@qq.com> Date: 星期一, 28 七月 2025 17:59:52 +0800 Subject: [PATCH] yys 首页接口开发 --- src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java index b5296d9..a18d5c4 100644 --- a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java +++ b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java @@ -65,6 +65,7 @@ if (salesLedger.getId().intValue() == invoiceLedgerDto.getSalesLedgerId()) { BigDecimal noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal()); salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal); + } } } @@ -160,8 +161,8 @@ * 杩戝崐骞村紑绁�,鍥炴閲戦 */ @GetMapping("/getAmountHalfYear") - public AjaxResult getAmountHalfYear() { - return AjaxResult.success(salesLedgerService.getAmountHalfYear()); + public AjaxResult getAmountHalfYear(@RequestParam(value = "type",defaultValue = "1") Integer type) { + return AjaxResult.success(salesLedgerService.getAmountHalfYear(type)); } /** @@ -177,6 +178,7 @@ 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; } for (SalesLedger salesLedger : iPage.getRecords()) { @@ -199,10 +201,11 @@ salesLedger.setInvoiceTotal(invoiceTotal); } if (ObjectUtils.isNotEmpty(salesLedgerDto.getStatus())) { - if (salesLedgerDto.getStatus()==1) { - iPage.getRecords().removeIf(salesLedger -> !Objects.equals(salesLedger.getNoInvoiceAmountTotal(), new BigDecimal("0.00"))); + if (salesLedgerDto.getStatus()) { + iPage.getRecords().removeIf(salesLedger -> Objects.equals(salesLedger.getNoInvoiceAmountTotal(), new BigDecimal("0.00"))); } } + iPage.setTotal(iPage.getRecords().size()); return iPage; } } -- Gitblit v1.9.3