From d7ea73196c8eb7df71c20b4fdccbc1ef9eff96fe Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期二, 14 十二月 2021 16:14:06 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 221 ++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 137 insertions(+), 84 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..a6857bf 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 @@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments; +import com.panzhihua.common.model.vos.community.screen.civil.*; import com.panzhihua.common.utlis.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; @@ -41,9 +42,6 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.*; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild; -import com.panzhihua.common.model.vos.community.screen.civil.CivilPopulationStatisticsVO; -import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; -import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO; import com.panzhihua.common.model.vos.community.screen.event.*; import com.panzhihua.common.model.vos.community.screen.event.EventTransferRecordVO; import com.panzhihua.common.model.vos.community.screen.index.*; @@ -7043,66 +7041,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,29 +7125,49 @@ // 查询小区列表 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); + //查询党建引领数据 + CivilPartyStatisticsVO civilParty = this.baseMapper.getCivilParty(communityId); + if(civilParty != null){ + civilStatisticsVO.setCivilPartyStatisticsVO(civilParty); + } + //查询社区治理数据 + CivilGovernmentStatisticsVO civilGovernment = this.baseMapper.getCivilGovernment(communityId); + if(civilGovernment != null){ + civilStatisticsVO.setCivilGovernmentStatisticsVO(civilGovernment); + } + //查询网格管理数据 + CivilGridStatisticsVO civilGrid = this.baseMapper.getCivilGrid(communityId); + if(civilGrid != null){ + civilStatisticsVO.setCivilGridStatisticsVO(civilGrid); + } + //查询便民服务数据 + CivilConvenienceStatisticsVO civilConvenience = this.baseMapper.getCivilConvenience(communityId); + if(civilConvenience != null){ + civilStatisticsVO.setCivilConvenienceStatisticsVO(civilConvenience); + } return R.ok(civilStatisticsVO); } @@ -7720,6 +7738,41 @@ return R.ok(this.comMngPopulationDAO.specialInputUserExport(pageInputUserDTO)); } + @Override + public R westScreenStatics() { + return R.ok(this.comMngPopulationDAO.westScreenStatics()); + } + + @Override + public R getComprehensivePopulationStatics(Long streetId){ + EventPopulationStatisticsVO statisticsVo = new EventPopulationStatisticsVO(); + //查询人口数据 + List<EventPopulationBasicsStatisticsVO> basicsList = comMngPopulationDAO.getBasicsList(streetId); + if(basicsList != null){ + for (EventPopulationBasicsStatisticsVO basics : basicsList) { + statisticsVo.setPopulationNum(statisticsVo.getPopulationNum() + basics.getPopulationNum()); + statisticsVo.setVillageNum(statisticsVo.getVillageNum() + basics.getVillageNum()); + statisticsVo.setHouseNum(statisticsVo.getHouseNum() + basics.getHouseNum()); + } + statisticsVo.setBasicsList(basicsList); + } + //查询特殊人群数据 + EventPopulationSpecialStatisticsVO populationSpecial = comMngPopulationDAO.getPopulationSpecial(streetId); + if(populationSpecial != null){ + populationSpecial.setOtherTotal(populationSpecial.getZjTotal() + populationSpecial.getSfTotal() + + populationSpecial.getXsTotal() + populationSpecial.getXjTotal() + + populationSpecial.getJzTotal() + populationSpecial.getXdTotal()); + populationSpecial.setLnTotal(comMngPopulationDAO.getPopulationAge(streetId)); + statisticsVo.setSpecialStatisticsVo(populationSpecial); + } + return R.ok(statisticsVo); + } + + @Override + public R getComprehensiveStreetList(){ + return R.ok(comMngPopulationDAO.getComprehensiveStreetList()); + } + private void setMistake(ComMngPopulationMistakeExcelVO mvo, ComMngPopulationServeExcelVO vo) { mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); -- Gitblit v1.7.1