From c3ce38cb41d4e4a7d036576b7be52ec2d8c3e724 Mon Sep 17 00:00:00 2001
From: CeDo <cedoogle@gmail.com>
Date: 星期一, 12 四月 2021 16:07:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
index 9960566..0770984 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
@@ -13,9 +13,11 @@
 import com.panzhihua.common.model.vos.community.ComMngVillageVO;
 import com.panzhihua.service_community.dao.ComActDAO;
 import com.panzhihua.service_community.dao.ComActVillageDAO;
+import com.panzhihua.service_community.dao.ComMngPopulationDAO;
 import com.panzhihua.service_community.dao.ComMngVolunteerMngDAO;
 import com.panzhihua.service_community.model.dos.ComActDO;
 import com.panzhihua.service_community.model.dos.ComActDiscussDO;
+import com.panzhihua.service_community.model.dos.ComMngPopulationDO;
 import com.panzhihua.service_community.model.dos.ComMngVillageDO;
 import com.panzhihua.service_community.service.ComMngVillageService;
 import org.springframework.beans.BeanUtils;
@@ -38,6 +40,8 @@
     ComActVillageDAO comActVillageDAO;
     @Resource
     ComActDAO comActDAO;
+    @Resource
+    ComMngPopulationDAO populationDAO;
 
     @Override
     public R addComActVillage(ComMngVillageVO comMngVillageVO) {
@@ -100,6 +104,12 @@
 
     @Override
     public R delecComActVillage(List<Long> Ids) {
+        LambdaQueryWrapper<ComMngPopulationDO> paramWrapper = Wrappers.lambdaQuery();
+        paramWrapper.in(ComMngPopulationDO::getVillageId, Ids);
+        ComMngPopulationDO mngPopulationDO = populationDAO.selectOne(paramWrapper);
+        if (mngPopulationDO != null) {
+            return R.fail("无法删除,已绑定实有人口!");
+        }
         int delete = comActVillageDAO.deleteBatchIds(Ids);
         if (delete > 0) {
             return R.ok();

--
Gitblit v1.7.1