From eefbb8708d62ce3ca9b0f00402d586c78716af77 Mon Sep 17 00:00:00 2001
From: manailin <261030956@qq.com>
Date: 星期六, 12 六月 2021 17:37:07 +0800
Subject: [PATCH] [新增]导入特殊人群信息,导入小区,导入楼栋和网格信息

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 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 e1adf13..6877494 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
@@ -798,8 +798,41 @@
         return R.ok(this.baseMapper.getPopulationTotalByAdmin(communityId));
     }
 
-
-    public static void main(String[] args) {
-//        List<ComMngPopulationHouseUserDO> distinctClass = populationHouseUserDOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPopulId() + ";" + o.getHouseId() + ";" + o.getId() + ";" + o.getRelation()))), ArrayList::new));
+    @Override
+    public R editTagPopulationByCardNo(ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO)  {
+        ComMngPopulationDO comMngPopulationDO = getPopulationByCardNo(comMngPopulationTagCardNoDTO.getCardNo());
+        if (comMngPopulationDO == null) {
+            return R.fail("未查询到人口记录");
+        }
+        ComMngPopulationDO comMngPopulation = new ComMngPopulationDO();
+        if(comMngPopulationDO.getLabel()!=null) {
+            if(!comMngPopulationDO.getLabel().contains(comMngPopulationTagCardNoDTO.getLabel())) {
+                comMngPopulation.setLabel(comMngPopulationTagCardNoDTO.getLabel().concat(",").concat(comMngPopulationDO.getLabel()));
+            }
+        }else{
+            comMngPopulation.setLabel(comMngPopulationTagCardNoDTO.getLabel());
+        }
+        comMngPopulation.setCardNo(null);
+        comMngPopulation.setId(comMngPopulationDO.getId());
+        int nub = populationDAO.updateById(comMngPopulation);
+        if (nub < 1) {
+            return R.fail();
+        }
+        return R.ok();
     }
+
+    @Override
+    public ComMngPopulationDO getPopulationByCardNo(String cardNo) {
+        try {
+            String aesCardNo = AESUtil.encrypt128(cardNo, aesKey);
+            return baseMapper.selectOne(
+                    new QueryWrapper<ComMngPopulationDO>()
+                            .eq("card_no",aesCardNo)
+            );
+        } catch (Exception e) {
+           log.error("根据身份证查询业务-加密证件信息出错");
+        }
+        return null;
+    }
+
 }

--
Gitblit v1.7.1