From eaf90fb8b56ea82f87f84acf3357bcfcd970e8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E5=B1=95=E8=88=AA?= <2426745133@qq.com> Date: Thu, 6 Nov 2025 11:53:42 +0800 Subject: [PATCH] =?UTF-8?q?11-06-=E6=9B=B4=E6=96=B00=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OpsInspectionReportServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/inspection/service/impl/OpsInspectionReportServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/inspection/service/impl/OpsInspectionReportServiceImpl.java index acf865a..9f77b4c 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/inspection/service/impl/OpsInspectionReportServiceImpl.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/inspection/service/impl/OpsInspectionReportServiceImpl.java @@ -283,8 +283,14 @@ public class OpsInspectionReportServiceImpl implements IOpsInspectionReportServi //完成率 //完成数 int finishCount = thisMonth.stream().filter(vo -> vo.getStatus().equals("3")).toList().size(); - BigDecimal divide = BigDecimal.valueOf(finishCount).divide(BigDecimal.valueOf(thisMonth.size()), 2, RoundingMode.HALF_UP); - recordVo.setWcl(divide.multiply(new BigDecimal("100")).toString()); + BigDecimal divide = BigDecimal.ZERO; + if (thisMonth.size() == 0){ + divide = BigDecimal.valueOf(finishCount).divide(BigDecimal.valueOf(thisMonth.size()), 2, RoundingMode.HALF_UP); + recordVo.setWcl(divide.multiply(new BigDecimal("100")).toString()); + }else { + recordVo.setWcl("0"); + } + //统计上一月的数据 firstDay = LocalDate.now().minusMonths(1).withDayOfMonth(1);