From 482685cef1fdacac3635c6d4d7b063a588b9dc96 Mon Sep 17 00:00:00 2001
From: tangxiaobao <303826152@qq.com>
Date: 星期五, 20 八月 2021 14:15:04 +0800
Subject: [PATCH] 实有人口和社区关系以及对应标签修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 1150 ++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 920 insertions(+), 230 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 18e3882..a43646f 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
@@ -797,6 +797,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationDrugMistakeExcelVO> mistakes = new ArrayList<>();
@@ -849,6 +853,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -939,11 +950,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateDrugPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateDrugPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveDrugPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveDrugPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -965,6 +976,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationDrugMistakeExcelVO mistake = new ComMngPopulationDrugMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setDrugMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -993,6 +1050,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -1013,6 +1080,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationCorrectMistakeExcelVO> mistakes = new ArrayList<>();
@@ -1065,6 +1136,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -1155,11 +1233,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateCorrectPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateCorrectPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveCorrectPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveCorrectPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -1181,6 +1259,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationCorrectMistakeExcelVO mistake = new ComMngPopulationCorrectMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setCorrectMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -1209,6 +1333,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -1229,6 +1363,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationMajorMistakeExcelVO> mistakes = new ArrayList<>();
@@ -1281,6 +1419,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -1371,11 +1516,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateMajorPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateMajorPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveMajorPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveMajorPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -1397,6 +1542,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationMajorMistakeExcelVO mistake = new ComMngPopulationMajorMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setMajorMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -1425,6 +1616,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -1445,6 +1646,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationCultMistakeExcelVO> mistakes = new ArrayList<>();
@@ -1497,6 +1702,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -1587,11 +1799,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateCultPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateCultPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveCultPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveCultPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -1613,6 +1825,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationCultMistakeExcelVO mistake = new ComMngPopulationCultMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setCultMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -1641,6 +1899,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -1661,6 +1929,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationRehabilitationMistakeExcelVO> mistakes = new ArrayList<>();
@@ -1713,6 +1985,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -1803,11 +2082,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateRehabilitationPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateRehabilitationPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveRehabilitationPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveRehabilitationPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -1829,6 +2108,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationRehabilitationMistakeExcelVO mistake = new ComMngPopulationRehabilitationMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setRehabilitationMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -1857,6 +2182,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -1877,6 +2212,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationKeyMistakeExcelVO> mistakes = new ArrayList<>();
@@ -1929,6 +2268,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -2019,11 +2365,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateKeyPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateKeyPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveKeyPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveKeyPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -2045,6 +2391,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationKeyMistakeExcelVO mistake = new ComMngPopulationKeyMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setKeyMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -2073,6 +2465,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -2093,6 +2495,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationSentenceMistakeExcelVO> mistakes = new ArrayList<>();
@@ -2145,6 +2551,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -2235,11 +2648,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateSentencePopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateSentencePopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveSentencePopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveSentencePopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -2261,6 +2674,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationSentenceMistakeExcelVO mistake = new ComMngPopulationSentenceMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setSentenceMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -2289,6 +2748,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -2309,6 +2778,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationVeteransMistakeExcelVO> mistakes = new ArrayList<>();
@@ -2361,6 +2834,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -2451,11 +2931,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateVeteransPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateVeteransPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveVeteransPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveVeteransPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -2477,6 +2957,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setVeteransMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -2505,6 +3031,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -2525,6 +3061,10 @@
         List<ComMngPopulationDO> updateList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationDisabilityMistakeExcelVO> mistakes = new ArrayList<>();
@@ -2577,6 +3117,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -2667,11 +3214,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateDisabilityPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateDisabilityPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveDisabilityPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveDisabilityPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -2693,6 +3240,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationDisabilityMistakeExcelVO mistake = new ComMngPopulationDisabilityMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setDisabilityMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -2721,6 +3314,16 @@
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
         }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
