From 20830ae1a5907bf02d00db2f6fcd626e50aa875c Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期一, 07 三月 2022 22:20:51 +0800
Subject: [PATCH] 修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
index 08b9cd4..7e40fe2 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -7976,7 +7976,11 @@
                             count= comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
                         }
                         specialStatisticsVO.setSum(count);
-                        specialStatisticsVO.setPercent(BigDecimal.valueOf(specialStatisticsVO.getSum()*100d/countAll).setScale(2,BigDecimal.ROUND_HALF_UP));
+                        if(countAll == 0){
+                            specialStatisticsVO.setPercent(BigDecimal.ZERO);
+                        }else{
+                            specialStatisticsVO.setPercent(BigDecimal.valueOf(specialStatisticsVO.getSum()*100d/countAll).setScale(2,BigDecimal.ROUND_HALF_UP));
+                        }
                         otherSpecialVO1.setSum(otherSpecialVO1.getSum()+count);
                         specialStatisticsVOList.add(specialStatisticsVO);
                     }
@@ -7988,10 +7992,16 @@
                 }
             });
         }
-        otherSpecialVO.setPercent(BigDecimal.valueOf(otherSpecialVO.getSum()*100d/countAll).setScale(2,BigDecimal.ROUND_HALF_UP));
+        if(countAll == 0){
+            otherSpecialVO.setPercent(BigDecimal.ZERO);
+            otherSpecialVO1.setPercent(BigDecimal.ZERO);
+        }else{
+            otherSpecialVO.setPercent(BigDecimal.valueOf(otherSpecialVO.getSum()*100d/countAll).setScale(2,BigDecimal.ROUND_HALF_UP));
+            otherSpecialVO1.setPercent(BigDecimal.valueOf(otherSpecialVO1.getSum()*100d/countAll).setScale(2,BigDecimal.ROUND_HALF_UP));
+        }
         specialStatisticsVOList.add(otherSpecialVO);
         otherSpecialVO1.setSum(countAll-otherSpecialVO1.getSum());
-        otherSpecialVO1.setPercent(BigDecimal.valueOf(otherSpecialVO1.getSum()*100d/countAll).setScale(2,BigDecimal.ROUND_HALF_UP));
+
         specialStatisticsVOList.add(otherSpecialVO1);
         indexInfo.setSpecialStatisticsVOList(specialStatisticsVOList);
         // 查询网格化治理

--
Gitblit v1.7.1