CeDo
2021-04-15 ae30ebfc3e4a38aed0d91a42da4a1544dbd87ba3
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();