From 4c09e9770b4aecae41269865f4165fce00c00e72 Mon Sep 17 00:00:00 2001 From: wany <13995595726@qq.com> Date: Wed, 30 Oct 2024 10:26:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E6=AE=B5=E6=B0=B4?= =?UTF-8?q?=E4=BD=8D=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gunshi/project/xyt/service/StatisticsService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gunshi/project/xyt/service/StatisticsService.java b/src/main/java/com/gunshi/project/xyt/service/StatisticsService.java index 5aaa9e9..d97b875 100644 --- a/src/main/java/com/gunshi/project/xyt/service/StatisticsService.java +++ b/src/main/java/com/gunshi/project/xyt/service/StatisticsService.java @@ -192,7 +192,9 @@ public class StatisticsService { count++; } } - vo.setRzAvg(rzD.divide(new BigDecimal(count), 2, RoundingMode.HALF_UP)); + if(count > 0){ + vo.setRzAvg(rzD.divide(new BigDecimal(count), 2, RoundingMode.HALF_UP)); + } } }