From 6ef84502f291cdda18c8042a755ef0537d692afe Mon Sep 17 00:00:00 2001 From: zeb <936152864@qq.com> Date: Wed, 9 Jun 2021 09:16:03 +0800 Subject: [PATCH] no message --- .../housing/controller/FormatController.java | 85 +++++++++++++++++ .../controller/HousesController.java | 6 +- .../controller/HousingEstatesController.java | 10 +- .../com/air/housing/dto/HousingDefine.java | 30 ++++++ .../java/com/air/housing/entity/Format.java | 80 ++++++++++++++++ .../com/air/{ => housing}/entity/Houses.java | 11 ++- .../com/air/housing/mapper/FormatMapper.java | 14 +++ .../{ => housing}/mapper/HousesMapper.java | 4 +- .../housing/mapper/HousingEstatesMapper.java | 11 ++- .../air/housing/service/FormatService.java | 14 +++ .../{ => housing}/service/HousesService.java | 4 +- .../service/HousingEstatesService.java | 12 +++ .../service/impl/FormatServiceImpl.java | 18 ++++ .../service/impl/HousesServiceImpl.java | 8 +- .../impl/HousingEstatesServiceImpl.java | 92 ++++++++++++++++++- .../com/air/origin/entity/HousesOrigin.java | 76 +++++++-------- .../main/resources/mapper/FormatMapper.xml | 35 +++++++ .../main/resources/mapper/HousesMapper.xml | 2 +- .../resources/mapper/HousingEstatesMapper.xml | 3 + 19 files changed, 457 insertions(+), 58 deletions(-) create mode 100644 air/src/main/java/com/air/housing/controller/FormatController.java rename air/src/main/java/com/air/{ => housing}/controller/HousesController.java (95%) create mode 100644 air/src/main/java/com/air/housing/dto/HousingDefine.java create mode 100644 air/src/main/java/com/air/housing/entity/Format.java rename air/src/main/java/com/air/{ => housing}/entity/Houses.java (92%) create mode 100644 air/src/main/java/com/air/housing/mapper/FormatMapper.java rename air/src/main/java/com/air/{ => housing}/mapper/HousesMapper.java (73%) create mode 100644 air/src/main/java/com/air/housing/service/FormatService.java rename air/src/main/java/com/air/{ => housing}/service/HousesService.java (73%) create mode 100644 air/src/main/java/com/air/housing/service/impl/FormatServiceImpl.java rename air/src/main/java/com/air/{ => housing}/service/impl/HousesServiceImpl.java (64%) create mode 100644 air/src/main/resources/mapper/FormatMapper.xml diff --git a/air/src/main/java/com/air/housing/controller/FormatController.java b/air/src/main/java/com/air/housing/controller/FormatController.java new file mode 100644 index 0000000..67123f1 --- /dev/null +++ b/air/src/main/java/com/air/housing/controller/FormatController.java @@ -0,0 +1,85 @@ +package com.air.housing.controller; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.cinderella.framework.common.core.util.R; +import com.air.housing.entity.Format; +import com.air.housing.service.FormatService; +import com.cinderella.framework.common.data.mybatis.QueryPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + + +/** + * 业态信息 + * + * @author zeb + * @date 2021-06-09 09:13:16 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/format") +@Api(value = "format", tags = "业态信息管理") +public class FormatController { + + private final FormatService formatService; + + /** + * 分页查询 + * @param page 分页对象 + * @param format 业态信息 + * @return + */ + @ApiOperation(value = "分页查询", notes = "分页查询") + @GetMapping("/page") + public R getFormatPage(QueryPage page, Format format) { + return R.ok(formatService.page(page.toPage(), Wrappers.query(format))); + } + + + /** + * 通过id查询业态信息 + * @param formatId id + * @return R + */ + @ApiOperation(value = "通过id查询", notes = "通过id查询") + @GetMapping("/{formatId}") + public R getById(@PathVariable("formatId") Long formatId) { + return R.ok(formatService.getById(formatId)); + } + + /** + * 新增业态信息 + * @param format 业态信息 + * @return R + */ + @ApiOperation(value = "新增业态信息", notes = "新增业态信息") + @PostMapping + public R save(@RequestBody Format format) { + return R.ok(formatService.save(format)); + } + + /** + * 修改业态信息 + * @param format 业态信息 + * @return R + */ + @ApiOperation(value = "修改业态信息", notes = "修改业态信息") + @PutMapping + public R updateById(@RequestBody Format format) { + return R.ok(formatService.updateById(format)); + } + + /** + * 通过id删除业态信息 + * @param formatId id + * @return R + */ + @ApiOperation(value = "通过id删除业态信息", notes = "通过id删除业态信息") + @DeleteMapping("/{formatId}") + public R removeById(@PathVariable Long formatId) { + return R.ok(formatService.removeById(formatId)); + } +} diff --git a/air/src/main/java/com/air/controller/HousesController.java b/air/src/main/java/com/air/housing/controller/HousesController.java similarity index 95% rename from air/src/main/java/com/air/controller/HousesController.java rename to air/src/main/java/com/air/housing/controller/HousesController.java index 031ebeb..7c174a5 100644 --- a/air/src/main/java/com/air/controller/HousesController.java +++ b/air/src/main/java/com/air/housing/controller/HousesController.java @@ -1,7 +1,7 @@ -package com.air.controller; +package com.air.housing.controller; -import com.air.entity.Houses; -import com.air.service.HousesService; +import com.air.housing.entity.Houses; +import com.air.housing.service.HousesService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.cinderella.framework.common.core.util.R; 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 de413a9..90d2e8b 100644 --- a/air/src/main/java/com/air/housing/controller/HousingEstatesController.java +++ b/air/src/main/java/com/air/housing/controller/HousingEstatesController.java @@ -1,5 +1,6 @@ package com.air.housing.controller; +import com.air.housing.dto.HousingDefine; import com.air.housing.entity.HousingEstates; import com.air.housing.service.HousingEstatesService; import com.air.housing.vo.HousingEstatesName; @@ -42,10 +43,17 @@ public class HousingEstatesController { } @GetMapping("/page/housing_names") + @ApiOperation(value = "查询楼盘名称(分页)") public R> getHousingEstatesNamePage(QueryPage page, String name) { return R.ok(housingEstatesService.getHousingEstatesNamePage(page.toPage(), name)); } + @PostMapping("/create_from_origin") + @ApiOperation(value = "提交楼盘定义信息") + public R createFromOrigin(@RequestBody HousingDefine housingDefine) { + return R.ok(housingEstatesService.createFromOrigin(housingDefine)); + } + /** * 通过id查询楼盘(小区) @@ -80,7 +88,6 @@ public class HousingEstatesController { */ @ApiOperation(value = "修改楼盘(小区)", notes = "修改楼盘(小区)") @PutMapping - @PreAuthorize("@pms.hasPermission('generator_housingestates_edit')") public R updateById(@RequestBody HousingEstates housingEstates) { return R.ok(housingEstatesService.updateById(housingEstates)); } @@ -93,7 +100,6 @@ public class HousingEstatesController { */ @ApiOperation(value = "通过id删除楼盘(小区)", notes = "通过id删除楼盘(小区)") @DeleteMapping("/{housingEstatesId}") - @PreAuthorize("@pms.hasPermission('generator_housingestates_del')") public R removeById(@PathVariable Long housingEstatesId) { return R.ok(housingEstatesService.removeById(housingEstatesId)); } diff --git a/air/src/main/java/com/air/housing/dto/HousingDefine.java b/air/src/main/java/com/air/housing/dto/HousingDefine.java new file mode 100644 index 0000000..3101953 --- /dev/null +++ b/air/src/main/java/com/air/housing/dto/HousingDefine.java @@ -0,0 +1,30 @@ +package com.air.housing.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author zeb. + * Created by zeb on 2021/6/8. + */ +@Data +@EqualsAndHashCode +public class HousingDefine { + @ApiModelProperty(value = "blocks_origin主键") + private Long blockId; + @ApiModelProperty(value = "楼盘id") + private Long housingEstatesId; + @ApiModelProperty(value = "楼盘名称") + private String name; + @ApiModelProperty(value = "公告id") + private Long annoId; + @ApiModelProperty(value = "大业态") + private String largeFormat; + @ApiModelProperty(value = "业态") + private String format; + @ApiModelProperty(value = "物业类型") + private String propertyType; +// @ApiModelProperty(value = "其他编号") +// private String otherNo; +} diff --git a/air/src/main/java/com/air/housing/entity/Format.java b/air/src/main/java/com/air/housing/entity/Format.java new file mode 100644 index 0000000..aca671c --- /dev/null +++ b/air/src/main/java/com/air/housing/entity/Format.java @@ -0,0 +1,80 @@ +package com.air.housing.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 业态信息 + * + * @author zeb + * @date 2021-06-09 09:13:16 + */ +@Data +@TableName("format") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "业态信息") +public class Format extends Model { +private static final long serialVersionUID = 1L; + + @TableId + @ApiModelProperty(value="主键,自增") + private Long formatId; + @ApiModelProperty(value="楼盘id") + private Long housingEstateId; + @ApiModelProperty(value="物业类型") + private String propertyType; + @ApiModelProperty(value="大业态") + private String largeFormat; + @ApiModelProperty(value="业态") + private String format; + @ApiModelProperty(value="拟售总价") + private BigDecimal preTotalPrice; + @ApiModelProperty(value="装修标准(字典标识)") + private String decorationStandard; + @ApiModelProperty(value="业态体量") + private BigDecimal formatSize; + @ApiModelProperty(value="业态首推时间") + private LocalDateTime firstPushDate; + @ApiModelProperty(value="供应套数") + private Integer supplyCount; + @ApiModelProperty(value="供应面积") + private BigDecimal supplyArea; + @ApiModelProperty(value="成交套数") + private Integer dealtCount; + @ApiModelProperty(value="成交面积") + private BigDecimal dealtArea; + @ApiModelProperty(value="狭义库存") + private BigDecimal narrowSenseStock; + @ApiModelProperty(value="未推库存") + private BigDecimal unpushedStock; + @ApiModelProperty(value="广义库存") + private BigDecimal broadSenseStock; + @ApiModelProperty(value="最近6月月均成交量") + private Integer lastSixMonDealtCount; + @ApiModelProperty(value="狭义去化周期") + private Integer narrowSenseDec; + @ApiModelProperty(value="广义去化周期") + private Integer broadSenseDec; + @ApiModelProperty(value="状态") + private String statusCd; + @ApiModelProperty(value="状态时间") + private LocalDateTime statusDate; + @ApiModelProperty(value="创建人") + private String createUserId; + @ApiModelProperty(value="创建时间") + private LocalDateTime createDate; + @ApiModelProperty(value="修改人") + private String updateUserId; + @ApiModelProperty(value="修改时间") + private LocalDateTime updateDate; + @ApiModelProperty(value="备注") + private String remark; + } diff --git a/air/src/main/java/com/air/entity/Houses.java b/air/src/main/java/com/air/housing/entity/Houses.java similarity index 92% rename from air/src/main/java/com/air/entity/Houses.java rename to air/src/main/java/com/air/housing/entity/Houses.java index 5cb9255..aa5db50 100644 --- a/air/src/main/java/com/air/entity/Houses.java +++ b/air/src/main/java/com/air/housing/entity/Houses.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; @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.math.BigDecimal; import java.time.LocalDateTime; /** @@ -44,10 +45,10 @@ public class Houses extends Model { private String houseNo; @ApiModelProperty(value = "套内面积") - private Integer sleeveArea; + private BigDecimal sleeveArea; @ApiModelProperty(value = "建筑面积") - private Integer coveredArea; + private BigDecimal coveredArea; @ApiModelProperty(value = "使用用途") private String houseUsage; @@ -56,10 +57,10 @@ public class Houses extends Model { private String houseType; @ApiModelProperty(value = "拟售单价(套内)") - private Double sleevePrice; + private BigDecimal sleevePrice; @ApiModelProperty(value = "拟售单价(建面)") - private Double coveredPrice; + private BigDecimal coveredPrice; @ApiModelProperty(value = "销售状态") private String saleStatus; diff --git a/air/src/main/java/com/air/housing/mapper/FormatMapper.java b/air/src/main/java/com/air/housing/mapper/FormatMapper.java new file mode 100644 index 0000000..01224bd --- /dev/null +++ b/air/src/main/java/com/air/housing/mapper/FormatMapper.java @@ -0,0 +1,14 @@ +package com.air.housing.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.air.housing.entity.Format; + +/** + * 业态信息 + * + * @author zeb + * @date 2021-06-09 09:13:16 + */ +public interface FormatMapper extends BaseMapper { + +} diff --git a/air/src/main/java/com/air/mapper/HousesMapper.java b/air/src/main/java/com/air/housing/mapper/HousesMapper.java similarity index 73% rename from air/src/main/java/com/air/mapper/HousesMapper.java rename to air/src/main/java/com/air/housing/mapper/HousesMapper.java index 59a3f83..6a28452 100644 --- a/air/src/main/java/com/air/mapper/HousesMapper.java +++ b/air/src/main/java/com/air/housing/mapper/HousesMapper.java @@ -1,6 +1,6 @@ -package com.air.mapper; +package com.air.housing.mapper; -import com.air.entity.Houses; +import com.air.housing.entity.Houses; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** diff --git a/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java b/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java index 9b9dd1c..b3cb72f 100644 --- a/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java +++ b/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java @@ -1,7 +1,10 @@ package com.air.housing.mapper; import com.air.housing.entity.HousingEstates; +import com.air.housing.vo.HousingEstatesName; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; /** * 楼盘(小区) @@ -10,5 +13,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @date 2021-05-18 09:39:55 */ public interface HousingEstatesMapper extends BaseMapper { - + /** + * 分页查询名称 + * @param page + * @param name + * @return + */ + IPage getHousingEstatesNamePage(IPage page, @Param("name") String name); } diff --git a/air/src/main/java/com/air/housing/service/FormatService.java b/air/src/main/java/com/air/housing/service/FormatService.java new file mode 100644 index 0000000..a217a68 --- /dev/null +++ b/air/src/main/java/com/air/housing/service/FormatService.java @@ -0,0 +1,14 @@ +package com.air.housing.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.air.housing.entity.Format; + +/** + * 业态信息 + * + * @author zeb + * @date 2021-06-09 09:13:16 + */ +public interface FormatService extends IService { + +} diff --git a/air/src/main/java/com/air/service/HousesService.java b/air/src/main/java/com/air/housing/service/HousesService.java similarity index 73% rename from air/src/main/java/com/air/service/HousesService.java rename to air/src/main/java/com/air/housing/service/HousesService.java index 8b4b709..6132b35 100644 --- a/air/src/main/java/com/air/service/HousesService.java +++ b/air/src/main/java/com/air/housing/service/HousesService.java @@ -1,6 +1,6 @@ -package com.air.service; +package com.air.housing.service; -import com.air.entity.Houses; +import com.air.housing.entity.Houses; import com.baomidou.mybatisplus.extension.service.IService; /** 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 59b9894..eb8310b 100644 --- a/air/src/main/java/com/air/housing/service/HousingEstatesService.java +++ b/air/src/main/java/com/air/housing/service/HousingEstatesService.java @@ -1,5 +1,6 @@ package com.air.housing.service; +import com.air.housing.dto.HousingDefine; import com.air.housing.entity.HousingEstates; import com.air.housing.vo.HousingEstatesName; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -20,4 +21,15 @@ public interface HousingEstatesService extends IService { * @return */ IPage getHousingEstatesNamePage(IPage page, String name); + + /** + * 提交楼盘定义信息 + * 根据前端提交的“楼盘id”(housingEstateId)字段是否为空来进行逻辑分支: + * 如果housingEstateId不为空,根据前端传入的blockId,将blocks_origin表对应的字段,复制写入blocks表并新增主键,将houses_origin表中blokcId对应的数据,全部复制写入houses表,并新增主键,blocks_origin表的housing_estate_id字段为前端传入的housingEstateId,houses的block_id字段为复制时blocks表时的主键值; + * 如果housingEstateId为空,则新增一条housing_estates表记录,其余与上一步描述操作一致; + * 完成前两步逻辑之后,根据housingEstateId、前端传入的大业态、小业态标识,三个字段组合,确认format表中是否存在该组合数据,如果不存在则新增一条记录,如果已存在则不作处理,其余字段:业态首推时间、供应套数、供应面积、成交套数、成交面积等后续字段,遵循一定计算规则进行运算,该部分字段暂时不用理会。 + * @param housingDefine + * @return true + */ + boolean createFromOrigin(HousingDefine housingDefine); } diff --git a/air/src/main/java/com/air/housing/service/impl/FormatServiceImpl.java b/air/src/main/java/com/air/housing/service/impl/FormatServiceImpl.java new file mode 100644 index 0000000..898b825 --- /dev/null +++ b/air/src/main/java/com/air/housing/service/impl/FormatServiceImpl.java @@ -0,0 +1,18 @@ +package com.air.housing.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.air.housing.entity.Format; +import com.air.housing.mapper.FormatMapper; +import com.air.housing.service.FormatService; +import org.springframework.stereotype.Service; + +/** + * 业态信息 + * + * @author zeb + * @date 2021-06-09 09:13:16 + */ +@Service +public class FormatServiceImpl extends ServiceImpl implements FormatService { + +} diff --git a/air/src/main/java/com/air/service/impl/HousesServiceImpl.java b/air/src/main/java/com/air/housing/service/impl/HousesServiceImpl.java similarity index 64% rename from air/src/main/java/com/air/service/impl/HousesServiceImpl.java rename to air/src/main/java/com/air/housing/service/impl/HousesServiceImpl.java index 87fbdbd..92f2955 100644 --- a/air/src/main/java/com/air/service/impl/HousesServiceImpl.java +++ b/air/src/main/java/com/air/housing/service/impl/HousesServiceImpl.java @@ -1,8 +1,8 @@ -package com.air.service.impl; +package com.air.housing.service.impl; -import com.air.entity.Houses; -import com.air.mapper.HousesMapper; -import com.air.service.HousesService; +import com.air.housing.entity.Houses; +import com.air.housing.mapper.HousesMapper; +import com.air.housing.service.HousesService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; 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 face228..0b025c7 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,13 +1,29 @@ package com.air.housing.service.impl; +import com.air.entity.Blocks; +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.HousingEstatesService; import com.air.housing.vo.HousingEstatesName; +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.HousesService; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.cinderella.framework.common.data.mybatis.QueryPage; +import com.cinderella.framework.common.core.exception.BusinessException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; /** * 楼盘(小区) @@ -16,11 +32,85 @@ import org.springframework.stereotype.Service; * @date 2021-05-18 09:39:55 */ @Service +@Slf4j public class HousingEstatesServiceImpl extends ServiceImpl implements HousingEstatesService { + @Autowired + private BlocksOriginService blocksOriginService; + @Autowired + private BlocksService blocksService; + @Autowired + private HousesOriginService housesOriginService; + @Autowired + private HousesService housesService; + @Override public IPage getHousingEstatesNamePage(IPage page, String name) { return null; } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean createFromOrigin(HousingDefine housingDefine) { + if (housingDefine.getHousingEstatesId() == null) { + HousingEstates housingEstates = new HousingEstates(); + housingEstates.setFormat(housingDefine.getFormat()); + housingEstates.setLargeFormat(housingDefine.getLargeFormat()); + housingEstates.setPropertyType(housingDefine.getPropertyType()); + housingEstates.setName(housingDefine.getName()); + housingEstates.setAnnoId(housingDefine.getAnnoId()); + save(housingEstates); + housingDefine.setHousingEstatesId(housingEstates.getHousingEstatesId()); + } + if (housingDefine.getBlockId() == null) { + throw new BusinessException("blockId不存在"); + } + BlocksOrigin blocksOrigin = blocksOriginService.getById(housingDefine.getBlockId()); + if (blocksOrigin == null) { + throw new BusinessException("blockId不正确"); + } + copyBlocksOriginToBlocks(blocksOrigin, housingDefine); + + copyHousesOriginToHouses(housingDefine.getBlockId(), housingDefine); + return true; + } + + private void copyBlocksOriginToBlocks(BlocksOrigin blocksOrigin, HousingDefine housingDefine) { + Blocks blocks = new Blocks(); + blocks.setHousingEstatesId(housingDefine.getHousingEstatesId()); + blocks.setBlockName(housingDefine.getName()); + blocks.setPreSalePermitNo(blocksOrigin.getPreSaleLicenseNo()); + blocksService.save(blocks); + } + + private void copyHousesOriginToHouses(Long blockId, HousingDefine housingDefine) { + List origins = housesOriginService.list(Wrappers.query().lambda().eq(HousesOrigin::getBuildingId, blockId)); + if (origins.size() == 0) { + log.info("没有可复制的HousesOrigin,blockId={}", blockId); + return; + } + List housesList = new ArrayList<>(origins.size()); + origins.forEach(housesOrigin -> { + Houses houses = new Houses(); + houses.setBlockId(housingDefine.getBlockId()); + houses.setCoveredArea(housesOrigin.getCoveredArea()); + houses.setCoveredPrice(housesOrigin.getCoveredPrice()); + houses.setHouseNo(housesOrigin.getHouseNo()); + houses.setHouseType(housesOrigin.getHouseType()); + houses.setHouseUsage(housesOrigin.getHouseUsage()); + houses.setNetSignDate(housesOrigin.getNetSignDate()); + houses.setNetSignStatus(housesOrigin.getNetSignStatus()); + houses.setSaleDate(housesOrigin.getSaleDate()); + houses.setSaleDate(housesOrigin.getSaleDate()); + houses.setSleeveArea(housesOrigin.getSleeveArea()); + houses.setSleevePrice(housesOrigin.getSleevePrice()); + houses.setHouseNo(housesOrigin.getHouseNo()); + houses.setSubscribeStatus(housesOrigin.getSubscribeStatus()); + houses.setSubscribeDate(housesOrigin.getSubscribeDate()); + houses.setUnitNum(housesOrigin.getUnitNum()); + housesList.add(houses); + }); + housesService.saveBatch(housesList); + } } diff --git a/air/src/main/java/com/air/origin/entity/HousesOrigin.java b/air/src/main/java/com/air/origin/entity/HousesOrigin.java index ff785ba..680c8cf 100644 --- a/air/src/main/java/com/air/origin/entity/HousesOrigin.java +++ b/air/src/main/java/com/air/origin/entity/HousesOrigin.java @@ -1,5 +1,6 @@ package com.air.origin.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; @@ -7,8 +8,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; + import java.math.BigDecimal; -import java.io.Serializable; import java.time.LocalDateTime; /** @@ -22,69 +23,70 @@ import java.time.LocalDateTime; @EqualsAndHashCode(callSuper = true) @ApiModel(value = "房屋信息") public class HousesOrigin extends Model { -private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @TableId - @ApiModelProperty(value="房屋id") + @TableId + @ApiModelProperty(value = "房屋id") private Long houseId; - @ApiModelProperty(value="楼栋id") + @ApiModelProperty(value = "楼栋id") private Long buildingId; - @ApiModelProperty(value="房籍号") + @ApiModelProperty(value = "房籍号") + @TableField(value = "house_u_no") private String houseUNo; - @ApiModelProperty(value="楼层") + @ApiModelProperty(value = "楼层") private String floor; - @ApiModelProperty(value="房间号") + @ApiModelProperty(value = "房间号") private String houseNo; - @ApiModelProperty(value="套内面积") + @ApiModelProperty(value = "套内面积") private BigDecimal sleeveArea; - @ApiModelProperty(value="建筑面积") + @ApiModelProperty(value = "建筑面积") private BigDecimal coveredArea; - @ApiModelProperty(value="公摊面积") + @ApiModelProperty(value = "公摊面积") private BigDecimal residentialPoolArea; - @ApiModelProperty(value="结构") + @ApiModelProperty(value = "结构") private String buildingStruct; - @ApiModelProperty(value="户型") + @ApiModelProperty(value = "户型") private String houseType; - @ApiModelProperty(value="使用用途") - private BigDecimal houseUsage; - @ApiModelProperty(value="单元户数") - private String unitNum; - @ApiModelProperty(value="位置") + @ApiModelProperty(value = "使用用途") + private String houseUsage; + @ApiModelProperty(value = "单元户数") + private Integer unitNum; + @ApiModelProperty(value = "位置") private String housePosition; - @ApiModelProperty(value="房产性质") + @ApiModelProperty(value = "房产性质") private String houseNature; - @ApiModelProperty(value="拟售单价(套内)") + @ApiModelProperty(value = "拟售单价(套内)") private BigDecimal sleevePrice; - @ApiModelProperty(value="拟售单价(建面)") + @ApiModelProperty(value = "拟售单价(建面)") private BigDecimal coveredPrice; - @ApiModelProperty(value="市场状态") + @ApiModelProperty(value = "市场状态") private String marketState; - @ApiModelProperty(value="销售状态") + @ApiModelProperty(value = "销售状态") private String saleStatus; - @ApiModelProperty(value="销售状态日期") + @ApiModelProperty(value = "销售状态日期") private LocalDateTime saleDate; - @ApiModelProperty(value="认购状态") + @ApiModelProperty(value = "认购状态") private String subscribeStatus; - @ApiModelProperty(value="认购状态日期") + @ApiModelProperty(value = "认购状态日期") private LocalDateTime subscribeDate; - @ApiModelProperty(value="网签状态") + @ApiModelProperty(value = "网签状态") private String netSignStatus; - @ApiModelProperty(value="网签状态日期") + @ApiModelProperty(value = "网签状态日期") private LocalDateTime netSignDate; - @ApiModelProperty(value="状态") + @ApiModelProperty(value = "状态") private String statusCd; - @ApiModelProperty(value="状态时间") + @ApiModelProperty(value = "状态时间") private LocalDateTime statusDate; - @ApiModelProperty(value="创建人") + @ApiModelProperty(value = "创建人") private String createUserId; - @ApiModelProperty(value="创建时间") + @ApiModelProperty(value = "创建时间") private LocalDateTime createDate; - @ApiModelProperty(value="修改人") + @ApiModelProperty(value = "修改人") private String updateUserId; - @ApiModelProperty(value="修改时间") + @ApiModelProperty(value = "修改时间") private LocalDateTime updateDate; - @ApiModelProperty(value="备注") + @ApiModelProperty(value = "备注") private String remark; - @ApiModelProperty(value="爬虫数据id,更新比对") + @ApiModelProperty(value = "爬虫数据id,更新比对") private String dataId; - } +} diff --git a/air/src/main/resources/mapper/FormatMapper.xml b/air/src/main/resources/mapper/FormatMapper.xml new file mode 100644 index 0000000..33c34ee --- /dev/null +++ b/air/src/main/resources/mapper/FormatMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/air/src/main/resources/mapper/HousesMapper.xml b/air/src/main/resources/mapper/HousesMapper.xml index aef43eb..27b5945 100644 --- a/air/src/main/resources/mapper/HousesMapper.xml +++ b/air/src/main/resources/mapper/HousesMapper.xml @@ -2,6 +2,6 @@ - + diff --git a/air/src/main/resources/mapper/HousingEstatesMapper.xml b/air/src/main/resources/mapper/HousingEstatesMapper.xml index ad82b47..a7e19db 100644 --- a/air/src/main/resources/mapper/HousingEstatesMapper.xml +++ b/air/src/main/resources/mapper/HousingEstatesMapper.xml @@ -4,4 +4,7 @@ +