罗元桥
2021-06-22 c6512655e722d9ca80dd8c34b79f6d3923ecf86c
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseServiceImpl.java
@@ -1,5 +1,7 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.CascadeHouseDTO;
@@ -11,9 +13,12 @@
import com.panzhihua.common.model.vos.community.ComMngPopulationHouseTotalVO;
import com.panzhihua.common.model.vos.community.ComMngPopulationHouseUserAdminVO;
import com.panzhihua.service_community.dao.ComActVillageDAO;
import com.panzhihua.service_community.dao.ComMngPopulationDAO;
import com.panzhihua.service_community.dao.ComMngPopulationHouseDAO;
import com.panzhihua.service_community.dao.ComMngPopulationHouseUserDAO;
import com.panzhihua.service_community.model.dos.ComMngPopulationDO;
import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO;
import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO;
import com.panzhihua.service_community.model.dos.ComMngVillageDO;
import com.panzhihua.service_community.service.ComMngPopulationHouseService;
import com.panzhihua.service_community.service.ComMngVillageService;
@@ -38,6 +43,8 @@
    @Resource
    private ComMngPopulationHouseUserDAO comMngPopulationHouseUserDAO;
    @Resource
    private ComMngPopulationDAO comMngPopulationDAO;
    @Resource
    private ComActVillageDAO comActVillageDAO;
@@ -201,6 +208,13 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R deleteHouses(List<Long> Ids){
        LambdaQueryWrapper<ComMngPopulationHouseUserDO> paramWrapper = Wrappers.lambdaQuery();
        paramWrapper.in(ComMngPopulationHouseUserDO::getHouseId, Ids);
        List<ComMngPopulationHouseUserDO> mngPopulationDOList = comMngPopulationHouseUserDAO.selectList(paramWrapper);
        if (!mngPopulationDOList.isEmpty()) {
            return R.fail("无法删除,已绑定实有人口!");
        }
        if(this.baseMapper.deleteBatchIds(Ids) > 0){
            return R.ok();
        }else{