| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; |
| | | import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngVillageListExportAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillageStatisticsVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.service.ComMngVillageService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author: llming |
| | | * @description: 实有房屋 |
| | | **/ |
| | | @Service |
| | | public class ComMngVillageServiceImpl extends ServiceImpl<ComActVillageDAO, ComMngVillageDO> implements ComMngVillageService { |
| | | public class ComMngVillageServiceImpl extends ServiceImpl<ComActVillageDAO, ComMngVillageDO> |
| | | implements ComMngVillageService { |
| | | @Resource |
| | | ComActVillageDAO comActVillageDAO; |
| | | @Resource |
| | |
| | | return comMngVillageDO; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R pageComActVillage(PageComMngVillageDTO pageComMngVillageDTO) { |
| | | LambdaQueryWrapper<ComMngVillageDO> userLambdaQueryWrapper = Wrappers.lambdaQuery(); |
| | |
| | | userLambdaQueryWrapper.eq(ComMngVillageDO::getType, pageComMngVillageDTO.getType()); |
| | | } |
| | | Page userPage = new Page(pageComMngVillageDTO.getPageNum(), pageComMngVillageDTO.getPageSize()); |
| | | IPage<ComMngVillageDO> doPager = comActVillageDAO.selectPage(userPage, userLambdaQueryWrapper.orderByDesc(ComMngVillageDO::getCreateAt)); |
| | | IPage<ComMngVillageDO> doPager = |
| | | comActVillageDAO.selectPage(userPage, userLambdaQueryWrapper.orderByDesc(ComMngVillageDO::getCreateAt)); |
| | | |
| | | IPage<ComMngVillageVO> villageVOIPage = new Page<>(); |
| | | villageVOIPage.setCurrent(doPager.getCurrent()); |
| | |
| | | if (list.size() == 0) { |
| | | return R.fail("数据为空!"); |
| | | } |
| | | List<ComMngVillageDO> comMngVillageDOs = comActVillageDAO.selectList(new QueryWrapper<ComMngVillageDO>().lambda().eq(ComMngVillageDO::getCommunityId, communityId)); |
| | | List<ComMngVillageDO> comMngVillageDOs = comActVillageDAO |
| | | .selectList(new QueryWrapper<ComMngVillageDO>().lambda().eq(ComMngVillageDO::getCommunityId, communityId)); |
| | | int index = 2; |
| | | for (ComMngVillageServeExcelVO vo : list) { |
| | | if (vo.getHouseNum() == null) { |
| | |
| | | return R.fail("街路巷第" + index + "行为空!"); |
| | | } |
| | | //判断DB和exel数据重复判断 |
| | | boolean result = comMngVillageDOs.stream().anyMatch(village -> village.getAlley().equals(vo.getAlley()) && village.getHouseNum().equals(vo.getHouseNum())); |
| | | boolean result = comMngVillageDOs.stream().anyMatch( |
| | | village -> village.getAlley().equals(vo.getAlley()) && village.getHouseNum().equals(vo.getHouseNum())); |
| | | if (result) { |
| | | return R.fail("导入街路巷已存在(" + vo.getAlley() + ")"); |
| | | } |
| | |
| | | return R.fail("社区没有绑定街道,请绑定后操作!"); |
| | | } |
| | | comMngVillageDO.setStreetId(comActDO.getStreetId()); |
| | | int update = this.baseMapper.update(comMngVillageDO, new LambdaQueryWrapper<ComMngVillageDO>() |
| | | .eq(ComMngVillageDO::getVillageId, villageId)); |
| | | int update = this.baseMapper.update(comMngVillageDO, |
| | | new LambdaQueryWrapper<ComMngVillageDO>().eq(ComMngVillageDO::getVillageId, villageId)); |
| | | if(update>0){ |
| | | return R.ok(comMngVillageVO); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 统计社区内小区数量 |
| | | * @param communityId 社区id |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 统计小区数量 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 小区详情 |
| | | * @param villageId 小区id |
| | | * |
| | | * @param villageId |
| | | * 小区id |
| | | * @return 小区详情 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 综治app-小区列表 |
| | | * @param villageListAppDTO 请求参数 |
| | | * |
| | | * @param villageListAppDTO |
| | | * 请求参数 |
| | | * @return 小区列表 |
| | | */ |
| | | @Override |
| | | public R getGridVillageList(ComMngVillageListAppDTO villageListAppDTO){ |
| | | return R.ok(this.baseMapper.getGridVillageList(new Page(villageListAppDTO.getPageNum(),villageListAppDTO.getPageSize()),villageListAppDTO)); |
| | | return R.ok(this.baseMapper.getGridVillageList( |
| | | new Page(villageListAppDTO.getPageNum(), villageListAppDTO.getPageSize()), villageListAppDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 综治app-根据小区id查询小区下楼栋列表 |
| | | * @param villageId 小区id |
| | | * |
| | | * @param villageId |
| | | * 小区id |
| | | * @return 楼栋列表 |
| | | */ |
| | | @Override |