+        }
         log.info("执行数据库导入完成");
 
         if (!mistakes.isEmpty()) {
@@ -2745,6 +3348,10 @@
         List<ComDrugPopulationDO> updateDrugList = new ArrayList<>();
         //需要新增的人口与房屋关系集合
         List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
+        //需要新增的人口与社区关系集合
+        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
 
         log.info("开始处理导入数据");
         List<ComMngPopulationLowSecurityMistakeExcelVO> mistakes = new ArrayList<>();
@@ -2797,6 +3404,13 @@
             houseUserLists.forEach(houseUser -> {
                 String key = houseUser.getPopulId() + houseUser.getHouseId() + "";
                 houseUserMap.put(key,houseUser);
+            });
+
+            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
+            HashMap<String,Object> populationCommunityMap = new HashMap<>();
+            populationCommunityLists.forEach(populationCommunity -> {
+                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
+                populationCommunityMap.put(key,populationCommunity);
             });
 
 
@@ -2887,11 +3501,11 @@
                 if(!isOnly(populationKey,populationMap)){
                     //存在实有人口信息,则更新
                     populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
-                    ComMngPopulationDO updatePopulationDO = updateLowSecurityPopulationDO(vo,populationDO,labelList);
+                    ComMngPopulationDO updatePopulationDO = updateLowSecurityPopulationDO(vo,populationDO,userId);
                     updateList.add(updatePopulationDO);
                 }else{
                     //不存在实有人口,则新增
-                    populationDO = saveLowSecurityPopulationDO(vo, populationActVO, comMngVillageDO,labelList);
+                    populationDO = saveLowSecurityPopulationDO(vo, populationActVO, comMngVillageDO,userId);
                     saveList.add(populationDO);
                 }
                 log.info("开始查询实有人口是否已存在完成");
@@ -2913,6 +3527,52 @@
                     }
                 }
                 log.info("开始查询实有人口房屋居住信息完成");
+
+                log.info("开始查询实有人口存在社区信息");
+                //处理实有人口与社区关系以及对应特殊群体标签
+                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
+                if (populationDO != null) {
+                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
+                    if(isOnly(populationCommunityKey,populationCommunityMap)){
+                        //实有人口不存在于当前社区
+                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
+                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
+                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
+                        cpopulationCommunityTagsDO.setCommunityId(communityId);
+                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                        Iterator<String> iterator = userTag.iterator();
+                        while (iterator.hasNext()) {
+                            String s = iterator.next();
+                            if (!labelList.contains(s))
+                                iterator.remove();
+                        }
+                        populationDO.setLabel(Joiner.on(",").join(userTag));
+                        populationDO.setCreateBy(userId);
+                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
+                    }
+                }else {
+                    //实有人口存在于当前社区,则更新
+                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
+                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+                    Iterator<String> iterator = userTag.iterator();
+                    while (iterator.hasNext()) {
+                        String s = iterator.next();
+                        if (!labelList.contains(s))
+                            iterator.remove();
+                    }
+                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
+                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
+                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
+
+                    ComMngPopulationLowSecurityMistakeExcelVO mistake = new ComMngPopulationLowSecurityMistakeExcelVO();
+                    BeanUtils.copyProperties(vo,mistake);
+                    setLowSecurityMistake(mistake, vo);
+                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
+                    mistakes.add(mistake);
+                }
+                log.info("查询实有人口存在社区信息完成");
             }
         }catch (Exception e){
             log.info("出现错误,错误原因:" + e.getMessage());
@@ -2940,6 +3600,16 @@
             log.info("执行数据库导入人口房屋关系");
             comMngPopulationHouseUserService.saveBatch(houseUserList);
             log.info("执行数据库导入人口房屋关系完成");
+        }
+        if(!savePopulationCommunityList.isEmpty()){
+            log.info("执行数据库导入人口社区关系");
+            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
+            log.info("数据库导入人口社区关系完成");
+        }
+        if(!updatePopulationCommunityList.isEmpty()){
+            log.info("执行数据库更新人口社区关系");
+            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
+            log.info("数据库更新人口社区关系完成");
         }
         log.info("执行数据库导入完成");
 
