From d2a5b25d25e8912d3e9e4ae5f9a315c386060f25 Mon Sep 17 00:00:00 2001
From: CeDo <cedoogle@gmail.com>
Date: 星期三, 14 四月 2021 11:31:33 +0800
Subject: [PATCH] bug fixed: 过滤删除的调查问卷,添加调查问卷 调查对象
---
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