101captain
2021-12-07 05a88f0a2ed6a2e107a744a58673decde79f91d1
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.bigscreen.*;
import com.panzhihua.common.utlis.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
@@ -40,7 +41,6 @@
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;
@@ -7699,6 +7699,109 @@
        return R.ok(this.comMngPopulationDAO.specialInputUserExport(pageInputUserDTO));
    }
    @Override
    public R indexInfo(Long communityId) {
        IndexInfo indexInfo=new IndexInfo();
        //基础数据
        BaseInfo baseInfo=this.comMngPopulationDAO.baseInfo(communityId);
        indexInfo.setBaseInfo(baseInfo);
        // 查询实有人口统计模块
        IndexPopulationStatisticsVO populationStatisticsVO = new IndexPopulationStatisticsVO();
        // 查询实有人口性别统计
        List<IndexPopulationSexStatisticsVO> sexPopulationList =
                comMngPopulationDAO.getScreenIndexByPopulationSex(communityId);
        populationStatisticsVO.setSexPopulationList(sexPopulationList);
        // 查询实有人口年龄统计
        List<IndexPopulationAgeStatisticsVO> agePopulationList = statisticsAge(communityId);
        populationStatisticsVO.setAgePopulationList(agePopulationList);
        indexInfo.setIndexPopulationStatisticsVO(populationStatisticsVO);
        // 查询特殊人群统计
        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);
        indexInfo.setSpecialStatisticsVOList(specialStatisticsVOList);
        // 查询网格化治理
        IndexEventGridStatisticsVO eventGridStatisticsVO = new IndexEventGridStatisticsVO();
        List<IndexGridStatisticsVO> gridStatisticsList = new ArrayList<>();
        // 查询网格化事件数据
        IndexGridEventStatisticsVO gridEventStatistics = comMngPopulationDAO.getGridEventStatisticsList(communityId);
        eventGridStatisticsVO.setGridEventStatisticsList(gridEventStatistics);
        // 查询网格数据
        List<EventGridDataVO> gridDataList = comMngPopulationDAO.getGridDataListByCommunityId(communityId);
        if (!gridDataList.isEmpty()) {
            gridDataList.forEach(gridData -> {
                if (gridData != null) {
                    IndexGridStatisticsVO gridStatisticsVO = new IndexGridStatisticsVO();
                    gridStatisticsVO.setEventData(gridData.getGridName());
                    // 根据网格id查询网格事件列表
                    IndexGridEventStatisticsVO gridEventList =
                            comMngPopulationDAO.getGridEventByGirdId(gridData.getId());
                    gridStatisticsVO.setGridEventStatisticsList(gridEventList);
                    gridStatisticsList.add(gridStatisticsVO);
                }
            });
        }
        eventGridStatisticsVO.setGridStatisticsList(gridStatisticsList);
        indexInfo.setEventGridStatisticsVO(eventGridStatisticsVO);
        //首页业务统计
        IndexDynamic indexDynamic=this.populationDAO.indexDynamic(communityId);
        indexInfo.setIndexDynamic(indexDynamic);
        //返攀登记居家隔离数据统计
        IndexReserve indexReserve=new IndexReserve();
        return null;
    }
    private void setMistake(ComMngPopulationMistakeExcelVO mvo, ComMngPopulationServeExcelVO vo) {
        mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook()));
        mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent()));