DESKTOP-71BH0QO\L、ming
2021-03-29 b8637915f199f88c643f96118c2dd00201472fcc
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
@@ -9,12 +9,8 @@
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngVillageVO;
import com.panzhihua.common.model.vos.community.ComStreetVO;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.dao.ComMngVillageDAO;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.dao.ComActVillageDAO;
import com.panzhihua.service_community.model.dos.ComMngVillageDO;
import com.panzhihua.service_community.model.dos.ComStreetDO;
import com.panzhihua.service_community.service.ComMngVillageService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -29,23 +25,24 @@
@Service
public class ComMngVillageServiceImpl implements ComMngVillageService {
    @Resource
    ComMngVillageDAO comMngVillageDAO;
    ComActVillageDAO comActVillageDAO;
    @Override
    public R addComMngVillage(ComMngVillageVO comMngVillageVO) {
    public R addComActVillage(ComMngVillageVO comMngVillageVO) {
        ComMngVillageDO comMngVillageDO = new ComMngVillageDO();
        LambdaQueryWrapper<ComMngVillageDO> param = new QueryWrapper<ComMngVillageDO>().lambda();
        param.eq(ComMngVillageDO::getCommunityId, comMngVillageVO.getCommunityId());
        Integer resultCount = comMngVillageDAO.selectCount(param);
        param.eq(ComMngVillageDO::getAlley, comMngVillageVO.getAlley());
        Integer resultCount = comActVillageDAO.selectCount(param);
        if (resultCount > 0) {
            return R.fail("实有房屋已经存在");
        }
        BeanUtils.copyProperties(comMngVillageVO, comMngVillageDO);
        int insert = comMngVillageDAO.insert(comMngVillageDO);
        int insert = comActVillageDAO.insert(comMngVillageDO);
        if (insert > 0) {
            param.eq(ComMngVillageDO::getAlley, comMngVillageVO.getAlley());
            param.eq(ComMngVillageDO::getHouseNum, comMngVillageVO.getHouseNum());
            ComMngVillageDO comMngVillageDO1 = comMngVillageDAO.selectOne(param);
            ComMngVillageDO comMngVillageDO1 = comActVillageDAO.selectOne(param);
            BeanUtils.copyProperties(comMngVillageDO1, comMngVillageVO);
            return R.ok(comMngVillageVO);
        }
@@ -53,19 +50,19 @@
    }
    @Override
    public R listComMngVillage(ComMngVillageVO comMngVillageVO) {
    public R listComActVillage(ComMngVillageVO comMngVillageVO) {
        List<ComMngVillageDO> vos = Lists.newArrayList();
        LambdaQueryWrapper<ComMngVillageDO> param = new QueryWrapper<ComMngVillageDO>().lambda();
        param.eq(ComMngVillageDO::getAlley, comMngVillageVO.getAlley());
        param.eq(ComMngVillageDO::getCommunityId, comMngVillageVO.getCommunityId());
        List<ComMngVillageDO> comMngVillageDOS = comMngVillageDAO.selectList(param);
        List<ComMngVillageDO> comMngVillageDOS = comActVillageDAO.selectList(param);
        BeanUtils.copyProperties(vos, comMngVillageDOS);
        return R.ok(vos);
    }
    @Override
    public R pageComMngVillage(PageComMngVillageDTO pageComMngVillageDTO) {
    public R pageComActVillage(PageComMngVillageDTO pageComMngVillageDTO) {
        Page page = new Page<>();
        Long pageNum = pageComMngVillageDTO.getPageNum();
        Long pageSize = pageComMngVillageDTO.getPageSize();
@@ -82,13 +79,13 @@
            userLambdaQueryWrapper.like(ComMngVillageDO::getAlley, pageComMngVillageDTO.getAlley());
        }
        Page userPage = new Page(pageNum, pageSize);
        IPage<ComMngVillageDO> doPager = comMngVillageDAO.selectPage(userPage, userLambdaQueryWrapper);
        IPage<ComMngVillageDO> doPager = comActVillageDAO.selectPage(userPage, userLambdaQueryWrapper);
        return R.ok(doPager);
    }
    @Override
    public R delecComMngVillage(List<Long> Ids) {
        int delete = comMngVillageDAO.deleteBatchIds(Ids);
    public R delecComActVillage(List<Long> Ids) {
        int delete = comActVillageDAO.deleteBatchIds(Ids);
        if (delete > 0) {
            return R.ok();
        }