From 689f0a4a22dced34c3b7c9178a1708410a5a0541 Mon Sep 17 00:00:00 2001
From: manailin <261030956@qq.com>
Date: 星期二, 28 九月 2021 17:06:15 +0800
Subject: [PATCH] Merge branch 'test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into test

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 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 73d25e9..0722ea0 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
@@ -6668,13 +6668,24 @@
      * @return 删除结果
      */
     @Override
-    public R deleteSpecialInputUser(Long id) {
+    public R deleteSpecialInputUser(Long id,Long communityId) {
         // 查询特殊群体人员
         ComMngPopulationDO populationDO = this.baseMapper.selectById(id);
         if (populationDO == null) {
             return R.fail("未查询到该记录");
         }
         populationDO.setLabel(null);
+
+        //  清理社区与人口关联信息的label信息
+        List<ComMngPopulationCommunityTagsDO> communityTagsDOList = comMngPopulationCommunityTagsDAO.selectList(new QueryWrapper<ComMngPopulationCommunityTagsDO>()
+                .lambda().eq(ComMngPopulationCommunityTagsDO::getPopulationId,id).eq(ComMngPopulationCommunityTagsDO::getCommunityId,communityId));
+        if(communityTagsDOList != null && communityTagsDOList.size() > 0){
+            communityTagsDOList.forEach(communityTags -> {
+                communityTags.setLabel(null);
+                comMngPopulationCommunityTagsDAO.updateById(communityTags);
+            });
+        }
+
         if (this.baseMapper.updateById(populationDO) > 0) {
             return R.ok();
         } else {
@@ -7604,6 +7615,8 @@
             return R.fail("您选择的数据中存在被引用的,无法删除");
         }
         this.baseMapper.deleteBatchIds(ids);
+        //删除人口并删除人口和社区关联关系
+        this.baseMapper.deletePopulaitonRelation(ids);
         return R.ok("删除成功");
     }
 

--
Gitblit v1.7.1