| | |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | Page page = new Page<>(); |
| | | Long pageNum = comMngStructAreaVO.getPageNum(); |
| | | Long pageSize = comMngStructAreaVO.getPageSize(); |
| | | if (ObjectUtils.isEmpty(pageNum)||0==pageNum) { |
| | | if (null==pageNum||0==pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (ObjectUtils.isEmpty(pageSize)||0==pageSize) { |
| | | if (null==pageSize||0==pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | |
| | | */ |
| | | @Override |
| | | public R listArea(Long communityId) { |
| | | List<ComMngStructAreaVO> comMngStructAreaVOS=new ArrayList<>(); |
| | | List<ComMngStructAreaDO> comMngStructAreaDOS = comMngStructAreaDAO.selectList(new QueryWrapper<ComMngStructAreaDO>().lambda().eq(ComMngStructAreaDO::getCommunityId, communityId)); |
| | | return R.ok(comMngStructAreaDOS); |
| | | if (!ObjectUtils.isEmpty(comMngStructAreaDOS)) { |
| | | comMngStructAreaDOS.forEach(comMngStructAreaDO -> { |
| | | ComMngStructAreaVO comMngStructAreaVO=new ComMngStructAreaVO(); |
| | | BeanUtils.copyProperties(comMngStructAreaDO,comMngStructAreaVO); |
| | | comMngStructAreaVOS.add(comMngStructAreaVO); |
| | | }); |
| | | |
| | | } |
| | | return R.ok(comMngStructAreaVOS); |
| | | } |
| | | |
| | | /** |
| | | * 小区详情 |
| | | * |
| | | * @param areaId 小区id |
| | | * @return 小区信息 |
| | | */ |
| | | @Override |
| | | public R detailArea(Long areaId) { |
| | | ComMngStructAreaDO comMngStructAreaDO = comMngStructAreaDAO.selectById(areaId); |
| | | if (ObjectUtils.isEmpty(comMngStructAreaDO)) { |
| | | return R.fail("小区不存在"); |
| | | } |
| | | ComMngStructAreaVO comMngStructAreaVO=new ComMngStructAreaVO(); |
| | | BeanUtils.copyProperties(comMngStructAreaDO,comMngStructAreaVO); |
| | | return R.ok(comMngStructAreaVO); |
| | | } |
| | | |
| | | |