From 9576bebcacea938771f6f5b51d958e6a4ac59df6 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 09 十二月 2021 16:59:05 +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 |  107 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 73 insertions(+), 34 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 27e3c7d..5c97c19 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,8 @@
 
 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;
 import org.springframework.context.annotation.Bean;
@@ -40,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.*;
@@ -54,10 +53,6 @@
 import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO;
 import com.panzhihua.common.model.vos.screen.ComMngPopulationAgeVO;
 import com.panzhihua.common.model.vos.user.*;
-import com.panzhihua.common.utlis.AgeUtils;
-import com.panzhihua.common.utlis.DateUtils;
-import com.panzhihua.common.utlis.Snowflake;
-import com.panzhihua.common.utlis.StringUtils;
 import com.panzhihua.service_community.dao.*;
 import com.panzhihua.service_community.model.dos.*;
 import com.panzhihua.service_community.service.*;
@@ -4999,6 +4994,7 @@
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
+        populationDO.setDeath(vo.getDeath().toString());
 
         String cardNoAES = populationDO.getCardNo();
         try {
@@ -6313,23 +6309,14 @@
     /**
      * 批量删除实有人口
      *
-     * @param Ids
-     * @return
+     * @param ids 实有人口id集合
+     * @return  删除结果
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public R deletePopulations(List<Long> Ids) {
-        if (!Ids.isEmpty()) {
-            Ids.forEach(id -> {
-                // 清除用户房屋居住信息
-                comMngPopulationHouseUserDAO.deletePopulationHouseByUserId(id);
-            });
-        }
-        int delete = populationDAO.deleteBatchIds(Ids);
-        if (delete > 0) {
-            return R.ok();
-        }
-        return R.fail();
+    public R deletePopulations(List<Long> ids, Long communityId) {
+        comMngPopulationCommunityTagsDAO.deletePopulationRelation(ids,communityId);
+        return R.ok();
     }
 
     /**
@@ -6584,17 +6571,19 @@
     public R specialInputUser(PageInputUserDTO pageInputUserDTO) {
         IPage<InputUserInfoVO> iPage = populationDAO.specialInputUser(
             new Page<>(pageInputUserDTO.getPageNum(), pageInputUserDTO.getPageSize()), pageInputUserDTO);
-
-        iPage.getRecords().forEach(page -> {
-            if(page.getAreaName() == null || StringUtils.isEmpty(page.getAreaName())){
-                StringBuilder sb = new StringBuilder();
-                sb.append(page.getAlley());
-                if(!page.getHouseNum().contains("号")){
-                    sb.append(page.getHouseNum() + "号");
+        if(iPage!=null){
+            iPage.getRecords().forEach(page -> {
+                if(page.getAreaName() == null || StringUtils.isEmpty(page.getAreaName())){
+                    StringBuilder sb = new StringBuilder();
+                    sb.append(page.getAlley());
+                    if(!page.getHouseNum().contains("号")){
+                        sb.append(page.getHouseNum() + "号");
+                    }
+                    page.setAreaName(sb.toString());
                 }
-                page.setAreaName(sb.toString());
-            }
-        });
+            });
+        }
+
         return R.ok(iPage);
     }
 
@@ -7052,7 +7041,7 @@
         // 查询特殊人群统计
         List<IndexSpecialStatisticsVO> specialStatisticsVOList = new ArrayList<>();
 
-        // 查询特殊人群标签列表
+        //查询特殊人群标签列表
         List<ComMngUserTagVO> userTagList = comMngPopulationDAO.getUserTagListByCommunityId(communityId);
         IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO();
         otherSpecialVO.setTitle("其他");
@@ -7136,7 +7125,45 @@
 
         // 查询小区列表
         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);
+        }
+        //查询便民服务数据
 
         return R.ok(civilStatisticsVO);
     }
@@ -7352,8 +7379,11 @@
                 statisticsVO.setDangerLevel("0");
                 statisticsVO.setMajor(false);
                 statisticsVO.setUrgent(false);
-                if (statisticsVO.getEventDealStatus().equals(2)) {
-                    statisticsVO.setEventDealStatus(4);
+                if (statisticsVO.getEventDealStatus().equals(2)||statisticsVO.getEventDealStatus().equals(1)) {
+                    statisticsVO.setEventDealStatus(1);
+                }
+                else {
+                    statisticsVO.setEventDealStatus(2);
                 }
                 List<EventResourceVO> picList = new ArrayList<>();
                 String[] pics = statisticsVO.getPhotoPathList().split(",");
@@ -7473,6 +7503,10 @@
             if (StringUtils.isNotEmpty(detail.getMarriage())) {
                 detail.setMarriage(PopulMarriageEnum.getCnDescByName(Integer.parseInt(detail.getMarriage())));
             }
+            //查询该人口的标签
+            List<ComMngPopulationCommunityTagsVo> communityTagsList = this.baseMapper.getCommunityTagList(populationId);
+            String label = LabelUtils.assembleLabel(communityTagsList);
+            detail.setLabel(label);
         }
         return R.ok(detail);
     }
@@ -7696,6 +7730,11 @@
             new Page(villagePopulationDTO.getPageNum(), villagePopulationDTO.getPageSize()), villagePopulationDTO));
     }
 
+    @Override
+    public R specialInputUserExport(PageInputUserDTO pageInputUserDTO) {
+        return R.ok(this.comMngPopulationDAO.specialInputUserExport(pageInputUserDTO));
+    }
+
     private void setMistake(ComMngPopulationMistakeExcelVO mvo, ComMngPopulationServeExcelVO vo) {
         mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook()));
         mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent()));

--
Gitblit v1.7.1