Browse Source

修改处理楼盘数据问题

feature/v.2.0.0
caoyizhong 3 years ago
parent
commit
702ed82feb
  1. 2
      air/src/main/java/com/air/housing/controller/HousingEstatesController.java
  2. 3
      air/src/main/java/com/air/housing/dto/HousingEstatesListDto.java
  3. 29
      air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java
  4. 3
      air/src/main/resources/mapper/HousingEstatesMapper.xml

2
air/src/main/java/com/air/housing/controller/HousingEstatesController.java

@ -55,7 +55,7 @@ public class HousingEstatesController {
}
@GetMapping("/page/housing_names/name")
// @GetMapping("/page/housing_names/name")
@ApiOperation(value = "查询楼盘名称")
public R<List<HousingEstatesName>> getHousingEstatesNamePage( String name) {
return R.ok(housingEstatesService.getHousingEstatesName( name));

3
air/src/main/java/com/air/housing/dto/HousingEstatesListDto.java

@ -17,6 +17,9 @@ public class HousingEstatesListDto {
@ApiModelProperty(value = "楼盘id")
private Long housingEstateId;
@ApiModelProperty(value = "公告ID")
private String annoId;
@ApiModelProperty(value = "楼盘名称")
private String name;

29
air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java

@ -273,7 +273,7 @@ public class HousingEstatesServiceImpl extends ServiceImpl<HousingEstatesMapper,
blocks.setPreSalePermitNo(blocksOrigin.getPreSaleLicenseNo());
blocks.setStatusCd(Constant.COMMON_STATUS_1000);
blocksService.save(blocks);
copyHousesOriginToHouses(housingDefine.getBlockId(), blocks.getBlockId() ,formatId);
copyHousesOriginToHouses(housingDefine.getBlockId(), blocks.getBlockId() ,formatId,blocksOrigin.getPosition() );
}
/**
@ -281,11 +281,32 @@ public class HousingEstatesServiceImpl extends ServiceImpl<HousingEstatesMapper,
* @param originBlockId 楼栋ID
* @param blockId 楼栋楼盘业态ID
*/
private void copyHousesOriginToHouses(Long originBlockId, Long blockId,Long formatId) {
List<HousesOrigin> origins = housesOriginService.list(Wrappers.<HousesOrigin>query().lambda().eq(HousesOrigin::getBuildingId, originBlockId));//查询和楼栋关联的房间
private void copyHousesOriginToHouses(Long originBlockId, Long blockId,Long formatId,String position) {
//截取_之前字符串
String str1 = position.substring(0, position.indexOf("区")+1);
boolean b = position.contains("镇");
if(b){
str1 = position.substring(0, position.indexOf("镇")+1);
}
boolean c = position.contains("路");
if(c){
str1 = position.substring(0, position.indexOf("路")+1);
}
//截取_之后字符串
boolean a = position.contains("市");
if(a){
String str2 = position.substring(0, position.indexOf("市"));
str1 = position.substring(str2.length(), position.substring(0, position.indexOf("区")).length()+1);
}
log.info("查询房屋的地址为{}",str1);
List<HousesOrigin> origins = housesOriginService.list(Wrappers.<HousesOrigin>query().lambda()
.eq(HousesOrigin::getBuildingId, originBlockId)
.like(HousesOrigin::getHousePosition,str1)
);//查询和楼栋关联的房间
if (origins.size() == 0) {
log.info("没有可复制的HousesOrigin,blockId={}", originBlockId);
return;
throw new BusinessException("没有查询到房屋信息");
}
List<Houses> housesList = new ArrayList<>(origins.size());
List<HousesOrigin> housesOriginList = new ArrayList<>(); //

3
air/src/main/resources/mapper/HousingEstatesMapper.xml

@ -32,7 +32,8 @@
l.partner,
l.conduct_enterprise,
l.big_group,
l.small_group
l.small_group,
l.anno_id
FROM
housing_estates h
JOIN anno_blocks_rel an ON h.housing_estate_id = an.housing_estates_id and an.main_land = 1

Loading…
Cancel
Save