From 6496d6a229ba8e0acd0777863fb34bee0f5ce717 Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期五, 24 十二月 2021 10:42:38 +0800 Subject: [PATCH] Merge branch 'master' into test --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 128 +++++++++++++++++++++++++++++++++++------- 1 files changed, 105 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 492b6cc..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 @@ -9,8 +9,11 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments; +import com.panzhihua.common.model.vos.community.bigscreen.WestScreenStatics; +import com.panzhihua.common.model.vos.community.screen.civil.*; import com.panzhihua.common.model.vos.community.bigscreen.*; import com.panzhihua.common.utlis.*; +import com.panzhihua.service_community.util.WxDataUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -41,6 +44,7 @@ import com.panzhihua.common.model.helper.AESUtil; 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; @@ -7057,7 +7061,7 @@ // 查询特殊人群统计 List<IndexSpecialStatisticsVO> specialStatisticsVOList = new ArrayList<>(); - // 查询特殊人群标签列表 + //查询特殊人群标签列表 List<ComMngUserTagVO> userTagList = comMngPopulationDAO.getUserTagListByCommunityId(communityId); IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO(); otherSpecialVO.setTitle("其他"); @@ -7141,8 +7145,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); +// }); 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); } @@ -7715,6 +7760,46 @@ } @Override + public R westScreenStatics() { + WestScreenStatics westScreenStatics=this.comMngPopulationDAO.westScreenStatics(); + WxDataUtil wxDataUtil=new WxDataUtil(); + westScreenStatics.setDayUser(wxDataUtil.getDayUser()); + westScreenStatics.setCountUser(wxDataUtil.getMonthUser()); + return R.ok(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,60)); + populationSpecial.setGlTotal(comMngPopulationDAO.getPopulationAge(streetId,80)); + statisticsVo.setSpecialStatisticsVo(populationSpecial); + } + return R.ok(statisticsVo); + } + + @Override + public R getComprehensiveStreetList(){ + return R.ok(comMngPopulationDAO.getComprehensiveStreetList()); + } + + @Override public R indexInfo(Long communityId) { IndexInfo indexInfo=new IndexInfo(); //基础数据 @@ -7748,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); } } @@ -7825,13 +7892,28 @@ IndexBackReserve indexBackReserve=new IndexBackReserve(); indexBackReserve.setCount(comActReserveMapper.indexBackReserve(communityId)); indexBackReserve.setIndexReserveSubList(comActReserveMapper.indexBackReserveSub(communityId)); + indexBackReserve.getIndexReserveSubList().forEach(indexReserveSub -> { + 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 -> { + if(indexReserveSub.getAllCount()!=0){ + indexReserveSub.setPercent(indexReserveSub.getNum()*100/indexReserveSub.getAllCount()); + } + else { + indexReserveSub.setPercent(0); + } + }); indexReserve.setIndexBackReserve(indexBackReserve); indexReserve.setIndexHomeQuarantine(indexHomeQuarantine); indexInfo.setIndexReserve(indexReserve); - BigscreenGridsGovernanceStatisticsVO bigscreenGridsGovernanceStatisticsVO=comActEasyPhotoDAO.selectBigscreenGridsGovern(communityId); indexInfo.setBigScreenGridStaticsReturn(setData(bigscreenGridsGovernanceStatisticsVO)); -- Gitblit v1.7.1