From 5a8a90c095280fbd2106869ecd2bad10e01a57a6 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期四, 23 十二月 2021 18:10:22 +0800
Subject: [PATCH] 12/23  大屏修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java |   38 +++++++++++++++-----------------------
 1 files changed, 15 insertions(+), 23 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 2b2ac35..bbd5ca8 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
@@ -7833,36 +7833,18 @@
                         otherSpecialVO.setPercent(otherSpecialVO.getSum()*100/countAll);
                     } else {
                         if (StringUtils.isNotEmpty(userTag.getTagName())) {
-                            if (userTag.getTagName().equals("特扶家庭")) {
-                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
-                                specialStatisticsVO.setTitle(userTag.getTagName());
-                                specialStatisticsVO.setSum(22);
-                                specialStatisticsVOList.add(specialStatisticsVO);
-                            } else if (userTag.getTagName().equals("低保户")) {
-                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
-                                specialStatisticsVO.setTitle(userTag.getTagName());
-                                specialStatisticsVO.setSum(94);
-                                specialStatisticsVOList.add(specialStatisticsVO);
-                            } else if (userTag.getTagName().equals("低收入人群")) {
-                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
-                                specialStatisticsVO.setTitle(userTag.getTagName());
-                                specialStatisticsVO.setSum(2);
-                                specialStatisticsVOList.add(specialStatisticsVO);
-                            } else if (userTag.getTagName().equals("退役军人")) {
-                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
-                                specialStatisticsVO.setTitle(userTag.getTagName());
-                                specialStatisticsVO.setSum(264);
-                                specialStatisticsVOList.add(specialStatisticsVO);
-                            } else if (userTag.getTagName().equals("高龄老人")) {
+                            if (userTag.getTagName().equals("高龄老人")) {
                                 IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                                 specialStatisticsVO.setTitle(userTag.getTagName());
                                 specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId));
+                                specialStatisticsVO.setPercent(specialStatisticsVO.getSum()*100/countAll);
                                 specialStatisticsVOList.add(specialStatisticsVO);
                             } else {
                                 IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                                 specialStatisticsVO.setTitle(userTag.getTagName());
                                 Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
                                 specialStatisticsVO.setSum(count);
+                                specialStatisticsVO.setPercent(specialStatisticsVO.getSum()*100/countAll);
                                 specialStatisticsVOList.add(specialStatisticsVO);
                             }
                         }
@@ -7911,13 +7893,23 @@
         indexBackReserve.setCount(comActReserveMapper.indexBackReserve(communityId));
         indexBackReserve.setIndexReserveSubList(comActReserveMapper.indexBackReserveSub(communityId));
         indexBackReserve.getIndexReserveSubList().forEach(indexReserveSub -> {
-            indexReserveSub.setPercent(indexReserveSub.getNum()*100/indexReserveSub.getAllCount());
+            if(indexReserveSub.getAllCount()!=0){
+                indexReserveSub.setPercent(indexReserveSub.getNum()*100/indexReserveSub.getAllCount());
+            }
+            else {
+                indexReserveSub.setPercent(0);
+            }
         });
         IndexHomeQuarantine indexHomeQuarantine=new IndexHomeQuarantine();
         indexHomeQuarantine.setCount(comActReserveMapper.indexHomeQuarantine(communityId));
         indexHomeQuarantine.setIndexReserveSubList(comActReserveMapper.IndexHomeQuarantineSub(communityId));
         indexHomeQuarantine.getIndexReserveSubList().forEach(indexReserveSub -> {
-            indexReserveSub.setPercent(indexReserveSub.getNum()*100/indexReserveSub.getAllCount());
+            if(indexReserveSub.getAllCount()!=0){
+                indexReserveSub.setPercent(indexReserveSub.getNum()*100/indexReserveSub.getAllCount());
+            }
+            else {
+                indexReserveSub.setPercent(0);
+            }
         });
         indexReserve.setIndexBackReserve(indexBackReserve);
         indexReserve.setIndexHomeQuarantine(indexHomeQuarantine);

--
Gitblit v1.7.1