From 376e1f1c688c71a31ee321805e443af8e92c8d5e Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期三, 31 三月 2021 17:35:11 +0800
Subject: [PATCH] 优化导入导出接口,新增实有人口导出接口

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java |   70 +++++++++++++++++++----------------
 1 files changed, 38 insertions(+), 32 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 326f178..0b07a35 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
@@ -250,38 +250,6 @@
             if (comMngVillageDO == null) {
                 throw new ServiceException("街道巷:" + vo.getRoad() + "不存在!");
             }
-            //性别判断
-            if(!StringUtils.isEmpty(vo.getSex())){
-                if(vo.getSex().equals(ComMngPopulationServeExcelVO.sex.nan)){
-                    comMngPopulationDO.setSex(ComMngPopulationDO.sex.nan);
-                }else if(vo.getSex().equals(ComMngPopulationServeExcelVO.sex.nv)){
-                    comMngPopulationDO.setSex(ComMngPopulationDO.sex.nv);
-                }else{
-                    comMngPopulationDO.setSex(ComMngPopulationDO.sex.no);
-                }
-            }
-            //是否租住判断
-            if(!StringUtils.isEmpty(vo.getIsRent())){
-                if(vo.getIsRent().equals(ComMngPopulationServeExcelVO.isOk.no)){
-                    comMngPopulationDO.setIsRent(ComMngPopulationDO.isOk.no);
-                }else{
-                    comMngPopulationDO.setIsRent(ComMngPopulationDO.isOk.yes);
-                }
-            }
-            //政治面貌判断
-            if(!StringUtils.isEmpty(vo.getPoliticalOutlook())){
-                if(vo.getPoliticalOutlook().equals(ComMngPopulationServeExcelVO.politicalOutlook.qun)){
-                    comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.qun);
-                }else if(vo.getPoliticalOutlook().equals(ComMngPopulationServeExcelVO.politicalOutlook.tuan)){
-                    comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.tuan);
-                }else if(vo.getPoliticalOutlook().equals(ComMngPopulationServeExcelVO.politicalOutlook.dang)){
-                    comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.dang);
-                }else if(vo.getPoliticalOutlook().equals(ComMngPopulationServeExcelVO.politicalOutlook.wu)){
-                    comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.wu);
-                }else{
-                    comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.no);
-                }
-            }
             comMngPopulationDO.setVillageId(comMngVillageDO.getVillageId());
             comMngPopulationDO.setActId(comActDO.getCommunityId());
             comMngPopulationDO.setStreetId(comActDO.getStreetId());
@@ -336,4 +304,42 @@
         }
         return R.fail();
     }
+
+    /**
+     * 根据社区id查询所有实有人口
+     * @param communityId   社区id
+     * @return  查询结果
+     */
+    @Override
+    public R getPopulationListByCommunityId(Long communityId) {
+        List<ComMngPopulationDO> list = populationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().eq("act_id",communityId));
+        List<ComMngPopulationVO> resultList = new ArrayList<>();
+        if(list.size() > 0){
+            list.forEach(populationDO -> {
+                ComMngPopulationVO populationVO=new ComMngPopulationVO();
+                BeanUtils.copyProperties(populationDO,populationVO);
+                resultList.add(populationVO);
+            });
+        }
+        return R.ok(resultList);
+    }
+
+    /**
+     * 根据id集合查询实有人口
+     * @param Ids   实有人口id集合
+     * @return  查询结果
+     */
+    @Override
+    public R getPopulationLists(List<Long> Ids) {
+        List<ComMngPopulationDO> list = populationDAO.selectBatchIds(Ids);
+        List<ComMngPopulationVO> resultList = new ArrayList<>();
+        if(list.size() > 0){
+            list.forEach(populationDO -> {
+                ComMngPopulationVO populationVO = new ComMngPopulationVO();
+                BeanUtils.copyProperties(populationDO,populationVO);
+                resultList.add(populationVO);
+            });
+        }
+        return R.ok(resultList);
+    }
 }

--
Gitblit v1.7.1