| | |
| | | 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; |
| | |
| | | @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); |
| | | } |
| | |
| | | } |
| | | |
| | | @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(); |
| | |
| | | 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(); |
| | | } |