@@ -2973,26 +3643,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateDrugPopulationDO(ComMngPopulationDrugExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateDrugPopulationDO(ComMngPopulationDrugExcelVO vo, ComMngPopulationDO populationDO, Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComDrugPopulationDO comDrugPopulationDO = comDrugPopulationDAO.selectOne(new QueryWrapper<ComDrugPopulationDO>().lambda()
                 .eq(ComDrugPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
 
         if (comDrugPopulationDO != null) {
             BeanUtils.copyProperties(vo, comDrugPopulationDO);
@@ -3010,26 +3681,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateCorrectPopulationDO(ComMngPopulationCorrectExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateCorrectPopulationDO(ComMngPopulationCorrectExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComCorrectPopulationDO comCorrectPopulationDO = comCorrectPopulationDAO.selectOne(new QueryWrapper<ComCorrectPopulationDO>().lambda()
                 .eq(ComCorrectPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comCorrectPopulationDO != null) {
             BeanUtils.copyProperties(vo, comCorrectPopulationDO);
             comCorrectPopulationDO.setCardNo(cardNoAES);
@@ -3046,26 +3718,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateMajorPopulationDO(ComMngPopulationMajorExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateMajorPopulationDO(ComMngPopulationMajorExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComMajorPopulationDO comMajorPopulationDO = comMajorPopulationDAO.selectOne(new QueryWrapper<ComMajorPopulationDO>().lambda()
                 .eq(ComMajorPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comMajorPopulationDO != null) {
             BeanUtils.copyProperties(vo, comMajorPopulationDO);
             comMajorPopulationDO.setCardNo(cardNoAES);
@@ -3082,26 +3755,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateCultPopulationDO(ComMngPopulationCultExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateCultPopulationDO(ComMngPopulationCultExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComCultPopulationDO comCultPopulationDO = comCultPopulationDAO.selectOne(new QueryWrapper<ComCultPopulationDO>().lambda().
                 eq(ComCultPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comCultPopulationDO != null) {
             BeanUtils.copyProperties(vo, comCultPopulationDO);
             comCultPopulationDO.setCardNo(cardNoAES);
@@ -3118,26 +3792,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateRehabilitationPopulationDO(ComMngPopulationRehabilitationExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateRehabilitationPopulationDO(ComMngPopulationRehabilitationExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComRehabilitationPopulationDO comRehabilitationPopulationDO = comRehabilitationPopulationDAO.selectOne(new QueryWrapper<ComRehabilitationPopulationDO>().lambda().
                 eq(ComRehabilitationPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comRehabilitationPopulationDO != null) {
             BeanUtils.copyProperties(vo, comRehabilitationPopulationDO);
             comRehabilitationPopulationDO.setCardNo(cardNoAES);
@@ -3155,26 +3830,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateKeyPopulationDO(ComMngPopulationKeyExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateKeyPopulationDO(ComMngPopulationKeyExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComKeyPopulationDO comKeyPopulationDO = comKeyPopulationDAO.selectOne(new QueryWrapper<ComKeyPopulationDO>().lambda().
                 eq(ComKeyPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comKeyPopulationDO != null) {
             BeanUtils.copyProperties(vo, comKeyPopulationDO);
             comKeyPopulationDO.setCardNo(cardNoAES);
@@ -3191,26 +3867,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateSentencePopulationDO(ComMngPopulationSentenceExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateSentencePopulationDO(ComMngPopulationSentenceExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComSentencePopulationDO comSentencePopulationDO = comSentencePopulationDAO.selectOne(new QueryWrapper<ComSentencePopulationDO>().lambda().
                 eq(ComSentencePopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comSentencePopulationDO != null) {
             BeanUtils.copyProperties(vo, comSentencePopulationDO);
             comSentencePopulationDO.setCardNo(cardNoAES);
@@ -3227,26 +3904,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateVeteransPopulationDO(ComMngPopulationVeteransExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateVeteransPopulationDO(ComMngPopulationVeteransExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComVeteransPopulationDO comVeteransPopulationDO = comVeteransPopulationDAO.selectOne(new QueryWrapper<ComVeteransPopulationDO>().lambda().
                 eq(ComVeteransPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comVeteransPopulationDO != null) {
             BeanUtils.copyProperties(vo, comVeteransPopulationDO);
             comVeteransPopulationDO.setCardNo(cardNoAES);
@@ -3262,26 +3940,27 @@
         }
         return populationDO;
     }
-    private ComMngPopulationDO updateDisabilityPopulationDO(ComMngPopulationDisabilityExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateDisabilityPopulationDO(ComMngPopulationDisabilityExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComDisabilityPopulationDO comDisabilityPopulationDO = comDisabilityPopulationDAO.selectOne(new QueryWrapper<ComDisabilityPopulationDO>().lambda().
                 eq(ComDisabilityPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comDisabilityPopulationDO != null) {
             BeanUtils.copyProperties(vo, comDisabilityPopulationDO);
             comDisabilityPopulationDO.setCardNo(cardNoAES);
@@ -3298,26 +3977,27 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO updateLowSecurityPopulationDO(ComMngPopulationLowSecurityExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
+    private ComMngPopulationDO updateLowSecurityPopulationDO(ComMngPopulationLowSecurityExcelVO vo, ComMngPopulationDO populationDO,Long userId){
         BeanUtils.copyProperties(vo, populationDO);
         ComLowSecurityPopulationDO comLowSecurityPopulationDO = comLowSecurityPopulationDAO.selectOne(new QueryWrapper<ComLowSecurityPopulationDO>().lambda().
                 eq(ComLowSecurityPopulationDO::getPopulationId, populationDO.getId()));
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         String cardNoAES = populationDO.getCardNo();
         try {
             cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
         }catch (Exception e){
             log.error("身份证加密失败");
         }
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setCardNo(cardNoAES);
+        populationDO.setUpdateBy(userId);
         if (comLowSecurityPopulationDO != null) {
             BeanUtils.copyProperties(vo, comLowSecurityPopulationDO);
             comLowSecurityPopulationDO.setCardNo(cardNoAES);
@@ -3375,7 +4055,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveDrugPopulationDO(ComMngPopulationDrugExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveDrugPopulationDO(ComMngPopulationDrugExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComDrugPopulationDO comDrugPopulationDO = new ComDrugPopulationDO();
@@ -3383,19 +4063,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comDrugPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3407,6 +4087,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3423,7 +4104,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveCorrectPopulationDO(ComMngPopulationCorrectExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveCorrectPopulationDO(ComMngPopulationCorrectExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComCorrectPopulationDO comCorrectPopulationDO = new ComCorrectPopulationDO();
@@ -3431,19 +4112,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comCorrectPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3455,6 +4136,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3471,7 +4153,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveMajorPopulationDO(ComMngPopulationMajorExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveMajorPopulationDO(ComMngPopulationMajorExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComMajorPopulationDO comMajorPopulationDO = new ComMajorPopulationDO();
@@ -3479,19 +4161,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comMajorPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3503,6 +4185,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3519,7 +4202,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveCultPopulationDO(ComMngPopulationCultExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveCultPopulationDO(ComMngPopulationCultExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComCultPopulationDO comCultPopulationDO = new ComCultPopulationDO();
@@ -3527,19 +4210,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comCultPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3551,6 +4234,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3567,7 +4251,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveRehabilitationPopulationDO(ComMngPopulationRehabilitationExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveRehabilitationPopulationDO(ComMngPopulationRehabilitationExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComRehabilitationPopulationDO comRehabilitationPopulationDO = new ComRehabilitationPopulationDO();
@@ -3575,19 +4259,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comRehabilitationPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3599,6 +4283,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3615,7 +4300,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveKeyPopulationDO(ComMngPopulationKeyExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveKeyPopulationDO(ComMngPopulationKeyExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComKeyPopulationDO comKeyPopulationDO = new ComKeyPopulationDO();
@@ -3623,19 +4308,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comKeyPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3647,6 +4332,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3663,7 +4349,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveSentencePopulationDO(ComMngPopulationSentenceExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveSentencePopulationDO(ComMngPopulationSentenceExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComSentencePopulationDO comSentencePopulationDO = new ComSentencePopulationDO();
@@ -3671,19 +4357,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comSentencePopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3695,6 +4381,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3711,7 +4398,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveVeteransPopulationDO(ComMngPopulationVeteransExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveVeteransPopulationDO(ComMngPopulationVeteransExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComVeteransPopulationDO comVeteransPopulationDO = new ComVeteransPopulationDO();
@@ -3719,19 +4406,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comVeteransPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3743,6 +4430,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3759,7 +4447,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveDisabilityPopulationDO(ComMngPopulationDisabilityExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveDisabilityPopulationDO(ComMngPopulationDisabilityExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
         ComDisabilityPopulationDO comDisabilityPopulationDO = new ComDisabilityPopulationDO();
@@ -3767,19 +4455,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comDisabilityPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3791,6 +4479,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
@@ -3807,7 +4496,7 @@
         return populationDO;
     }
 
-    private ComMngPopulationDO saveLowSecurityPopulationDO(ComMngPopulationLowSecurityExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
+    private ComMngPopulationDO saveLowSecurityPopulationDO(ComMngPopulationLowSecurityExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,Long userId) {
         ComMngPopulationDO populationDO = new ComMngPopulationDO();
         ComLowSecurityPopulationDO comLowSecurityPopulationDO = new ComLowSecurityPopulationDO();
         BeanUtils.copyProperties(vo, populationDO);
@@ -3815,19 +4504,19 @@
         Long populationId = Snowflake.getId();
         populationDO.setId(populationId);
         comLowSecurityPopulationDO.setPopulationId(populationId);
-        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
-
-        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
-        Iterator<String> iterator = userTag.iterator();
-        while (iterator.hasNext()) {
-            String s = iterator.next();
-            if (!labelList.contains(s))
-                iterator.remove();
-        }
+//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
+//
+//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
+//        Iterator<String> iterator = userTag.iterator();
+//        while (iterator.hasNext()) {
+//            String s = iterator.next();
+//            if (!labelList.contains(s))
+//                iterator.remove();
+//        }
         populationDO.setVillageId(comMngVillageDO.getVillageId());
         populationDO.setActId(comActDO.getCommunityId());
         populationDO.setStreetId(comActDO.getStreetId());
-        populationDO.setLabel(Joiner.on(",").join(userTag));
+//        populationDO.setLabel(Joiner.on(",").join(userTag));
         populationDO.setVillageName(comMngVillageDO.getGroupAt());
         populationDO.setCardNoStr(vo.getCardNo());
         populationDO.setUpdateAt(new Date());
@@ -3839,6 +4528,7 @@
             log.error("身份证加密失败");
         }
         populationDO.setCardNo(cardNoAES);
+        populationDO.setCreateBy(userId);
         //新增的时候默认绑定房屋id
 //        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
 //                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {

--
Gitblit v1.7.1