From 386422bc84d1972de2a99c73d19722e04d4d4fd5 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Sun, 28 Sep 2025 11:14:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/customer/CustomerServiceImpl.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerServiceImpl.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerServiceImpl.java index 7efe4e5..8888f59 100644 --- a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerServiceImpl.java +++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerServiceImpl.java @@ -81,10 +81,18 @@ public class CustomerServiceImpl implements CustomerService { dashboardRespVO.setLicenseCount(licenseCount); dashboardRespVO.setContractCount(contractCount); dashboardRespVO.setUserCount(customerMapper.selectUserCount()); - dashboardRespVO.setSigningRate(BigDecimal.valueOf(contractCount).multiply(BigDecimal.valueOf(100)) - .divide(BigDecimal.valueOf(projectCount), 0, RoundingMode.HALF_UP).longValue()); - dashboardRespVO.setCompletionRate(BigDecimal.valueOf(contractCount).multiply(BigDecimal.valueOf(100)) - .divide(BigDecimal.valueOf(licenseCount), 0, RoundingMode.HALF_UP).longValue()); + if (projectCount == 0) { + dashboardRespVO.setSigningRate(0L); + } else { + dashboardRespVO.setSigningRate(BigDecimal.valueOf(contractCount).multiply(BigDecimal.valueOf(100)) + .divide(BigDecimal.valueOf(projectCount), 0, RoundingMode.HALF_UP).longValue()); + } + if (licenseCount == 0) { + dashboardRespVO.setCompletionRate(0L); + } else { + dashboardRespVO.setCompletionRate(BigDecimal.valueOf(contractCount).multiply(BigDecimal.valueOf(100)) + .divide(BigDecimal.valueOf(licenseCount), 0, RoundingMode.HALF_UP).longValue()); + } return dashboardRespVO; }