|
|
|
@ -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<>(); //
|
|
|
|
|