huanghongfa
2021-01-15 ada9d2e3f734582a0d9ae8c00a936d8c8ed669d7
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructAreaServiceImpl.java
@@ -16,6 +16,7 @@
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
@@ -69,10 +70,10 @@
        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);
@@ -151,8 +152,34 @@
     */
    @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);
    }