diff --git a/air/src/main/java/com/air/controller/BlocksController.java b/air/src/main/java/com/air/housing/controller/BlocksController.java similarity index 85% rename from air/src/main/java/com/air/controller/BlocksController.java rename to air/src/main/java/com/air/housing/controller/BlocksController.java index 9219a34..d8eba79 100644 --- a/air/src/main/java/com/air/controller/BlocksController.java +++ b/air/src/main/java/com/air/housing/controller/BlocksController.java @@ -1,7 +1,8 @@ -package com.air.controller; +package com.air.housing.controller; -import com.air.entity.Blocks; -import com.air.service.BlocksService; +import com.air.housing.dto.BlockListDto; +import com.air.housing.entity.Blocks; +import com.air.housing.service.BlocksService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.cinderella.framework.common.core.util.R; @@ -39,7 +40,11 @@ public class BlocksController { return R.ok(blocksService.page(page, Wrappers.query(blocks))); } - + @ApiOperation(value = "分页查询", notes = "分页查询") + @GetMapping("/page") + public R getBlocksPageByHousingEstatesId(Page page, BlockListDto blocks) { + return R.ok(blocksService.getBlocksPageByHousingEstatesId(page,blocks)); + } /** * 通过id查询楼栋信息 * @@ -52,6 +57,7 @@ public class BlocksController { return R.ok(blocksService.getById(blockId)); } + /** * 新增楼栋信息 * diff --git a/air/src/main/java/com/air/housing/controller/HousesController.java b/air/src/main/java/com/air/housing/controller/HousesController.java index 7c174a5..686f0b5 100644 --- a/air/src/main/java/com/air/housing/controller/HousesController.java +++ b/air/src/main/java/com/air/housing/controller/HousesController.java @@ -2,6 +2,7 @@ package com.air.housing.controller; import com.air.housing.entity.Houses; import com.air.housing.service.HousesService; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.cinderella.framework.common.core.util.R; @@ -52,6 +53,17 @@ public class HousesController { return R.ok(housesService.getById(houseId)); } + /** + * 通过楼栋id查询房屋信息 + * + * @param blockId + * @return R + */ + @ApiOperation(value = "通过id查询", notes = "通过id查询") + @GetMapping("/{blockId}") + public R getByBlockId(Page page,@PathVariable("blockId") Long blockId) { + return R.ok(housesService.page(page,Wrappers.lambdaQuery().eq(Houses::getBlockId,blockId))); + } /** * 新增房屋信息 * diff --git a/air/src/main/java/com/air/housing/controller/HousingEstatesController.java b/air/src/main/java/com/air/housing/controller/HousingEstatesController.java index 90d2e8b..80c1a82 100644 --- a/air/src/main/java/com/air/housing/controller/HousingEstatesController.java +++ b/air/src/main/java/com/air/housing/controller/HousingEstatesController.java @@ -1,10 +1,17 @@ package com.air.housing.controller; +import cn.hutool.core.util.StrUtil; import com.air.housing.dto.HousingDefine; +import com.air.housing.entity.Format; import com.air.housing.entity.HousingEstates; +import com.air.housing.service.FormatService; import com.air.housing.service.HousingEstatesService; +import com.air.housing.vo.HousingEstatesDetail; import com.air.housing.vo.HousingEstatesName; +import com.air.land.entity.LandListed; +import com.air.land.service.LandListedService; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.cinderella.framework.common.core.util.R; import com.cinderella.framework.common.data.mybatis.QueryPage; @@ -29,6 +36,11 @@ public class HousingEstatesController { private final HousingEstatesService housingEstatesService; + private final FormatService formatService; + + + private final LandListedService landListedService; + /** * 分页查询 * @@ -63,8 +75,9 @@ public class HousingEstatesController { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping("/{housingEstatesId}") - public R getById(@PathVariable("housingEstatesId") Long housingEstatesId) { - return R.ok(housingEstatesService.getById(housingEstatesId)); + public R getById(@PathVariable("housingEstatesId") Long housingEstatesId,Long blockId) { + HousingEstatesDetail housingEstates = housingEstatesService.getHousingEstatesDetail(housingEstatesId,blockId); + return R.ok(housingEstates); } /** diff --git a/air/src/main/java/com/air/housing/dto/BlockListDto.java b/air/src/main/java/com/air/housing/dto/BlockListDto.java new file mode 100644 index 0000000..746c336 --- /dev/null +++ b/air/src/main/java/com/air/housing/dto/BlockListDto.java @@ -0,0 +1,20 @@ +package com.air.housing.dto; + +import io.swagger.annotations.ApiModelProperty; + +/** + * @ClassName BlockListDto + * @Author Lenovo 102306 + * @Date 2021/6/9 10:40 + */ +public class BlockListDto { + + @ApiModelProperty(value = "楼盘id") + Long housingEstatesId; + + @ApiModelProperty(value = "大业态") + String largeFormat; + + @ApiModelProperty(value = "小业态") + String format; +} diff --git a/air/src/main/java/com/air/entity/Blocks.java b/air/src/main/java/com/air/housing/entity/Blocks.java similarity index 97% rename from air/src/main/java/com/air/entity/Blocks.java rename to air/src/main/java/com/air/housing/entity/Blocks.java index e75e957..ec9f7f8 100644 --- a/air/src/main/java/com/air/entity/Blocks.java +++ b/air/src/main/java/com/air/housing/entity/Blocks.java @@ -1,4 +1,4 @@ -package com.air.entity; +package com.air.housing.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/air/src/main/java/com/air/housing/mapper/BlocksMapper.java b/air/src/main/java/com/air/housing/mapper/BlocksMapper.java new file mode 100644 index 0000000..94f4fba --- /dev/null +++ b/air/src/main/java/com/air/housing/mapper/BlocksMapper.java @@ -0,0 +1,30 @@ +package com.air.housing.mapper; + +import com.air.housing.dto.BlockListDto; +import com.air.housing.entity.Blocks; +import com.air.housing.vo.HousingEstatesName; +import com.air.sysMessage.entity.SysMessage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.springframework.security.core.parameters.P; + +import java.util.List; + +/** + * 楼栋信息 + * + * @author peihao + * @date 2021-05-18 09:39:45 + */ +public interface BlocksMapper extends BaseMapper { + + /** + * 根据楼盘id,大业态,小业态筛选楼栋信息 + * @param page + * @param blockListDto + * @return + */ + Page getBlocksPageByHousingEstatesId(Page page, @Param("Blocks")BlockListDto blockListDto); +} diff --git a/air/src/main/java/com/air/housing/service/BlocksService.java b/air/src/main/java/com/air/housing/service/BlocksService.java new file mode 100644 index 0000000..a666a75 --- /dev/null +++ b/air/src/main/java/com/air/housing/service/BlocksService.java @@ -0,0 +1,22 @@ +package com.air.housing.service; + +import com.air.housing.dto.BlockListDto; +import com.air.housing.entity.Blocks; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 楼栋信息 + * + * @author peihao + * @date 2021-05-18 09:39:45 + */ +public interface BlocksService extends IService { + /** + * 根据楼盘id,大业态,小业态查询楼栋分页信息 + * @param blockListDto + * @return + */ + Page getBlocksPageByHousingEstatesId(Page page,BlockListDto blockListDto); + +} diff --git a/air/src/main/java/com/air/housing/service/HousingEstatesService.java b/air/src/main/java/com/air/housing/service/HousingEstatesService.java index eb8310b..77bdc39 100644 --- a/air/src/main/java/com/air/housing/service/HousingEstatesService.java +++ b/air/src/main/java/com/air/housing/service/HousingEstatesService.java @@ -2,10 +2,10 @@ package com.air.housing.service; import com.air.housing.dto.HousingDefine; import com.air.housing.entity.HousingEstates; +import com.air.housing.vo.HousingEstatesDetail; import com.air.housing.vo.HousingEstatesName; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; -import com.cinderella.framework.common.data.mybatis.QueryPage; /** * 楼盘(小区) @@ -32,4 +32,12 @@ public interface HousingEstatesService extends IService { * @return true */ boolean createFromOrigin(HousingDefine housingDefine); + + /** + * 根据楼盘id查询楼盘信息和相关的地块信息,如果楼栋个id不为空,再查询业态信息 + * @param estateId + * @param blockId + * @return + */ + HousingEstatesDetail getHousingEstatesDetail(Long estateId,Long blockId); } diff --git a/air/src/main/java/com/air/housing/service/impl/BlocksServiceImpl.java b/air/src/main/java/com/air/housing/service/impl/BlocksServiceImpl.java new file mode 100644 index 0000000..7af6624 --- /dev/null +++ b/air/src/main/java/com/air/housing/service/impl/BlocksServiceImpl.java @@ -0,0 +1,29 @@ +package com.air.housing.service.impl; + +import com.air.housing.dto.BlockListDto; +import com.air.housing.entity.Blocks; +import com.air.housing.mapper.BlocksMapper; +import com.air.housing.service.BlocksService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 楼栋信息 + * + * @author peihao + * @date 2021-05-18 09:39:45 + */ +@Service +public class BlocksServiceImpl extends ServiceImpl implements BlocksService { + + @Resource + private BlocksMapper blocksMapper; + @Override + public Page getBlocksPageByHousingEstatesId(Page page,BlockListDto blockListDto) { + + return null; + } +} diff --git a/air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java b/air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java index 0b025c7..dbe9e4d 100644 --- a/air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java +++ b/air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java @@ -1,17 +1,23 @@ package com.air.housing.service.impl; -import com.air.entity.Blocks; +import cn.hutool.core.util.ObjectUtil; +import com.air.housing.entity.Blocks; +import com.air.housing.entity.Format; import com.air.housing.entity.Houses; import com.air.housing.dto.HousingDefine; import com.air.housing.entity.HousingEstates; import com.air.housing.mapper.HousingEstatesMapper; +import com.air.housing.service.FormatService; import com.air.housing.service.HousingEstatesService; +import com.air.housing.vo.HousingEstatesDetail; import com.air.housing.vo.HousingEstatesName; +import com.air.land.entity.LandListed; +import com.air.land.service.LandListedService; import com.air.origin.entity.BlocksOrigin; import com.air.origin.entity.HousesOrigin; import com.air.origin.service.BlocksOriginService; import com.air.origin.service.HousesOriginService; -import com.air.service.BlocksService; +import com.air.housing.service.BlocksService; import com.air.housing.service.HousesService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -43,7 +49,12 @@ public class HousingEstatesServiceImpl extends ServiceImpl getHousingEstatesNamePage(IPage page, String name) { @@ -76,6 +87,20 @@ public class HousingEstatesServiceImpl extends ServiceImpllambdaQuery().eq(LandListed::getAnnoId,housingEstates.getAnnoId())); + HousingEstatesDetail detail = new HousingEstatesDetail(); + detail.setHousingEstates(housingEstates); + detail.setLandListed(landListed); + if(ObjectUtil.isNotNull(blockId)){ + Format format = formatService.getOne(Wrappers.lambdaQuery().eq(Format::getHousingEstateId,HousingEstateId)); + detail.setFormat(format); + } + return detail; + } + private void copyBlocksOriginToBlocks(BlocksOrigin blocksOrigin, HousingDefine housingDefine) { Blocks blocks = new Blocks(); blocks.setHousingEstatesId(housingDefine.getHousingEstatesId()); diff --git a/air/src/main/java/com/air/housing/vo/HousingEstatesDetail.java b/air/src/main/java/com/air/housing/vo/HousingEstatesDetail.java new file mode 100644 index 0000000..0ae27c9 --- /dev/null +++ b/air/src/main/java/com/air/housing/vo/HousingEstatesDetail.java @@ -0,0 +1,23 @@ +package com.air.housing.vo; + +import com.air.housing.entity.Format; +import com.air.housing.entity.HousingEstates; +import com.air.land.entity.LandListed; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @ClassName HousingEstatesDetail + * @Author Lenovo 102306 + * @Date 2021/6/9 9:44 + */ +@Data +@EqualsAndHashCode +public class HousingEstatesDetail { + + HousingEstates housingEstates; + + Format format; + + LandListed landListed; +} diff --git a/air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java b/air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java index 377017a..f538874 100644 --- a/air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java +++ b/air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java @@ -31,7 +31,7 @@ public class MacroDataServiceImpl extends ServiceImpl p = macroDataMapper.selectPage(page,Wrappers.lambdaQuery().eq(MacroData::getStatusCd, CommonStatusEnum.SYS_MESSAGE_STATUS_1000.getCode())); + Page p = macroDataMapper.selectPage(page,Wrappers.lambdaQuery().eq(MacroData::getStatusCd, CommonStatusEnum.SYS_MESSAGE_STATUS_1000.getCode())); return p; } diff --git a/air/src/main/java/com/air/mapper/BlocksMapper.java b/air/src/main/java/com/air/mapper/BlocksMapper.java deleted file mode 100644 index 32a4fd0..0000000 --- a/air/src/main/java/com/air/mapper/BlocksMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.air.mapper; - -import com.air.entity.Blocks; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * 楼栋信息 - * - * @author peihao - * @date 2021-05-18 09:39:45 - */ -public interface BlocksMapper extends BaseMapper { - -} diff --git a/air/src/main/java/com/air/service/BlocksService.java b/air/src/main/java/com/air/service/BlocksService.java deleted file mode 100644 index 5494566..0000000 --- a/air/src/main/java/com/air/service/BlocksService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.air.service; - -import com.air.entity.Blocks; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * 楼栋信息 - * - * @author peihao - * @date 2021-05-18 09:39:45 - */ -public interface BlocksService extends IService { - -} diff --git a/air/src/main/java/com/air/service/impl/BlocksServiceImpl.java b/air/src/main/java/com/air/service/impl/BlocksServiceImpl.java deleted file mode 100644 index 02d1650..0000000 --- a/air/src/main/java/com/air/service/impl/BlocksServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.air.service.impl; - -import com.air.entity.Blocks; -import com.air.mapper.BlocksMapper; -import com.air.service.BlocksService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * 楼栋信息 - * - * @author peihao - * @date 2021-05-18 09:39:45 - */ -@Service -public class BlocksServiceImpl extends ServiceImpl implements BlocksService { - -} diff --git a/air/src/main/resources/mapper/BlocksMapper.xml b/air/src/main/resources/mapper/BlocksMapper.xml index 5885b58..ce54ae1 100644 --- a/air/src/main/resources/mapper/BlocksMapper.xml +++ b/air/src/main/resources/mapper/BlocksMapper.xml @@ -2,6 +2,8 @@ - - + +