From ca4034c3a285f2c22fa19e5eaa88d505b5588c0b Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期三, 29 十二月 2021 10:48:40 +0800 Subject: [PATCH] Merge branch 'master' into test --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 60 +++++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 39 insertions(+), 21 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 acbd97b..0039879 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 @@ -7823,35 +7823,43 @@ IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO(); otherSpecialVO.setTitle("其他"); otherSpecialVO.setSum(0); - int countAll=comMngPopulationDAO.getSpecialStatistics(communityId); + IndexSpecialStatisticsVO otherSpecialVO1 = new IndexSpecialStatisticsVO(); + otherSpecialVO1.setTitle("普通居民"); + otherSpecialVO1.setSum(0); + int countNormal=comMngPopulationDAO.getSpecialStatistics(communityId); + int countElder=comMngPopulationDAO.getStatisticsCount(communityId); + int countAll=countElder+countNormal; if (!userTagList.isEmpty()) { userTagList.forEach(userTag -> { if (userTag != null) { - if (userTag.getSysFlag().equals(0)) { - Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); + if(userTag.getTagName().equals("高龄老人")||userTag.getTagName().equals("残疾人")||userTag.getTagName().equals("低保户")||userTag.getTagName().equals("退役军人")||userTag.getTagName().equals("养老金人员")||userTag.getTagName().equals("低收入")){ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); - otherSpecialVO.setSum(otherSpecialVO.getSum()+count); specialStatisticsVO.setTitle(userTag.getTagName()); + Integer count =0; + if (userTag.getTagName().equals("高龄老人")) { + count=countElder; + } + else { + count= comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); + } specialStatisticsVO.setSum(count); specialStatisticsVO.setPercent(BigDecimal.valueOf(specialStatisticsVO.getSum()*100d/countAll).setScale(2,BigDecimal.ROUND_HALF_UP)); + otherSpecialVO1.setSum(otherSpecialVO1.getSum()+count); specialStatisticsVOList.add(specialStatisticsVO); - } else { - if (StringUtils.isNotEmpty(userTag.getTagName())) { - IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); - specialStatisticsVO.setTitle(userTag.getTagName()); - Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); - otherSpecialVO.setSum(otherSpecialVO.getSum()+count); - specialStatisticsVO.setSum(count); - specialStatisticsVO.setPercent(BigDecimal.valueOf(specialStatisticsVO.getSum()*100d/countAll).setScale(2,BigDecimal.ROUND_HALF_UP)); - specialStatisticsVOList.add(specialStatisticsVO); - } + } + else{ + Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); + otherSpecialVO.setSum(otherSpecialVO.getSum()+count); + otherSpecialVO1.setSum(otherSpecialVO1.getSum()+count); } } }); } - otherSpecialVO.setSum(countAll-otherSpecialVO.getSum()); otherSpecialVO.setPercent(BigDecimal.valueOf(otherSpecialVO.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); // 查询网格化治理 IndexEventGridStatisticsVO eventGridStatisticsVO = new IndexEventGridStatisticsVO(); @@ -7859,12 +7867,22 @@ // 查询网格化事件数据 IndexGridEventStatisticsVO gridEventStatistics = comMngPopulationDAO.getGridEventStatisticsList(communityId); int count=gridEventStatistics.getEventGGTotal()+gridEventStatistics.getEventBWDTotal()+gridEventStatistics.getEventMDTotal()+gridEventStatistics.getEventTFTotal()+gridEventStatistics.getEventTSTotal()+gridEventStatistics.getEventZATotal(); - gridEventStatistics.setGgPercent(BigDecimal.valueOf(gridEventStatistics.getEventGGTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); - gridEventStatistics.setBwdPercent(BigDecimal.valueOf(gridEventStatistics.getEventBWDTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); - gridEventStatistics.setMdPercent(BigDecimal.valueOf(gridEventStatistics.getEventMDTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); - gridEventStatistics.setTfPercent(BigDecimal.valueOf(gridEventStatistics.getEventTFTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); - gridEventStatistics.setTsPercent(BigDecimal.valueOf(gridEventStatistics.getEventTSTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); - gridEventStatistics.setZaPercent(BigDecimal.valueOf(gridEventStatistics.getEventZATotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); + if(count!=0){ + gridEventStatistics.setGgPercent(BigDecimal.valueOf(gridEventStatistics.getEventGGTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); + gridEventStatistics.setBwdPercent(BigDecimal.valueOf(gridEventStatistics.getEventBWDTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); + gridEventStatistics.setMdPercent(BigDecimal.valueOf(gridEventStatistics.getEventMDTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); + gridEventStatistics.setTfPercent(BigDecimal.valueOf(gridEventStatistics.getEventTFTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); + gridEventStatistics.setTsPercent(BigDecimal.valueOf(gridEventStatistics.getEventTSTotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); + gridEventStatistics.setZaPercent(BigDecimal.valueOf(gridEventStatistics.getEventZATotal()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP)); + }else{ + gridEventStatistics.setGgPercent(BigDecimal.valueOf(0)); + gridEventStatistics.setBwdPercent(BigDecimal.valueOf(0)); + gridEventStatistics.setMdPercent(BigDecimal.valueOf(0)); + gridEventStatistics.setTfPercent(BigDecimal.valueOf(0)); + gridEventStatistics.setTsPercent(BigDecimal.valueOf(0)); + gridEventStatistics.setZaPercent(BigDecimal.valueOf(0)); + } + eventGridStatisticsVO.setGridEventStatisticsList(gridEventStatistics); // 查询网格数据 List<EventGridDataVO> gridDataList = comMngPopulationDAO.getGridDataListByCommunityId(communityId); -- Gitblit v1.7.1