From 6f8cb882b706f74b4ea00927b0f3d77ab7937aa5 Mon Sep 17 00:00:00 2001 From: maven <2163098428@qq.com> Date: 星期二, 29 七月 2025 16:04:00 +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