From e5264875e82ad63ff96f6d5fe7b891fb6c2b3221 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期三, 08 十二月 2021 17:14:59 +0800
Subject: [PATCH] 12/8 大屏修改提交

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java |  162 +++++++++++++++++++++++++++---------------------------
 1 files changed, 81 insertions(+), 81 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 d9efa49..2f76344 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
@@ -7043,66 +7043,66 @@
         // 查询特殊人群统计
         List<IndexSpecialStatisticsVO> specialStatisticsVOList = new ArrayList<>();
 
-        // 查询特殊人群标签列表
-//        List<ComMngUserTagVO> userTagList = comMngPopulationDAO.getUserTagListByCommunityId(communityId);
-//        IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO();
-//        otherSpecialVO.setTitle("其他");
-//        otherSpecialVO.setSum(0);
-//        if (!userTagList.isEmpty()) {
-//            userTagList.forEach(userTag -> {
-//                if (userTag != null) {
-//                    if (userTag.getSysFlag().equals(0)) {
-//                        Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
-//                        otherSpecialVO.setSum(otherSpecialVO.getSum() + count);
-//                    } 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("高龄老人")) {
-//                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
-//                                specialStatisticsVO.setTitle(userTag.getTagName());
-//                                specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId));
-//                                specialStatisticsVOList.add(specialStatisticsVO);
-//                            } else {
-//                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
-//                                specialStatisticsVO.setTitle(userTag.getTagName());
-//                                Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
-//                                specialStatisticsVO.setSum(count);
-//                                specialStatisticsVOList.add(specialStatisticsVO);
-//                            }
-//                        }
-//                    }
-//                }
-//            });
-//        }
-//        // 计算特殊人群总数
-//        specialStatisticsVOList.add(otherSpecialVO);
-//        Integer specialNum = 0;
-//        if (!specialStatisticsVOList.isEmpty()) {
-//            for (IndexSpecialStatisticsVO special : specialStatisticsVOList) {
-//                specialNum += special.getSum();
-//            }
-//        }
-//        civilStatisticsVO.setSpecialNum(specialNum);
-//        civilStatisticsVO.setSpecialStatisticsList(specialStatisticsVOList);
+        //查询特殊人群标签列表
+        List<ComMngUserTagVO> userTagList = comMngPopulationDAO.getUserTagListByCommunityId(communityId);
+        IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO();
+        otherSpecialVO.setTitle("其他");
+        otherSpecialVO.setSum(0);
+        if (!userTagList.isEmpty()) {
+            userTagList.forEach(userTag -> {
+                if (userTag != null) {
+                    if (userTag.getSysFlag().equals(0)) {
+                        Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
+                        otherSpecialVO.setSum(otherSpecialVO.getSum() + count);
+                    } 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("高龄老人")) {
+                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
+                                specialStatisticsVO.setTitle(userTag.getTagName());
+                                specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId));
+                                specialStatisticsVOList.add(specialStatisticsVO);
+                            } else {
+                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
+                                specialStatisticsVO.setTitle(userTag.getTagName());
+                                Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
+                                specialStatisticsVO.setSum(count);
+                                specialStatisticsVOList.add(specialStatisticsVO);
+                            }
+                        }
+                    }
+                }
+            });
+        }
+        // 计算特殊人群总数
+        specialStatisticsVOList.add(otherSpecialVO);
+        Integer specialNum = 0;
+        if (!specialStatisticsVOList.isEmpty()) {
+            for (IndexSpecialStatisticsVO special : specialStatisticsVOList) {
+                specialNum += special.getSum();
+            }
+        }
+        civilStatisticsVO.setSpecialNum(specialNum);
+        civilStatisticsVO.setSpecialStatisticsList(specialStatisticsVOList);
 
         // 计算环比上月增长率
         BigDecimal rate = BigDecimal.ZERO;
@@ -7127,27 +7127,27 @@
 
         // 查询小区列表
         List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(communityId);
-        villageStatisticsList.forEach(civilVillageStatisticsVO -> {
-            civilVillageStatisticsVO.setUserSum(comMngPopulationDAO.selectCount(new QueryWrapper<ComMngPopulationDO>().lambda().eq(ComMngPopulationDO::getVillageId,civilVillageStatisticsVO.getVillageId())));
-            List<IndexSpecialStatisticsVO> specialStatisticsVOS = new ArrayList<>();
-            IndexSpecialStatisticsVO otherSpecial = new IndexSpecialStatisticsVO();
-            otherSpecial.setTitle("其他");
-            otherSpecial.setSum(0);
-            // 查询特殊人群标签列表
-            List<ComMngUserTagVO> userTagVOS = comMngPopulationDAO.getUserTagListByCommunityId(communityId);
-
-            userTagVOS.forEach(comMngUserTagVO -> {
-              Integer count=comMngPopulationDAO.selectCountByVillageId(civilVillageStatisticsVO.getVillageId(),comMngUserTagVO.getTagName());
-              IndexSpecialStatisticsVO indexSpecialStatisticsVO=new IndexSpecialStatisticsVO();
-              indexSpecialStatisticsVO.setTitle(comMngUserTagVO.getTagName());
-              indexSpecialStatisticsVO.setSum(count);
-              otherSpecial.setSum(otherSpecial.getSum()+count);
-              specialStatisticsVOS.add(indexSpecialStatisticsVO);
-            });
-            otherSpecial.setSum(civilVillageStatisticsVO.getUserSum()-otherSpecial.getSum());
-            specialStatisticsVOS.add(otherSpecial);
-            civilVillageStatisticsVO.setSpecialStatisticsList(specialStatisticsVOS);
-        });
+//        villageStatisticsList.forEach(civilVillageStatisticsVO -> {
+//            civilVillageStatisticsVO.setUserSum(comMngPopulationDAO.selectCount(new QueryWrapper<ComMngPopulationDO>().lambda().eq(ComMngPopulationDO::getVillageId,civilVillageStatisticsVO.getVillageId())));
+//            List<IndexSpecialStatisticsVO> specialStatisticsVOS = new ArrayList<>();
+//            IndexSpecialStatisticsVO otherSpecial = new IndexSpecialStatisticsVO();
+//            otherSpecial.setTitle("其他");
+//            otherSpecial.setSum(0);
+//            // 查询特殊人群标签列表
+//            List<ComMngUserTagVO> userTagVOS = comMngPopulationDAO.getUserTagListByCommunityId(communityId);
+//
+//            userTagVOS.forEach(comMngUserTagVO -> {
+//              Integer count=comMngPopulationDAO.selectCountByVillageId(civilVillageStatisticsVO.getVillageId(),comMngUserTagVO.getTagName());
+//              IndexSpecialStatisticsVO indexSpecialStatisticsVO=new IndexSpecialStatisticsVO();
+//              indexSpecialStatisticsVO.setTitle(comMngUserTagVO.getTagName());
+//              indexSpecialStatisticsVO.setSum(count);
+//              otherSpecial.setSum(otherSpecial.getSum()+count);
+//              specialStatisticsVOS.add(indexSpecialStatisticsVO);
+//            });
+//            otherSpecial.setSum(civilVillageStatisticsVO.getUserSum()-otherSpecial.getSum());
+//            specialStatisticsVOS.add(otherSpecial);
+//            civilVillageStatisticsVO.setSpecialStatisticsList(specialStatisticsVOS);
+//        });
         civilStatisticsVO.setVillageStatisticsList(villageStatisticsList);
 
         return R.ok(civilStatisticsVO);

--
Gitblit v1.7.1