| | |
| | | public R listComActVillage(ComMngVillageVO comMngVillageVO) { |
| | | List<ComMngVillageDO> vos = Lists.newArrayList(); |
| | | LambdaQueryWrapper<ComMngVillageDO> param = new QueryWrapper<ComMngVillageDO>().lambda(); |
| | | param.eq(ComMngVillageDO::getAlley, comMngVillageVO.getAlley()); |
| | | if(StringUtils.isNotEmpty(comMngVillageVO.getName())){ |
| | | param.like(ComMngVillageDO::getName, comMngVillageVO.getName()); |
| | | } |
| | | param.eq(ComMngVillageDO::getCommunityId, comMngVillageVO.getCommunityId()); |
| | | List<ComMngVillageDO> comMngVillageDOS = comActVillageDAO.selectList(param); |
| | | BeanUtils.copyProperties(vos, comMngVillageDOS); |
| | | return R.ok(vos); |
| | | BeanUtils.copyProperties(comMngVillageDOS, vos); |
| | | return R.ok(comMngVillageDOS); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (comMngVillageDO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | Integer count= this.baseMapper.selectCount(new QueryWrapper<ComMngVillageDO>().lambda().eq(ComMngVillageDO::getAlley,comMngVillageVO.getAlley()).eq(ComMngVillageDO::getHouseNum,comMngVillageVO.getHouseNum())); |
| | | if(count>0){ |
| | | return R.fail("街路巷已存在"); |
| | | if(!comMngVillageVO.getAlley().equals(comMngVillageDO.getAlley())&&!comMngVillageVO.getHouseNum().equals(comMngVillageDO.getHouseNum())){ |
| | | Integer count= this.baseMapper.selectCount(new QueryWrapper<ComMngVillageDO>().lambda().eq(ComMngVillageDO::getAlley,comMngVillageVO.getAlley()).eq(ComMngVillageDO::getHouseNum,comMngVillageVO.getHouseNum())); |
| | | if(count>0){ |
| | | return R.fail("街路巷已存在"); |
| | | } |
| | | //历史人口数据处理 |
| | | List<ComMngPopulationDO> populationDOS=this.populationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda().eq(ComMngPopulationDO::getVillageId,villageId)); |
| | | if(!populationDOS.isEmpty()){ |
| | | populationDOS.forEach(comMngPopulationDO -> { |
| | | comMngPopulationDO.setRoad(comMngVillageVO.getAlley()); |
| | | comMngPopulationDO.setDoorNo(comMngVillageVO.getHouseNum()); |
| | | comMngPopulationDO.setAddress(comMngPopulationDO.getAddress().replace(comMngVillageDO.getAlley()+comMngVillageDO.getHouseNum(),comMngVillageVO.getAlley()+comMngVillageVO.getHouseNum())); |
| | | this.populationDAO.updateById(comMngPopulationDO); |
| | | }); |
| | | } |
| | | //历史房屋数据处理 |
| | | List<ComMngPopulationHouseDO> comMngPopulationHouseDOS=this.comMngPopulationHouseDAO.selectList(new QueryWrapper<ComMngPopulationHouseDO>().lambda().eq(ComMngPopulationHouseDO::getVillageId,comMngVillageVO.getVillageId())); |
| | | if(!comMngPopulationHouseDOS.isEmpty()){ |
| | | comMngPopulationHouseDOS.forEach(comMngPopulationHouseDO -> { |
| | | comMngPopulationHouseDO.setAlley(comMngVillageVO.getAlley()); |
| | | comMngPopulationHouseDO.setHouseNum(comMngVillageVO.getHouseNum()); |
| | | comMngPopulationHouseDO.setAddress(comMngPopulationHouseDO.getAddress().replace(comMngVillageDO.getAlley()+comMngVillageDO.getHouseNum(),comMngVillageVO.getAlley()+comMngVillageVO.getHouseNum())); |
| | | this.comMngPopulationHouseDAO.updateById(comMngPopulationHouseDO); |
| | | }); |
| | | } |
| | | } |
| | | ComActDO comActDO = comActDAO.selectById(comMngVillageDO.getCommunityId()); |
| | | if (comActDO == null || comActDO.getStreetId() == null) { |
| | | return R.fail("社区没有绑定街道,请绑定后操作!"); |
| | | } |
| | | //历史人口数据处理 |
| | | List<ComMngPopulationDO> populationDOS=this.populationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda().eq(ComMngPopulationDO::getVillageId,villageId)); |
| | | if(!populationDOS.isEmpty()){ |
| | | populationDOS.forEach(comMngPopulationDO -> { |
| | | comMngPopulationDO.setAddress(comMngPopulationDO.getAddress().replace(comMngVillageDO.getAlley()+comMngVillageDO.getHouseNum(),comMngVillageVO.getAlley()+comMngVillageVO.getHouseNum())); |
| | | this.populationDAO.updateById(comMngPopulationDO); |
| | | }); |
| | | } |
| | | BeanUtils.copyProperties(comMngVillageVO, comMngVillageDO); |
| | | comMngVillageDO.setName(comMngVillageVO.getGroupAt()); |