This commit is contained in:
2023-06-13 18:19:19 +08:00
90 changed files with 6309 additions and 1508 deletions
@@ -769,6 +769,7 @@ public class DataController {
outfields.add("districtsHasLoudong"); outfields.add("districtsHasLoudong");
outfields.add("districtsHasFanghao"); outfields.add("districtsHasFanghao");
outfields.add("priceCoverage"); outfields.add("priceCoverage");
outfields.add("districtAliasTotalCount");
outfields.add("priceCreditGte80Coverage"); outfields.add("priceCreditGte80Coverage");
outfields.add("priceCreditGte66Coverage"); outfields.add("priceCreditGte66Coverage");
outfields.add("priceCreditGte60Coverage"); outfields.add("priceCreditGte60Coverage");
@@ -801,6 +802,7 @@ public class DataController {
map.put("districtsHasLoudong", cityInfo.getDistrictsHasLoudong() == null ? 0 : cityInfo.getDistrictsHasLoudong()); map.put("districtsHasLoudong", cityInfo.getDistrictsHasLoudong() == null ? 0 : cityInfo.getDistrictsHasLoudong());
map.put("districtsHasFanghao", cityInfo.getDistrictsHasFanghao() == null ? 0 : cityInfo.getDistrictsHasFanghao()); map.put("districtsHasFanghao", cityInfo.getDistrictsHasFanghao() == null ? 0 : cityInfo.getDistrictsHasFanghao());
map.put("priceCoverage", cityInfo.getPriceCoverage()); map.put("priceCoverage", cityInfo.getPriceCoverage());
map.put("districtAliasTotalCount", cityInfo.getDistrictAliasTotalCount());
map.put("priceCreditGte80Coverage", cityInfo.getPriceCreditGte80Coverage()); map.put("priceCreditGte80Coverage", cityInfo.getPriceCreditGte80Coverage());
map.put("priceCreditGte66Coverage", cityInfo.getPriceCreditGte66Coverage()); map.put("priceCreditGte66Coverage", cityInfo.getPriceCreditGte66Coverage());
map.put("priceCreditGte60Coverage", cityInfo.getPriceCreditGte60Coverage()); map.put("priceCreditGte60Coverage", cityInfo.getPriceCreditGte60Coverage());
@@ -922,6 +924,7 @@ public class DataController {
put( "cubagePercent" , "容积率" ); put( "cubagePercent" , "容积率" );
put( "virescencePercent" , "绿化率" ); put( "virescencePercent" , "绿化率" );
put( "carSite" , "停车位" ); put( "carSite" , "停车位" );
put( "carSiteCount" , "停车位描述" );
put( "estateCharge" , "物业费" ); put( "estateCharge" , "物业费" );
put( "floorplanPics" , "楼层平面图" ); put( "floorplanPics" , "楼层平面图" );
put( "outPics" , "外景图" ); put( "outPics" , "外景图" );
@@ -949,7 +952,6 @@ public class DataController {
put( "liveDate","开业时间"); put( "liveDate","开业时间");
put( "divisible","是否可分割"); put( "divisible","是否可分割");
put( "unifiedManage","是否统一管理"); put( "unifiedManage","是否统一管理");
put( "carSiteCount","车位数量");
put( "metroInfo","地铁沿线"); put( "metroInfo","地铁沿线");
put( "metroNames","地铁站名"); put( "metroNames","地铁站名");
put( "facilities","配套设施"); put( "facilities","配套设施");
@@ -996,6 +998,41 @@ public class DataController {
put("committee","居委会"); put("committee","居委会");
put("schools","对口学校"); put("schools","对口学校");
put("houseStructure","房屋结构"); put("houseStructure","房屋结构");
put("estateType2","物业类型");
put("buildDate","建筑年代");
put("alias","别名");
put("addrAlias","地址别名");
put("mainTypeArea","主力面积");
put("loudongCount","楼栋数");
put("township","乡镇街道");
put("schools","对口小学");
put("kindergartens","对口幼儿园");
put("elevator","电梯");
put("landProperty","权属类别");
put("usageCard","土地使用权证号");
put("landUsageStart","土地使用年限");
put("occupancyRate","入住率");
put("mainType","主力户型");
put("mappingAlias","映射别名");
put("districtAliasTotalCount", "别名总量");
put("undergroundCarSite", "地下车位数");
put("landCarSite", "地上车位数");
put("parkingFee", "车位月租金");
put("sight", "开间面积");
put("lobbyHeight", "大堂层高");
put("standardHeight", "标准层高");
put("clearHeight", "净高");
put("standardArea", "标准层面积");
put("foreign", "是否涉外");
put("register", "是否可注册");
put("divisible", "是否可分割");
put("elevatorsCount","电梯数量");
put("personElevatorsCount","客梯数");
put("goodsElevatorCount","货梯数");
put("realUsePercent","得房率");
put("landFloor","地上层数");
put("undergroundFloor","地下层数");
} };// } };//
return map; return map;
} }
@@ -756,6 +756,7 @@ public class District2Controller {
data.put("carSiteCount", district.getCarSiteCount()); data.put("carSiteCount", district.getCarSiteCount());
data.put("modificationDate", new Date()); data.put("modificationDate", new Date());
data.put("publisherType", 11); data.put("publisherType", 11);
data.put("township", district.getTownship());
data.put("businessQuarter", district.getBusinessQuarter()); data.put("businessQuarter", district.getBusinessQuarter());
@@ -811,6 +812,9 @@ public class District2Controller {
data.put("landCarSite", district.getLandCarSite()); data.put("landCarSite", district.getLandCarSite());
data.put("undergroundCarSite", district.getUndergroundCarSite()); data.put("undergroundCarSite", district.getUndergroundCarSite());
data.put("landFloor", district.getLandFloor());
data.put("undergroundFloor", district.getUndergroundFloor());
data.put("clearHeight", district.getClearHeight()); data.put("clearHeight", district.getClearHeight());
data.put("standardHeight", district.getStandardHeight()); data.put("standardHeight", district.getStandardHeight());
data.put("standardArea", district.getStandardArea()); data.put("standardArea", district.getStandardArea());
@@ -828,10 +832,10 @@ public class District2Controller {
}else if(district.getCategory().equals("shop")){ }else if(district.getCategory().equals("shop")){
data.put("propertyStatus", district.getPropertyStatus()); data.put("propertyStatus", district.getPropertyStatus());
data.put("shopEstateType2", district.getShopEstateType2()); data.put("shopEstateType2", district.getShopEstateType2());
data.put("landFloor", district.getLandFloor());
data.put("undergroundFloor", district.getUndergroundFloor());
data.put("realUsePercent", district.getRealUsePercent());
} }
districtService.updateById(data, district.getId()); districtService.updateById(data, district.getId());
msg="保存成功!"; msg="保存成功!";
} }
@@ -76,8 +76,8 @@
<tr> <tr>
<td>入住时间</td> <td>入住时间</td>
<td class="v"><#if disDetail.openDate??>${disDetail.openDate * 100}%<#else>未知</#if></td> <td class="v"><#if disDetail.openDate??>${disDetail.openDate * 100}%<#else>未知</#if></td>
<td>入住率</td> <td>别名</td>
<td class="v">&nbsp;</td> <td class="v"><#if disDetail.alias??>${disDetail.alias * 100}%<#else>未知</#if></td>
<td>经纬度-mapabc</td> <td>经纬度-mapabc</td>
<td class="v"><#if disDetail.latLng??>${disDetail.latLng * 100}%<#else>未知</#if></td> <td class="v"><#if disDetail.latLng??>${disDetail.latLng * 100}%<#else>未知</#if></td>
<td>经纬度-百度</td> <td>经纬度-百度</td>
@@ -106,12 +106,12 @@
<tr> <tr>
<td>物业费</td> <td>物业费</td>
<td class="v"><#if disDetail.estateCharge??>${disDetail.estateCharge * 100}%<#else>未知</#if></td> <td class="v"><#if disDetail.estateCharge??>${disDetail.estateCharge * 100}%<#else>未知</#if></td>
<td>外景图</td> <td>竣工时间</td>
<td class="v"><#if disDetail.outPics??>${disDetail.outPics * 100}%<#else>未知</#if></td> <td class="v"><#if disDetail.finishBuildingDate??>${disDetail.finishBuildingDate * 100}%<#else>未知</#if></td>
<td></td> <td>建筑年代</td>
<td class="v"></td> <td class="v"><#if disDetail.buildDate??>${disDetail.buildDate * 100}%<#else>未知</#if></td>
<td>&nbsp;</td> <td>主力面积</td>
<td class="v">&nbsp;</td> <td class="v"><#if disDetail.mainTypeArea??>${disDetail.mainTypeArea * 100}%<#else>未知</#if></td>
</tr> </tr>
</table> </table>
@@ -285,7 +285,7 @@ $(document).ready(function(){
'租金', '租金',
'户数', '户数',
'入住时间', '入住时间',
'入住率', '别名',
'经纬度-mapabc', '经纬度-mapabc',
'经纬度-百度', '经纬度-百度',
'占地面积', '占地面积',
@@ -297,8 +297,8 @@ $(document).ready(function(){
'绿化率', '绿化率',
'停车位', '停车位',
'物业费', '物业费',
'房型图', '竣工时间',
'外景图' '主力面积'
], ],
labels: { labels: {
rotation: -45, rotation: -45,
@@ -328,14 +328,14 @@ $(document).ready(function(){
<#if disDetail.block??>${disDetail.block * 100}<#else>0</#if>, <#if disDetail.address??>${disDetail.address * 100}<#else>0</#if>, <#if disDetail.block??>${disDetail.block * 100}<#else>0</#if>, <#if disDetail.address??>${disDetail.address * 100}<#else>0</#if>,
<#if disDetail.estateType2??>${disDetail.estateType2 * 100}<#else>0</#if>, <#if cityInfo.priceCoverage??>${cityInfo.priceCoverage * 100}<#else>0</#if>, <#if disDetail.estateType2??>${disDetail.estateType2 * 100}<#else>0</#if>, <#if cityInfo.priceCoverage??>${cityInfo.priceCoverage * 100}<#else>0</#if>,
<#if disDetail.rentPrice??>${disDetail.rentPrice * 100}<#else>0</#if>, <#if disDetail.householdCount??>${disDetail.householdCount * 100}<#else>0</#if>, <#if disDetail.rentPrice??>${disDetail.rentPrice * 100}<#else>0</#if>, <#if disDetail.householdCount??>${disDetail.householdCount * 100}<#else>0</#if>,
<#if disDetail.openDate??>${disDetail.openDate * 100}<#else>0</#if>, 0, <#if disDetail.openDate??>${disDetail.openDate * 100}<#else>0</#if>, <#if disDetail.alias??>${disDetail.alias * 100}<#else>0</#if>,
<#if disDetail.latLng??>${disDetail.latLng * 100}<#else>0</#if>, <#if disDetail.latLng2??>${disDetail.latLng2 * 100}<#else>0</#if>, <#if disDetail.latLng??>${disDetail.latLng * 100}<#else>0</#if>, <#if disDetail.latLng2??>${disDetail.latLng2 * 100}<#else>0</#if>,
<#if disDetail.allArea??>${disDetail.allArea * 100}<#else>0</#if>, <#if disDetail.buildArea??>${disDetail.buildArea * 100}<#else>0</#if>, <#if disDetail.allArea??>${disDetail.allArea * 100}<#else>0</#if>, <#if disDetail.buildArea??>${disDetail.buildArea * 100}<#else>0</#if>,
<#if disDetail.buildType??>${disDetail.buildType * 100}<#else>0</#if>, <#if disDetail.developer??>${disDetail.developer * 100}<#else>0</#if>, <#if disDetail.buildType??>${disDetail.buildType * 100}<#else>0</#if>, <#if disDetail.developer??>${disDetail.developer * 100}<#else>0</#if>,
<#if disDetail.estateCompany??>${disDetail.estateCompany * 100}<#else>0</#if>, <#if disDetail.cubagePercent??>${disDetail.cubagePercent * 100}<#else>0</#if>, <#if disDetail.estateCompany??>${disDetail.estateCompany * 100}<#else>0</#if>, <#if disDetail.cubagePercent??>${disDetail.cubagePercent * 100}<#else>0</#if>,
<#if disDetail.virescencePercent??>${disDetail.virescencePercent * 100}<#else>0</#if>, <#if disDetail.carSite??>${disDetail.carSite * 100}<#else>0</#if>, <#if disDetail.virescencePercent??>${disDetail.virescencePercent * 100}<#else>0</#if>, <#if disDetail.carSite??>${disDetail.carSite * 100}<#else>0</#if>,
<#if disDetail.estateCharge??>${disDetail.estateCharge * 100}<#else>0</#if>, <#if disDetail.floorplanPics??>${disDetail.floorplanPics * 100}<#else>0</#if>, <#if disDetail.estateCharge??>${disDetail.estateCharge * 100}<#else>0</#if>, <#if disDetail.finishBuildingDate??>${disDetail.finishBuildingDate * 100}<#else>0</#if>,
<#if disDetail.outPics??>${disDetail.outPics * 100}<#else>0</#if>], <#if disDetail.mainTypeArea??>${disDetail.mainTypeArea * 100}<#else>0</#if>],
dataLabels: { dataLabels: {
enabled: true, enabled: true,
rotation: -90, rotation: -90,
@@ -257,10 +257,9 @@
<input type="checkbox" name="build_type_t" value="小高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("小高层")>checked</#if>> 小高层&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="小高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("小高层")>checked</#if>> 小高层&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("高层")>checked</#if>> 高层&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("高层")>checked</#if>> 高层&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="超高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("超高层")>checked</#if>> 超高层&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="超高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("超高层")>checked</#if>> 超高层&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="独栋" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("独栋")>checked</#if>> 独栋&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="SOHO" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("SOHO")>checked</#if>> SOHO&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="双拼" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("双拼")>checked</#if>> 双拼&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="LOFT" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("LOFT")>checked</#if>> LOFT&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="联排" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("联排")>checked</#if>> 联排&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="酒店式公寓" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("酒店式公寓")>checked</#if>> 酒店式公寓&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="叠加" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("叠加")>checked</#if>> 叠加&nbsp;&nbsp;
</div> </div>
</td> </td>
@@ -704,6 +703,7 @@ $(document).ready(function(){
success: function(model) { success: function(model) {
$("#block option").remove(); $("#block option").remove();
if (model.blockList.length > 0) { if (model.blockList.length > 0) {
$("<option value=''></option>").appendTo($("#block"));
$.each(model.blockList, function(i, block){ $.each(model.blockList, function(i, block){
$("<option value='" + block + "'>" + block + "</option>").appendTo($("#block")); $("<option value='" + block + "'>" + block + "</option>").appendTo($("#block"));
}); });
@@ -245,19 +245,33 @@
<input name="district.estateType" type="text" value="${district.estateType!}" /> (住宅、公寓、独栋别墅、联排别墅、双拼别墅...) <input name="district.estateType" type="text" value="${district.estateType!}" /> (住宅、公寓、独栋别墅、联排别墅、双拼别墅...)
</td> </td>
</tr>--> </tr>-->
<tr id="tr_block"> <#-- <tr id="tr_block">-->
<#-- <td class = "t1">-->
<#-- <#if markMap?? && markMap["block"]?? && markMap["block"]?is_number && markMap["block"] == 1>-->
<#-- <i class="lock" name="block"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="block"></i>-->
<#-- </#if>-->
<#-- 板块</td>-->
<#-- <td>-->
<#-- <select id="block" name="district.block">-->
<#-- </select>-->
<#-- </td>-->
<#-- </tr>-->
<tr>
<td class = "t1"> <td class = "t1">
<#if markMap?? && markMap["block"]?? && markMap["block"]?is_number && markMap["block"] == 1> <#if markMap?? && markMap["block"]?? && markMap["block"]?is_number && markMap["block"] == 1>
<i class="lock" name="block"></i> <i class="lock" name="block"></i>
<#else> <#else>
<i class="unlock" name="block"></i> <i class="unlock" name="block"></i>
</#if> </#if>
板块</td> 板块</td>
<td> <td>
<select id="block" name="district.block"> <input name="district.block" type="text" style="width:300px" value="${district.block!}" />
</select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class = "t1"> <td class = "t1">
<#if markMap?? && markMap["loop_line_info"]?? && markMap["loop_line_info"]?is_number && markMap["loop_line_info"] == 1> <#if markMap?? && markMap["loop_line_info"]?? && markMap["loop_line_info"]?is_number && markMap["loop_line_info"] == 1>
@@ -314,15 +328,15 @@
<input type="checkbox" name="build_type_t" value="叠加" <#if buildTypes?? && district.estateType2?? && district.estateType2=='别墅'&& buildTypes?seq_contains("叠加")>checked</#if>> 叠加&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="叠加" <#if buildTypes?? && district.estateType2?? && district.estateType2=='别墅'&& buildTypes?seq_contains("叠加")>checked</#if>> 叠加&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="老式别墅洋房" <#if buildTypes?? && district.estateType2?? && district.estateType2=='别墅'&& buildTypes?seq_contains("老式别墅洋房")>checked</#if>> 老式别墅洋房&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="老式别墅洋房" <#if buildTypes?? && district.estateType2?? && district.estateType2=='别墅'&& buildTypes?seq_contains("老式别墅洋房")>checked</#if>> 老式别墅洋房&nbsp;&nbsp;
</div> </div>
<div id="shopId" style="<#if district.estateType2?? && (district.estateType2=='别墅'||district.estateType2=='普通住宅')>display:none;</#if>"> <div id="shopId" style="<#if district.estateType2?? && (district.estateType2=='别墅'||district.estateType2=='普通住宅')>display:none;</#if>">
<input type="checkbox" name="build_type_t" value="多层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("多层")>checked</#if> > 多层&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="多层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("多层")>checked</#if> > 多层&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="小高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("小高层")>checked</#if>> 小高层&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="小高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("小高层")>checked</#if>> 小高层&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("高层")>checked</#if>> 高层&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("高层")>checked</#if>> 高层&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="超高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("超高层")>checked</#if>> 超高层&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="超高层" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("超高层")>checked</#if>> 超高层&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="独栋" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("独栋")>checked</#if>> 独栋&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="SOHO" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("SOHO")>checked</#if>> SOHO
<input type="checkbox" name="build_type_t" value="双拼" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("双拼")>checked</#if>> 双拼&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="LOFT" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("LOFT")>checked</#if>> LOFT&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="联排" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("联排")>checked</#if>> 联排&nbsp;&nbsp; <input type="checkbox" name="build_type_t" value="酒店式公寓" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("酒店式公寓")>checked</#if>> 酒店式公寓&nbsp;&nbsp;
<input type="checkbox" name="build_type_t" value="叠加" <#if buildTypes?? && district.estateType2?? && district.estateType2=='商住'&& buildTypes?seq_contains("叠加")>checked</#if>> 叠加&nbsp;&nbsp;
</div> </div>
</td> </td>
@@ -25,7 +25,7 @@
<input type="hidden" name="district.category" value="shop" /> <input type="hidden" name="district.category" value="shop" />
<table class = "saveTable"> <table class = "saveTable">
<tr> <tr>
<td class = "t1">类型<font color="red">*</font></td> <td class = "t1" style="width: 150px;">类型<font color="red">*</font></td>
<td> <td>
商铺 商铺
</td> </td>
@@ -123,46 +123,52 @@
<option value="商场商铺">商场商铺</option> <option value="商场商铺">商场商铺</option>
</select> </select>
</td> </td>
</tr>
<tr>
<td class="bg">二级分类</td>
<td>
<input type="checkbox" name="district.shopEstateType2" value="商务区商铺"/>商务区商铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="交通设施商铺"/>交通设施商铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="市场类商铺"/>市场类商铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="社区内铺"/>社区内铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="住宅底商"/>住宅底商&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="百货购物中心商铺"/>百货购物中心商铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="商业综合体"/>商业综合体&nbsp;&nbsp;
</td>
</tr> </tr>
<tr> <tr>
<td class="bg">建筑状态</td> <td class="bg">乡镇街道</td>
<td> <td>
<input name="district.propertyStatus" type="text" style="width:300px" value="" /> <input name="district.township" type="text" style="width:300px" value="" />
</td> </td>
</tr> </tr>
<#-- <tr>-->
<#-- <td class="bg">二级分类</td>-->
<#-- <td>-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="商务区商铺"/>商务区商铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="交通设施商铺"/>交通设施商铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="市场类商铺"/>市场类商铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="社区内铺"/>社区内铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="住宅底商"/>住宅底商&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="百货购物中心商铺"/>百货购物中心商铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="商业综合体"/>商业综合体&nbsp;&nbsp;-->
<#-- -->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="bg">建筑状态</td>-->
<#-- <td>-->
<#-- <input name="district.propertyStatus" type="text" style="width:300px" value="" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="bg">租售类型</td>-->
<#-- <td>-->
<#-- <input name="district.rentType" type="text" style="width:300px" value="" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="bg">租赁年限</td>-->
<#-- <td>-->
<#-- <input name="district.leaseTerm" type="text" style="width:300px" value="" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="bg">付款方式</td>-->
<#-- <td>-->
<#-- <input name="district.paymentPattern" type="text" style="width:300px" value="" />-->
<#-- </td>-->
<#-- </tr>-->
<tr> <tr>
<td class="bg">租售类型</td> <td class="t1" style="width: 150px;">停车位数</td>
<td>
<input name="district.rentType" type="text" style="width:300px" value="" />
</td>
</tr>
<tr>
<td class="bg">租赁年限</td>
<td>
<input name="district.leaseTerm" type="text" style="width:300px" value="" />
</td>
</tr>
<tr>
<td class="bg">付款方式</td>
<td>
<input name="district.paymentPattern" type="text" style="width:300px" value="" />
</td>
</tr>
<tr>
<td class="t1">停车位数</td>
<td> <td>
<input name="district.carSiteCount" type="text" style="width:300px" value="" onkeydown="return justPositiveInteger(this,event);"/>个 <input name="district.carSiteCount" type="text" style="width:300px" value="" onkeydown="return justPositiveInteger(this,event);"/>个
</td> </td>
@@ -203,6 +209,19 @@
<input name="district.floorInfo" type="text" style="width:300px" value="" onkeydown="return justPositiveInteger(this,event);"/>层 <input name="district.floorInfo" type="text" style="width:300px" value="" onkeydown="return justPositiveInteger(this,event);"/>层
</td> </td>
</tr> </tr>
<tr>
<td class="t1">地上层数</td>
<td>
<input name="district.land_floor" type="text" style="width:300px" value="" />层
</td>
</tr>
<tr>
<td class="t1">地下层数</td>
<td>
<input name="district.underground_floor" type="text" style="width:300px" value="" />层
</td>
</tr>
<tr> <tr>
<td class="t1">占地面积</td> <td class="t1">占地面积</td>
<td> <td>
@@ -251,71 +270,71 @@
<input name="district.estateCompany" type="text" style="width:300px" value="" /> <input name="district.estateCompany" type="text" style="width:300px" value="" />
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class="bg">是否可分割</td> <#-- <td class="bg">是否可分割</td>-->
<td> <#-- <td>-->
<input name="district.sideset" type="text" style="width:300px" value="" /> <#-- <input name="district.sideset" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">是否统一管理</td> <#-- <td class="bg">是否统一管理</td>-->
<td> <#-- <td>-->
<select name="district.unifiedManage" class="inp1"> <#-- <select name="district.unifiedManage" class="inp1">-->
<option value="">请选择</option> <#-- <option value="">请选择</option>-->
<option value="0">是</option> <#-- <option value="0">是</option>-->
<option value="1">否</option> <#-- <option value="1">否</option>-->
</select> <#-- </select>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">地铁沿线</td> <#-- <td class="bg">地铁沿线</td>-->
<td> <#-- <td>-->
<input name="district.metroInfo" type="text" style="width:300px" value="" /> <#-- <input name="district.metroInfo" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">地铁站名</td> <#-- <td class="bg">地铁站名</td>-->
<td> <#-- <td>-->
<input name="district.metroNames" type="text" style="width:300px" value="" /> <#-- <input name="district.metroNames" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">装修情况</td> <#-- <td class="bg">装修情况</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.fitment" style="width:400px;height:200px;"></textarea> <#-- <textarea alias="richarea" name="district.fitment" style="width:400px;height:200px;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">物业概况</td> <#-- <td class="bg">物业概况</td>-->
<td> <#-- <td>-->
<textarea name="district.propertyInfo" type="text" style="width:300px;height:auto;"></textarea> <#-- <textarea name="district.propertyInfo" type="text" style="width:300px;height:auto;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">交通情况</td> <#-- <td class="bg">交通情况</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.traffic" type="text" style="width:300px;height:auto;"></textarea> <#-- <textarea alias="richarea" name="district.traffic" type="text" style="width:300px;height:auto;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">周边情况</td> <#-- <td class="bg">周边情况</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.surrounding" type="text" style="width:300px;height:auto;"></textarea> <#-- <textarea alias="richarea" name="district.surrounding" type="text" style="width:300px;height:auto;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">配套设施</td> <#-- <td class="bg">配套设施</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.facilities" type="text" style="width:300px;height:auto;"></textarea> <#-- <textarea alias="richarea" name="district.facilities" type="text" style="width:300px;height:auto;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1">描述</td> <#-- <td class = "t1">描述</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.description" style="width:700px;height:300px;"></textarea> <#-- <textarea alias="richarea" name="district.description" style="width:700px;height:300px;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class="bg">经营业态</td> <td class="bg">经营业态</td>
<td> <td>
@@ -323,11 +342,17 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="bg">项目特色</td> <td class = "bg">得房率</td>
<td> <td>
<input name="district.characteristic" type="text" style="width:300px" value="" /> <input name="district.realUsePercent" type="text" style="width:300px"/>
</td> </td>
</tr> </tr>
<#-- <tr>-->
<#-- <td class="bg">项目特色</td>-->
<#-- <td>-->
<#-- <input name="district.characteristic" type="text" style="width:300px" value="" />-->
<#-- </td>-->
<#-- </tr>-->
<tr> <tr>
<td colspan="2" > <td colspan="2" >
@@ -156,36 +156,43 @@
<input name="district.businessQuarter" type="text" style="width:300px" value="" /> <input name="district.businessQuarter" type="text" style="width:300px" value="" />
</td> </td>
</tr> </tr>
<tr>
<td class="bg">乡镇街道</td>
<td>
<input name="district.township" type="text" style="width:300px" value="" />
</td>
</tr>
<tr> <tr>
<td class="bg">环线位置</td> <td class="bg">环线位置</td>
<td> <td>
<input name="district.loopLineInfo" type="text" style="width:300px" value="" /> <input name="district.loopLineInfo" type="text" style="width:300px" value="" />
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class="bg">智能水平</td> <#-- <td class="bg">智能水平</td>-->
<td> <#-- <td>-->
<select name="district.intelligenceLevel"> <#-- <select name="district.intelligenceLevel">-->
<option value="">请选择</option> <#-- <option value="">请选择</option>-->
<option value="3A" >3A</option> <#-- <option value="3A" >3A</option>-->
<option value="4A" >4A</option> <#-- <option value="4A" >4A</option>-->
<option value="5A" >5A</option> <#-- <option value="5A" >5A</option>-->
<option value="3A-5A">3A-5A</option> <#-- <option value="3A-5A">3A-5A</option>-->
</select> <#-- </select>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "bg">预售许可证</td> <#-- <td class = "bg">预售许可证</td>-->
<td> <#-- <td>-->
<input name="district.licence" type="text" style="width:300px"/> <#-- <input name="district.licence" type="text" style="width:300px"/>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "bg">特色项目</td> <#-- <td class = "bg">特色项目</td>-->
<td> <#-- <td>-->
<input name="district.characteristic" type="text" style="width:300px"/> <#-- <input name="district.characteristic" type="text" style="width:300px"/>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class = "bg"> <td class = "bg">
总楼层 总楼层
@@ -194,19 +201,19 @@
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "bg">会议室</td> <#-- <td class = "bg">会议室</td>-->
<td> <#-- <td>-->
<input name="district.meetingRoom" type="text" style="width:300px"/> <#-- <input name="district.meetingRoom" type="text" style="width:300px"/>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "bg" >入住时间</td> <#-- <td class = "bg" >入住时间</td>-->
<td> <#-- <td>-->
<input name="district.liveDate" type="text" style="width:300px"/> <#-- <input name="district.liveDate" type="text" style="width:300px"/>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class = "bg" >是否可分割</td> <td class = "bg" >是否可分割</td>
<td> <td>
@@ -223,49 +230,49 @@
<input name="district.realUsePercent" type="text" style="width:300px"/> <input name="district.realUsePercent" type="text" style="width:300px"/>
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "bg" >交房标准</td> <#-- <td class = "bg" >交房标准</td>-->
<td> <#-- <td>-->
<input name="district.deliveryLevel" type="text" style="width:300px" /> <#-- <input name="district.deliveryLevel" type="text" style="width:300px" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "bg">楼内配套</td> <#-- <td class = "bg">楼内配套</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.buildFacilities" type="text" style="width:300px;height:100px;"></textarea> <#-- <textarea alias="richarea" name="district.buildFacilities" type="text" style="width:300px;height:100px;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "bg" style="width:150px;">设计单位</td> <#-- <td class = "bg" style="width:150px;">设计单位</td>-->
<td> <#-- <td>-->
<input name="district.buildDesigner" type="text" style="width:300px" /> <#-- <input name="district.buildDesigner" type="text" style="width:300px" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "bg">施工单位</td> <#-- <td class = "bg">施工单位</td>-->
<td> <#-- <td>-->
<input name="district.consCompany" type="text" style="width:300px"/> <#-- <input name="district.consCompany" type="text" style="width:300px"/>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">租售类型</td> <#-- <td class="bg">租售类型</td>-->
<td> <#-- <td>-->
<input name="district.rentType" type="text" style="width:300px" value="" /> <#-- <input name="district.rentType" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">租赁年限</td> <#-- <td class="bg">租赁年限</td>-->
<td> <#-- <td>-->
<input name="district.leaseTerm" type="text" style="width:300px" value="" /> <#-- <input name="district.leaseTerm" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">付款方式</td> <#-- <td class="bg">付款方式</td>-->
<td> <#-- <td>-->
<input name="district.paymentPattern" type="text" style="width:300px" value="" /> <#-- <input name="district.paymentPattern" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class="bg">物 业 费</td> <td class="bg">物 业 费</td>
<td> <td>
@@ -297,6 +304,19 @@
<input name="district.undergroundCarSite" type="text" style="width:300px" value="" /> <input name="district.undergroundCarSite" type="text" style="width:300px" value="" />
</td> </td>
</tr> </tr>
<tr>
<td class="t1">地上层数</td>
<td>
<input name="district.land_floor" type="text" style="width:300px" value="" />层
</td>
</tr>
<tr>
<td class="t1">地下层数</td>
<td>
<input name="district.underground_floor" type="text" style="width:300px" value="" />层
</td>
</tr>
<tr> <tr>
<td class="t1">车位月租金</td> <td class="t1">车位月租金</td>
<td> <td>
@@ -347,17 +367,26 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="t1">是否涉外</td> <td class="t1">是否涉外</td>
<td> <td>
<input name="district.foreign" type="text" style="width:300px" value="" /> <label for="foreign02">是</label>&nbsp;
</td> <input id="foreign02" name="district.foreign" type="radio" value="1" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label for="foreign01">否</label>&nbsp;
<input id="foreign01" name="district.foreign" type="radio" value="0" />
</td>
</tr> </tr>
<tr> <tr>
<td class="t1">是否可注册</td> <td class="t1">是否可注册</td>
<td> <td>
<input name="district.register" type="text" style="width:300px" value="" /> <label for="register02">是</label>&nbsp;
</td> <input id="register02" name="district.register" type="radio" value="1" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label for="register01">否</label>&nbsp;
<input id="register01" name="district.register" type="radio" value="0" />
</td>
</tr> </tr>
@@ -368,31 +397,31 @@
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "t1">班车时间</td> <#-- <td class = "t1">班车时间</td>-->
<td> <#-- <td>-->
<input name="district.workBusTime" type="text" style="width:300px" value="" /> <#-- <input name="district.workBusTime" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="t1">空调</td> <#-- <td class="t1">空调</td>-->
<td> <#-- <td>-->
<input name="district.lightingVentilation" type="text" style="width:300px" value="" /> <#-- <input name="district.lightingVentilation" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="t1">空调开放时间</td> <#-- <td class="t1">空调开放时间</td>-->
<td> <#-- <td>-->
<input name="district.conditionerTime" type="text" style="width:300px" value="" /> <#-- <input name="district.conditionerTime" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1">空调加时</td> <#-- <td class = "t1">空调加时</td>-->
<td> <#-- <td>-->
<input name="district.conditionerTimelag" type="text" style="width:300px" value="" /> <#-- <input name="district.conditionerTimelag" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class="t1">电梯数量</td> <td class="t1">电梯数量</td>
@@ -400,12 +429,12 @@
<input name="district.elevatorsCount" type="text" style="width:300px" value="" onkeydown="return justPositiveInteger(this,event);"/>个 <input name="district.elevatorsCount" type="text" style="width:300px" value="" onkeydown="return justPositiveInteger(this,event);"/>个
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class="t1">电梯品牌</td> <#-- <td class="t1">电梯品牌</td>-->
<td> <#-- <td>-->
<input name="district.elevatorBrand" type="text" style="width:300px" value="" /> <#-- <input name="district.elevatorBrand" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class="t1">客梯数</td> <td class="t1">客梯数</td>
<td> <td>
@@ -419,12 +448,12 @@
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "t1">装修情况</td> <#-- <td class = "t1">装修情况</td>-->
<td> <#-- <td>-->
<textarea name="district.fitment" style="width:400px;height:100px;"></textarea> <#-- <textarea name="district.fitment" style="width:400px;height:100px;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
@@ -475,67 +504,67 @@
<input name="district.estateCompany" type="text" style="width:300px" value="" /> <input name="district.estateCompany" type="text" style="width:300px" value="" />
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "t1">安防系统</td> <#-- <td class = "t1">安防系统</td>-->
<td> <#-- <td>-->
<input name="district.safeSystem" type="text" style="width:300px" value="" /> <#-- <input name="district.safeSystem" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<#-- -->
<#-- -->
<tr> <#-- <tr>-->
<td class = "t1">网络通讯</td> <#-- <td class = "t1">网络通讯</td>-->
<td> <#-- <td>-->
<input name="district.networkWay" type="text" style="width:300px" value="" /> <#-- <input name="district.networkWay" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<#-- -->
<#-- -->
<tr> <#-- <tr>-->
<td class="bg">地铁沿线</td> <#-- <td class="bg">地铁沿线</td>-->
<td> <#-- <td>-->
<input name="district.metroInfo" type="text" style="width:300px" value="" /> <#-- <input name="district.metroInfo" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1">装修标准</td> <#-- <td class = "t1">装修标准</td>-->
<td> <#-- <td>-->
<input alias="richarea" name="district.fitmentLevel" type="text" style="width:300px" value="" /> <#-- <input alias="richarea" name="district.fitmentLevel" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">地铁站名</td> <#-- <td class="bg">地铁站名</td>-->
<td> <#-- <td>-->
<input name="district.metroNames" type="text" style="width:300px" value="" /> <#-- <input name="district.metroNames" type="text" style="width:300px" value="" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<#-- -->
<tr> <#-- <tr>-->
<td class="bg">周边配套</td> <#-- <td class="bg">周边配套</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.surrounding" type="text" style="width:300px;height:auto;"></textarea> <#-- <textarea alias="richarea" name="district.surrounding" type="text" style="width:300px;height:auto;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="bg">配套设施</td> <#-- <td class="bg">配套设施</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.facilities" type="text" style="width:300px;height:auto;"></textarea> <#-- <textarea alias="richarea" name="district.facilities" type="text" style="width:300px;height:auto;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<#-- -->
<tr> <#-- <tr>-->
<td class="bg">交通概况</td> <#-- <td class="bg">交通概况</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.traffic" type="text" style="width:300px;height:auto;"></textarea> <#-- <textarea alias="richarea" name="district.traffic" type="text" style="width:300px;height:auto;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<#-- -->
<tr> <#-- <tr>-->
<td class="bg">物业概况</td> <#-- <td class="bg">物业概况</td>-->
<td> <#-- <td>-->
<textarea name="district.propertyInfo" type="text" style="width:300px;height:auto;"></textarea> <#-- <textarea name="district.propertyInfo" type="text" style="width:300px;height:auto;"></textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
@@ -25,7 +25,7 @@
<input type="hidden" name="keyword" value="${keyword!}" /> <input type="hidden" name="keyword" value="${keyword!}" />
<table class = "saveTable"> <table class = "saveTable">
<tr> <tr>
<td class = "t1"> <td class = "t1" style="width:150px;">
<#if markMap?? && markMap["cat"]?? && markMap["cat"] == 1> <#if markMap?? && markMap["cat"]?? && markMap["cat"] == 1>
<i class="lock" name="cat"></i> <i class="lock" name="cat"></i>
<#else> <#else>
@@ -232,55 +232,67 @@
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="bg"><#if markMap?? && markMap["shop_estate_type2"]?? && markMap["shop_estate_type2"] == 1> <td class="t1">
<i class="lock" name="shop_estate_type2"></i> <#if markMap?? && markMap["township"]?? && markMap["township"]?is_number && markMap["township"] == 1>
<#else> <i class="lock" name="township"></i>
<i class="unlock" name="shop_estate_type2"></i> <#else>
</#if>二级分类</td> <i class="unlock" name="township"></i>
<td> </#if>
<#assign x1 = 0> 乡镇街道</td>
<#assign x2 = 0> <td>
<#assign x3 = 0> <input name="district.township" type="text" style="width:300px" value="${district.township!}" />
<#assign x4 = 0>
<#assign x5 = 0>
<#assign x6 = 0>
<#assign x7 = 0>
<#if district?? && district.shopEstateType2??>
<#list district.shopEstateType2 as l>
<#if l == "商务区商铺">
<#assign x1 = 1>
</#if>
<#if l == "交通设施商铺">
<#assign x2 = 1>
</#if>
<#if l == "市场类商铺">
<#assign x3 = 1>
</#if>
<#if l == "社区内铺">
<#assign x4 = 1>
</#if>
<#if l == "住宅底商">
<#assign x5 = 1>
</#if>
<#if l == "百货购物中心商铺">
<#assign x6 = 1>
</#if>
<#if l == "商业综合体">
<#assign x7 = 1>
</#if>
</#list>
</#if>
<input type="checkbox" name="district.shopEstateType2" value="商务区商铺" <#if x1==1>checked="checked"</#if>/>商务区商铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="交通设施商铺" <#if x2==1>checked="checked"</#if>/>交通设施商铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="市场类商铺" <#if x3==1>checked="checked"</#if>/>市场类商铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="社区内铺" <#if x4==1>checked="checked"</#if>/>社区内铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="住宅底商" <#if x5==1>checked="checked"</#if>/>住宅底商&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="百货购物中心商铺" <#if x6==1>checked="checked"</#if>/>百货购物中心商铺&nbsp;&nbsp;
<input type="checkbox" name="district.shopEstateType2" value="商业综合体" <#if x7==1>checked="checked"</#if>/>商业综合体&nbsp;&nbsp;
</td> </td>
</tr> </tr>
<#-- <tr>-->
<#-- <td class="bg"><#if markMap?? && markMap["shop_estate_type2"]?? && markMap["shop_estate_type2"] == 1>-->
<#-- <i class="lock" name="shop_estate_type2"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="shop_estate_type2"></i>-->
<#-- </#if>二级分类</td>-->
<#-- <td>-->
<#-- <#assign x1 = 0>-->
<#-- <#assign x2 = 0>-->
<#-- <#assign x3 = 0>-->
<#-- <#assign x4 = 0>-->
<#-- <#assign x5 = 0>-->
<#-- <#assign x6 = 0>-->
<#-- <#assign x7 = 0>-->
<#-- <#if district?? && district.shopEstateType2??>-->
<#-- <#list district.shopEstateType2 as l>-->
<#-- <#if l == "商务区商铺">-->
<#-- <#assign x1 = 1>-->
<#-- </#if>-->
<#-- <#if l == "交通设施商铺">-->
<#-- <#assign x2 = 1>-->
<#-- </#if>-->
<#-- <#if l == "市场类商铺">-->
<#-- <#assign x3 = 1>-->
<#-- </#if>-->
<#-- <#if l == "社区内铺">-->
<#-- <#assign x4 = 1>-->
<#-- </#if>-->
<#-- <#if l == "住宅底商">-->
<#-- <#assign x5 = 1>-->
<#-- </#if>-->
<#-- <#if l == "百货购物中心商铺">-->
<#-- <#assign x6 = 1>-->
<#-- </#if>-->
<#-- <#if l == "商业综合体">-->
<#-- <#assign x7 = 1>-->
<#-- </#if>-->
<#-- </#list>-->
<#-- </#if>-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="商务区商铺" <#if x1==1>checked="checked"</#if>/>商务区商铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="交通设施商铺" <#if x2==1>checked="checked"</#if>/>交通设施商铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="市场类商铺" <#if x3==1>checked="checked"</#if>/>市场类商铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="社区内铺" <#if x4==1>checked="checked"</#if>/>社区内铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="住宅底商" <#if x5==1>checked="checked"</#if>/>住宅底商&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="百货购物中心商铺" <#if x6==1>checked="checked"</#if>/>百货购物中心商铺&nbsp;&nbsp;-->
<#-- <input type="checkbox" name="district.shopEstateType2" value="商业综合体" <#if x7==1>checked="checked"</#if>/>商业综合体&nbsp;&nbsp;-->
<#-- -->
<#-- </td>-->
<#-- </tr>-->
</table> </table>
<table class = "saveTable"> <table class = "saveTable">
@@ -292,56 +304,56 @@
</table> </table>
<table class = "saveTable"> <table class = "saveTable">
<#-- <tr>-->
<#-- <td class="t1" style="width:150px;">-->
<#-- <#if markMap?? && markMap["property_status"]?? && markMap["property_status"] == 1>-->
<#-- <i class="lock" name="property_status"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="property_status"></i>-->
<#-- </#if>-->
<#-- 建筑状态</td>-->
<#-- <td>-->
<#-- <input name="district.propertyStatus" type="text" style="width:300px" value="${district.propertyStatus!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["rent_type"]?? && markMap["rent_type"] == 1>-->
<#-- <i class="lock" name="rent_type"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="rent_type"></i>-->
<#-- </#if>-->
<#-- 租售类型</td>-->
<#-- <td>-->
<#-- <input name="district.rentType" type="text" style="width:300px" value="${district.rentType!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["lease_term"]?? && markMap["lease_term"] == 1>-->
<#-- <i class="lock" name="lease_term"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="lease_term"></i>-->
<#-- </#if>-->
<#-- 租赁年限</td>-->
<#-- <td>-->
<#-- <input name="district.leaseTerm" type="text" style="width:300px" value="${district.leaseTerm!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["payment_pattern"]?? && markMap["payment_pattern"] == 1>-->
<#-- <i class="lock" name="payment_pattern"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="payment_pattern"></i>-->
<#-- </#if>-->
<#-- 付款方式</td>-->
<#-- <td>-->
<#-- <input name="district.paymentPattern" type="text" style="width:300px" value="${district.paymentPattern!}" />-->
<#-- </td>-->
<#-- </tr>-->
<tr> <tr>
<td class="t1" style="width:150px;"> <td class="t1" style="width:150px;">
<#if markMap?? && markMap["property_status"]?? && markMap["property_status"] == 1>
<i class="lock" name="property_status"></i>
<#else>
<i class="unlock" name="property_status"></i>
</#if>
建筑状态</td>
<td>
<input name="district.propertyStatus" type="text" style="width:300px" value="${district.propertyStatus!}" />
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["rent_type"]?? && markMap["rent_type"] == 1>
<i class="lock" name="rent_type"></i>
<#else>
<i class="unlock" name="rent_type"></i>
</#if>
租售类型</td>
<td>
<input name="district.rentType" type="text" style="width:300px" value="${district.rentType!}" />
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["lease_term"]?? && markMap["lease_term"] == 1>
<i class="lock" name="lease_term"></i>
<#else>
<i class="unlock" name="lease_term"></i>
</#if>
租赁年限</td>
<td>
<input name="district.leaseTerm" type="text" style="width:300px" value="${district.leaseTerm!}" />
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["payment_pattern"]?? && markMap["payment_pattern"] == 1>
<i class="lock" name="payment_pattern"></i>
<#else>
<i class="unlock" name="payment_pattern"></i>
</#if>
付款方式</td>
<td>
<input name="district.paymentPattern" type="text" style="width:300px" value="${district.paymentPattern!}" />
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["car_site_count"]?? && markMap["car_site_count"] == 1> <#if markMap?? && markMap["car_site_count"]?? && markMap["car_site_count"] == 1>
<i class="lock" name="car_site_count"></i> <i class="lock" name="car_site_count"></i>
<#else> <#else>
@@ -421,6 +433,30 @@
<input name="district.floorInfo" type="text" style="width:300px" value="${district.floorInfo!}" /> <input name="district.floorInfo" type="text" style="width:300px" value="${district.floorInfo!}" />
</td> </td>
</tr> </tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["land_floor"]?? && markMap["land_floor"] == 1>
<i class="lock" name="land_floor"></i>
<#else>
<i class="unlock" name="land_floor"></i>
</#if>
地上楼层</td>
<td>
<input name="district.landFloor" type="text" style="width:300px" value="${district.landFloor!}" onkeydown="return justPositiveInteger(this,event);"/>层
</td>
</tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["underground_floor"]?? && markMap["underground_floor"] == 1>
<i class="lock" name="underground_floor"></i>
<#else>
<i class="unlock" name="underground_floor"></i>
</#if>
地下楼层</td>
<td>
<input name="district.undergroundFloor" type="text" style="width:300px" value="${district.undergroundFloor!}" onkeydown="return justPositiveInteger(this,event);"/>层
</td>
</tr>
<tr> <tr>
<td class="t1"> <td class="t1">
<#if markMap?? && markMap["all_area"]?? && markMap["all_area"] == 1> <#if markMap?? && markMap["all_area"]?? && markMap["all_area"] == 1>
@@ -482,18 +518,18 @@
<input name="district.openDate" type="text" style="width:300px" value="${t_util.formatDate(district.openDate!)}" /> <input name="district.openDate" type="text" style="width:300px" value="${t_util.formatDate(district.openDate!)}" />
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class="t1"> <#-- <td class="t1">-->
<#if markMap?? && markMap["live_date"]?? && markMap["live_date"] == 1> <#-- <#if markMap?? && markMap["live_date"]?? && markMap["live_date"] == 1>-->
<i class="lock" name="live_date"></i> <#-- <i class="lock" name="live_date"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="live_date"></i> <#-- <i class="unlock" name="live_date"></i>-->
</#if> <#-- </#if>-->
开业时间</td> <#-- 开业时间</td>-->
<td> <#-- <td>-->
<input name="district.liveDate" type="text" style="width:300px" value="${district.liveDate!}" /> <#-- <input name="district.liveDate" type="text" style="width:300px" value="${district.liveDate!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class="t1"> <td class="t1">
<#if markMap?? && markMap["finish_building_date"]?? && markMap["finish_building_date"] == 1> <#if markMap?? && markMap["finish_building_date"]?? && markMap["finish_building_date"] == 1>
@@ -541,63 +577,88 @@
<input name="district.estateCompany" type="text" style="width:300px" value="${district.estateCompany!}" /> <input name="district.estateCompany" type="text" style="width:300px" value="${district.estateCompany!}" />
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class="t1"> <#-- <td class="t1">-->
<#if markMap?? && markMap["sideset"]?? && markMap["sideset"] == 1> <#-- <#if markMap?? && markMap["sideset"]?? && markMap["sideset"] == 1>-->
<i class="lock" name="sideset"></i> <#-- <i class="lock" name="sideset"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="sideset"></i> <#-- <i class="unlock" name="sideset"></i>-->
</#if> <#-- </#if>-->
是否可分割</td> <#-- 是否可分割</td>-->
<td> <#-- <td>-->
<input name="district.sideset" type="text" style="width:300px" value="${district.sideset!}" /> <#-- <input name="district.sideset" type="text" style="width:300px" value="${district.sideset!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class="t1"> <#-- <td class="t1">-->
<#if markMap?? && markMap["unified_manage"]?? && markMap["unified_manage"] == 1> <#-- <#if markMap?? && markMap["unified_manage"]?? && markMap["unified_manage"] == 1>-->
<i class="lock" name="unified_manage"></i> <#-- <i class="lock" name="unified_manage"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="unified_manage"></i> <#-- <i class="unlock" name="unified_manage"></i>-->
</#if> <#-- </#if>-->
是否统一管理</td> <#-- 是否统一管理</td>-->
<td> <#-- <td>-->
<#-- -->
<#-- <select name="district.unifiedManage" class="inp1">-->
<#-- <option value="">请选择</option>-->
<#-- <#if district.unifiedManage??>-->
<#-- <option value="0" <#if district.unifiedManage! ==0> selected</#if>>是</option>-->
<#-- <option value="1" <#if district.unifiedManage! ==1> selected</#if>>否</option>-->
<#-- <#else>-->
<#-- <option value="0">是</option>-->
<#-- <option value="1">否</option>-->
<#-- </#if>-->
<#-- </select>-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["metro_info"]?? && markMap["metro_info"] == 1>-->
<#-- <i class="lock" name="metro_info"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="metro_info"></i>-->
<#-- </#if>-->
<#-- 地铁沿线</td>-->
<#-- <td>-->
<#-- <input name="district.metroInfo" type="text" style="width:300px" value="${district.metroInfo!}" />-->
<#-- </td>-->
<#-- </tr>-->
<select name="district.unifiedManage" class="inp1"> <#-- <tr>-->
<option value="">请选择</option> <#-- <td class="t1">-->
<#if district.unifiedManage??> <#-- <#if markMap?? && markMap["metro_names"]?? && markMap["metro_names"] == 1>-->
<option value="0" <#if district.unifiedManage! ==0> selected</#if>>是</option> <#-- <i class="lock" name="metro_names"></i>-->
<option value="1" <#if district.unifiedManage! ==1> selected</#if>>否</option> <#-- <#else>-->
<#else> <#-- <i class="unlock" name="metro_names"></i>-->
<option value="0">是</option> <#-- </#if>-->
<option value="1">否</option> <#-- 地铁站名</td>-->
</#if> <#-- <td>-->
</select> <#-- <input name="district.metroNames" type="text" style="width:300px" value="${district.metroNames!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class="t1"> <td class="t1">
<#if markMap?? && markMap["metro_info"]?? && markMap["metro_info"] == 1> <#if markMap?? && markMap["business_status"]?? && markMap["business_status"] == 1>
<i class="lock" name="metro_info"></i> <i class="lock" name="business_status"></i>
<#else> <#else>
<i class="unlock" name="metro_info"></i> <i class="unlock" name="business_status"></i>
</#if> </#if>
地铁沿线</td> 经营业态</td>
<td> <td>
<input name="district.metroInfo" type="text" style="width:300px" value="${district.metroInfo!}" /> <input name="district.businessStatus" type="text" style="width:300px" value="${district.businessStatus!}" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="t1"> <td class = "t1" style="width:150px;">
<#if markMap?? && markMap["metro_names"]?? && markMap["metro_names"] == 1> <#if markMap?? && markMap["real_use_percent"]?? && markMap["real_use_percent"] == 1>
<i class="lock" name="metro_names"></i> <i class="lock" name="real_use_percent"></i>
<#else> <#else>
<i class="unlock" name="metro_names"></i> <i class="unlock" name="real_use_percent"></i>
</#if> </#if>
地铁站名</td> 得房率</td>
<td> <td>
<input name="district.metroNames" type="text" style="width:300px" value="${district.metroNames!}" /> <input name="district.realUsePercent" type="text" style="width:300px" value="${district.realUsePercent!}" />
</td> </td>
</tr> </tr>
</table> </table>
@@ -609,125 +670,114 @@
</td> </td>
</tr> </tr>
</table> </table>
<table class = "saveTable"> <#-- <table class = "saveTable">-->
<tr> <#-- <tr>-->
<td class="t1" style="width:150px;"> <#-- <td class="t1" style="width:150px;">-->
<#if markMap?? && markMap["fitment"]?? && markMap["fitment"] == 1> <#-- <#if markMap?? && markMap["fitment"]?? && markMap["fitment"] == 1>-->
<i class="lock" name="fitment"></i> <#-- <i class="lock" name="fitment"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="fitment"></i> <#-- <i class="unlock" name="fitment"></i>-->
</#if> <#-- </#if>-->
装修情况</td> <#-- 装修情况</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.fitment" style="width:400px;height:100px;">${district.fitment!}</textarea> <#-- <textarea alias="richarea" name="district.fitment" style="width:400px;height:100px;">${district.fitment!}</textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<#-- -->
<#-- <tr>-->
<#-- <td class = "t1">-->
<#-- <#if markMap?? && markMap["build_structure"]?? && markMap["build_structure"] == 1>-->
<#-- <i class="lock" name="build_structure"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="build_structure"></i>-->
<#-- </#if>-->
<#-- 建筑结构</td>-->
<#-- <td>-->
<#-- <input name="district.buildStructure" type="text" style="width:300px" value="${district.buildStructure!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["property_info"]?? && markMap["property_info"] == 1>-->
<#-- <i class="lock" name="property_info"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="property_info"></i>-->
<#-- </#if>-->
<#-- 物业概况</td>-->
<#-- <td>-->
<#-- <textarea name="district.propertyInfo" type="text" style="width:400px;height:100px;">${district.propertyInfo!}</textarea>-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["traffic"]?? && markMap["traffic"] == 1>-->
<#-- <i class="lock" name="traffic"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="traffic"></i>-->
<#-- </#if>-->
<#-- 交通概况</td>-->
<#-- <td>-->
<#-- <textarea alias="richarea" name="district.traffic" type="text" style="width:400px;height:100px;">${district.traffic!}</textarea>-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["surrounding"]?? && markMap["surrounding"] == 1>-->
<#-- <i class="lock" name="surrounding"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="surrounding"></i>-->
<#-- </#if>-->
<#-- 周边情况</td>-->
<#-- <td>-->
<#-- <textarea alias="richarea" name="district.surrounding" type="text" style="width:400px;height:100px;">${district.surrounding!}</textarea>-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["facilities"]?? && markMap["facilities"] == 1>-->
<#-- <i class="lock" name="facilities"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="facilities"></i>-->
<#-- </#if>-->
<#-- 配套设施</td>-->
<#-- <td>-->
<#-- <input alias="richarea" name="district.facilities" type="text" style="width:400px" value="${district.facilities!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class="t1">-->
<#-- <#if markMap?? && markMap["description"]?? && markMap["description"] == 1>-->
<#-- <i class="lock" name="description"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="description"></i>-->
<#-- </#if>-->
<#-- 描述</td>-->
<#-- <td>-->
<#-- <textarea alias="richarea" name="district.description" style="width:700px;height:300px;">${district.description!}</textarea>-->
<#-- </td>-->
<#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class="t1">-->
<#if markMap?? && markMap["build_structure"]?? && markMap["build_structure"] == 1> <#-- <#if markMap?? && markMap["characteristic"]?? && markMap["characteristic"] == 1>-->
<i class="lock" name="build_structure"></i> <#-- <i class="lock" name="characteristic"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="build_structure"></i> <#-- <i class="unlock" name="characteristic"></i>-->
</#if> <#-- </#if>-->
建筑结构</td> <#-- 项目特色</td>-->
<td> <#-- <td>-->
<input name="district.buildStructure" type="text" style="width:300px" value="${district.buildStructure!}" /> <#-- <input name="district.characteristic" type="text" style="width:400px" value="${district.characteristic!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- </table>-->
<td class="t1">
<#if markMap?? && markMap["property_info"]?? && markMap["property_info"] == 1>
<i class="lock" name="property_info"></i>
<#else>
<i class="unlock" name="property_info"></i>
</#if>
物业概况</td>
<td>
<textarea name="district.propertyInfo" type="text" style="width:400px;height:100px;">${district.propertyInfo!}</textarea>
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["traffic"]?? && markMap["traffic"] == 1>
<i class="lock" name="traffic"></i>
<#else>
<i class="unlock" name="traffic"></i>
</#if>
交通概况</td>
<td>
<textarea alias="richarea" name="district.traffic" type="text" style="width:400px;height:100px;">${district.traffic!}</textarea>
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["surrounding"]?? && markMap["surrounding"] == 1>
<i class="lock" name="surrounding"></i>
<#else>
<i class="unlock" name="surrounding"></i>
</#if>
周边情况</td>
<td>
<textarea alias="richarea" name="district.surrounding" type="text" style="width:400px;height:100px;">${district.surrounding!}</textarea>
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["facilities"]?? && markMap["facilities"] == 1>
<i class="lock" name="facilities"></i>
<#else>
<i class="unlock" name="facilities"></i>
</#if>
配套设施</td>
<td>
<input alias="richarea" name="district.facilities" type="text" style="width:400px" value="${district.facilities!}" />
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["description"]?? && markMap["description"] == 1>
<i class="lock" name="description"></i>
<#else>
<i class="unlock" name="description"></i>
</#if>
描述</td>
<td>
<textarea alias="richarea" name="district.description" style="width:700px;height:300px;">${district.description!}</textarea>
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["business_status"]?? && markMap["business_status"] == 1>
<i class="lock" name="business_status"></i>
<#else>
<i class="unlock" name="business_status"></i>
</#if>
经营业态</td>
<td>
<input name="district.businessStatus" type="text" style="width:400px" value="${district.businessStatus!}" />
</td>
</tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["characteristic"]?? && markMap["characteristic"] == 1>
<i class="lock" name="characteristic"></i>
<#else>
<i class="unlock" name="characteristic"></i>
</#if>
项目特色</td>
<td>
<input name="district.characteristic" type="text" style="width:400px" value="${district.characteristic!}" />
</td>
</tr>
</table>
<table class = "saveTable"> <#-- <table class = "saveTable">-->
<tr> <#-- <tr>-->
<td colspan="2" style="text-align:center"> <#-- <td colspan="2" style="text-align:center">-->
<input type="submit" value="保存信息" /> <#-- <input type="submit" value="保存信息" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
</table> <#-- </table>-->
</form> </form>
</div> </div>
@@ -258,6 +258,19 @@
<input name="district.businessQuarter" type="text" style="width:300px" value="${district.businessQuarter!}" /> <input name="district.businessQuarter" type="text" style="width:300px" value="${district.businessQuarter!}" />
</td> </td>
</tr> </tr>
<tr>
<td class="t1">
<#if markMap?? && markMap["township"]?? && markMap["township"]?is_number && markMap["township"] == 1>
<i class="lock" name="township"></i>
<#else>
<i class="unlock" name="township"></i>
</#if>
乡镇街道</td>
<td>
<input name="district.township" type="text" style="width:300px" value="${district.township!}" />
</td>
</tr>
<tr> <tr>
<td class = "t1"> <td class = "t1">
<#if markMap?? && markMap["loop_line_info"]?? && markMap["loop_line_info"] == 1> <#if markMap?? && markMap["loop_line_info"]?? && markMap["loop_line_info"] == 1>
@@ -281,48 +294,48 @@
</table> </table>
<table class = "saveTable"> <table class = "saveTable">
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["intelligence_level"]?? && markMap["intelligence_level"] == 1> <#-- <#if markMap?? && markMap["intelligence_level"]?? && markMap["intelligence_level"] == 1>-->
<i class="lock" name="intelligence_level"></i> <#-- <i class="lock" name="intelligence_level"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="intelligence_level"></i> <#-- <i class="unlock" name="intelligence_level"></i>-->
</#if> <#-- </#if>-->
智能水平</td> <#-- 智能水平</td>-->
<td> <#-- <td>-->
<select name="district.intelligenceLevel" style="width:300px"> <#-- <select name="district.intelligenceLevel" style="width:300px">-->
<option value="">请选择</option> <#-- <option value="">请选择</option>-->
<option value="3A" <#if district.intelligenceLevel?? && district.intelligenceLevel == '3A'>selected</#if> >3A</option> <#-- <option value="3A" <#if district.intelligenceLevel?? && district.intelligenceLevel == '3A'>selected</#if> >3A</option>-->
<option value="4A" <#if district.intelligenceLevel?? && district.intelligenceLevel == '4A'>selected</#if> >4A</option> <#-- <option value="4A" <#if district.intelligenceLevel?? && district.intelligenceLevel == '4A'>selected</#if> >4A</option>-->
<option value="5A" <#if district.intelligenceLevel?? && district.intelligenceLevel == '5A'>selected</#if> >5A</option> <#-- <option value="5A" <#if district.intelligenceLevel?? && district.intelligenceLevel == '5A'>selected</#if> >5A</option>-->
<option value="3A-5A" <#if district.intelligenceLevel?? && district.intelligenceLevel == '3A-5A'>selected</#if> >3A-5A</option> <#-- <option value="3A-5A" <#if district.intelligenceLevel?? && district.intelligenceLevel == '3A-5A'>selected</#if> >3A-5A</option>-->
</select> <#-- </select>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["licence"]?? && markMap["licence"] == 1> <#-- <#if markMap?? && markMap["licence"]?? && markMap["licence"] == 1>-->
<i class="lock" name="licence"></i> <#-- <i class="lock" name="licence"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="licence"></i> <#-- <i class="unlock" name="licence"></i>-->
</#if> <#-- </#if>-->
预售许可证</td> <#-- 预售许可证</td>-->
<td> <#-- <td>-->
<input name="district.licence" type="text" style="width:300px" value="${district.licence!}" /> <#-- <input name="district.licence" type="text" style="width:300px" value="${district.licence!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["characteristic"]?? && markMap["characteristic"] == 1> <#-- <#if markMap?? && markMap["characteristic"]?? && markMap["characteristic"] == 1>-->
<i class="lock" name="characteristic"></i> <#-- <i class="lock" name="characteristic"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="characteristic"></i> <#-- <i class="unlock" name="characteristic"></i>-->
</#if> <#-- </#if>-->
特色项目</td> <#-- 特色项目</td>-->
<td> <#-- <td>-->
<input name="district.characteristic" type="text" style="width:300px" value="${district.characteristic!}" /> <#-- <input name="district.characteristic" type="text" style="width:300px" value="${district.characteristic!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class = "t1" style="width:150px;"> <td class = "t1" style="width:150px;">
<#if markMap?? && markMap["total_floor"]?? && markMap["total_floor"] == 1> <#if markMap?? && markMap["total_floor"]?? && markMap["total_floor"] == 1>
@@ -336,31 +349,31 @@
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["meeting_room"]?? && markMap["meeting_room"] == 1> <#-- <#if markMap?? && markMap["meeting_room"]?? && markMap["meeting_room"] == 1>-->
<i class="lock" name="meeting_room"></i> <#-- <i class="lock" name="meeting_room"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="meeting_room"></i> <#-- <i class="unlock" name="meeting_room"></i>-->
</#if> <#-- </#if>-->
会议室</td> <#-- 会议室</td>-->
<td> <#-- <td>-->
<input name="district.meetingRoom" type="text" style="width:300px" value="${district.meetingRoom!}" /> <#-- <input name="district.meetingRoom" type="text" style="width:300px" value="${district.meetingRoom!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["live_date"]?? && markMap["live_date"] == 1> <#-- <#if markMap?? && markMap["live_date"]?? && markMap["live_date"] == 1>-->
<i class="lock" name="live_date"></i> <#-- <i class="lock" name="live_date"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="live_date"></i> <#-- <i class="unlock" name="live_date"></i>-->
</#if> <#-- </#if>-->
入住时间</td> <#-- 入住时间</td>-->
<td> <#-- <td>-->
<input name="district.liveDate" type="text" style="width:300px" value="${district.liveDate!}" /> <#-- <input name="district.liveDate" type="text" style="width:300px" value="${district.liveDate!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class = "t1" style="width:150px;"> <td class = "t1" style="width:150px;">
<#if markMap?? && markMap["divisible"]?? && markMap["divisible"] == 1> <#if markMap?? && markMap["divisible"]?? && markMap["divisible"] == 1>
@@ -389,91 +402,91 @@
<input name="district.realUsePercent" type="text" style="width:300px" value="${district.realUsePercent!}" /> <input name="district.realUsePercent" type="text" style="width:300px" value="${district.realUsePercent!}" />
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["delivery_level"]?? && markMap["delivery_level"] == 1> <#-- <#if markMap?? && markMap["delivery_level"]?? && markMap["delivery_level"] == 1>-->
<i class="lock" name="delivery_level"></i> <#-- <i class="lock" name="delivery_level"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="delivery_level"></i> <#-- <i class="unlock" name="delivery_level"></i>-->
</#if> <#-- </#if>-->
交房标准</td> <#-- 交房标准</td>-->
<td> <#-- <td>-->
<input name="district.deliveryLevel" type="text" style="width:300px" value="${district.deliveryLevel!}" /> <#-- <input name="district.deliveryLevel" type="text" style="width:300px" value="${district.deliveryLevel!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["build_facilities"]?? && markMap["build_facilities"] == 1> <#-- <#if markMap?? && markMap["build_facilities"]?? && markMap["build_facilities"] == 1>-->
<i class="lock" name="build_facilities"></i> <#-- <i class="lock" name="build_facilities"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="build_facilities"></i> <#-- <i class="unlock" name="build_facilities"></i>-->
</#if> <#-- </#if>-->
楼内配套</td> <#-- 楼内配套</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.buildFacilities" type="text" style="width:300px;height:100px;">${district.buildFacilities!}</textarea> <#-- <textarea alias="richarea" name="district.buildFacilities" type="text" style="width:300px;height:100px;">${district.buildFacilities!}</textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["build_designer"]?? && markMap["build_designer"] == 1> <#-- <#if markMap?? && markMap["build_designer"]?? && markMap["build_designer"] == 1>-->
<i class="lock" name="build_designer"></i> <#-- <i class="lock" name="build_designer"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="build_designer"></i> <#-- <i class="unlock" name="build_designer"></i>-->
</#if> <#-- </#if>-->
设计单位</td> <#-- 设计单位</td>-->
<td> <#-- <td>-->
<input name="district.buildDesigner" type="text" style="width:300px" value="${district.buildDesigner!}" /> <#-- <input name="district.buildDesigner" type="text" style="width:300px" value="${district.buildDesigner!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["cons_company"]?? && markMap["cons_company"] == 1> <#-- <#if markMap?? && markMap["cons_company"]?? && markMap["cons_company"] == 1>-->
<i class="lock" name="cons_company"></i> <#-- <i class="lock" name="cons_company"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="cons_company"></i> <#-- <i class="unlock" name="cons_company"></i>-->
</#if> <#-- </#if>-->
施工单位</td> <#-- 施工单位</td>-->
<td> <#-- <td>-->
<input name="district.consCompany" type="text" style="width:300px" value="${district.consCompany!}" /> <#-- <input name="district.consCompany" type="text" style="width:300px" value="${district.consCompany!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["rent_type"]?? && markMap["rent_type"] == 1> <#-- <#if markMap?? && markMap["rent_type"]?? && markMap["rent_type"] == 1>-->
<i class="lock" name="rent_type"></i> <#-- <i class="lock" name="rent_type"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="rent_type"></i> <#-- <i class="unlock" name="rent_type"></i>-->
</#if> <#-- </#if>-->
租售类型</td> <#-- 租售类型</td>-->
<td> <#-- <td>-->
<input name="district.rentType" type="text" style="width:300px" value="${district.rentType!}" /> <#-- <input name="district.rentType" type="text" style="width:300px" value="${district.rentType!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["lease_term"]?? && markMap["lease_term"] == 1> <#-- <#if markMap?? && markMap["lease_term"]?? && markMap["lease_term"] == 1>-->
<i class="lock" name="lease_term"></i> <#-- <i class="lock" name="lease_term"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="lease_term"></i> <#-- <i class="unlock" name="lease_term"></i>-->
</#if> <#-- </#if>-->
租赁年限</td> <#-- 租赁年限</td>-->
<td> <#-- <td>-->
<input name="district.leaseTerm" type="text" style="width:300px" value="${district.leaseTerm!}" /> <#-- <input name="district.leaseTerm" type="text" style="width:300px" value="${district.leaseTerm!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["payment_pattern"]?? && markMap["payment_pattern"] == 1> <#-- <#if markMap?? && markMap["payment_pattern"]?? && markMap["payment_pattern"] == 1>-->
<i class="lock" name="payment_pattern"></i> <#-- <i class="lock" name="payment_pattern"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="payment_pattern"></i> <#-- <i class="unlock" name="payment_pattern"></i>-->
</#if> <#-- </#if>-->
付款方式</td> <#-- 付款方式</td>-->
<td> <#-- <td>-->
<input name="district.paymentPattern" type="text" style="width:300px" value="${district.paymentPattern!}" /> <#-- <input name="district.paymentPattern" type="text" style="width:300px" value="${district.paymentPattern!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class = "t1"> <td class = "t1">
<#if markMap?? && markMap["estate_charge"]?? && markMap["estate_charge"] == 1> <#if markMap?? && markMap["estate_charge"]?? && markMap["estate_charge"] == 1>
@@ -536,6 +549,32 @@
<input name="district.undergroundCarSite" type="text" style="width:300px" value="${district.undergroundCarSite!}" onkeydown="return justPositiveInteger(this,event);"/>个 <input name="district.undergroundCarSite" type="text" style="width:300px" value="${district.undergroundCarSite!}" onkeydown="return justPositiveInteger(this,event);"/>个
</td> </td>
</tr> </tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["land_floor"]?? && markMap["land_floor"] == 1>
<i class="lock" name="land_floor"></i>
<#else>
<i class="unlock" name="land_floor"></i>
</#if>
地上楼层</td>
<td>
<input name="district.landFloor" type="text" style="width:300px" value="${district.landFloor!}" onkeydown="return justPositiveInteger(this,event);"/>层
</td>
</tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["underground_floor"]?? && markMap["underground_floor"] == 1>
<i class="lock" name="underground_floor"></i>
<#else>
<i class="unlock" name="underground_floor"></i>
</#if>
地下楼层</td>
<td>
<input name="district.undergroundFloor" type="text" style="width:300px" value="${district.undergroundFloor!}" onkeydown="return justPositiveInteger(this,event);"/>层
</td>
</tr>
<tr> <tr>
<td class = "t1"> <td class = "t1">
<#if markMap?? && markMap["parking_fee"]?? && markMap["parking_fee"] == 1> <#if markMap?? && markMap["parking_fee"]?? && markMap["parking_fee"] == 1>
@@ -661,7 +700,11 @@
</#if> </#if>
是否涉外</td> 是否涉外</td>
<td> <td>
<input name="district.foreign" type="text" style="width:300px" value="${district.isForeign!}" /> <label for="foreign02">是</label>&nbsp;
<input id="foreign02" name="district.foreign" type="radio" value="是" <#if district.foreign?? && district.foreign == "是">checked</#if> />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label for="foreign01">否</label>&nbsp;
<input id="foreign01" name="district.foreign" type="radio" value="否" <#if district.foreign?? && district.foreign == "否">checked</#if>/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -673,77 +716,81 @@
</#if> </#if>
是否可注册</td> 是否可注册</td>
<td> <td>
<input name="district.register" type="text" style="width:300px" value="${district.isRegister!}" /> <label for="register02">是</label>&nbsp;
<input id="register02" name="district.register" type="radio" value="是" <#if district.register?? && district.register == "是">checked</#if> />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label for="register01">否</label>&nbsp;
<input id="register01" name="district.register" type="radio" value="否" <#if district.register?? && district.register == "否">checked</#if>/>
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["is_work_bus"]?? && markMap["is_work_bus"] == 1> <#-- <#if markMap?? && markMap["is_work_bus"]?? && markMap["is_work_bus"] == 1>-->
<i class="lock" name="is_work_bus"></i> <#-- <i class="lock" name="is_work_bus"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="is_work_bus"></i> <#-- <i class="unlock" name="is_work_bus"></i>-->
</#if> <#-- </#if>-->
是否有班车</td> <#-- 是否有班车</td>-->
<td> <#-- <td>-->
<input name="district.workBus" type="text" style="width:300px" value="${district.workBus!}" /> <#-- <input name="district.workBus" type="text" style="width:300px" value="${district.workBus!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["work_bus_time"]?? && markMap["work_bus_time"] == 1> <#-- <#if markMap?? && markMap["work_bus_time"]?? && markMap["work_bus_time"] == 1>-->
<i class="lock" name="work_bus_time"></i> <#-- <i class="lock" name="work_bus_time"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="work_bus_time"></i> <#-- <i class="unlock" name="work_bus_time"></i>-->
</#if> <#-- </#if>-->
班车时间</td> <#-- 班车时间</td>-->
<td> <#-- <td>-->
<input name="district.workBusTime" type="text" style="width:300px" value="${district.workBusTime!}" /> <#-- <input name="district.workBusTime" type="text" style="width:300px" value="${district.workBusTime!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["lighting_ventilation"]?? && markMap["lighting_ventilation"] == 1> <#-- <#if markMap?? && markMap["lighting_ventilation"]?? && markMap["lighting_ventilation"] == 1>-->
<i class="lock" name="lighting_ventilation"></i> <#-- <i class="lock" name="lighting_ventilation"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="lighting_ventilation"></i> <#-- <i class="unlock" name="lighting_ventilation"></i>-->
</#if> <#-- </#if>-->
空调</td> <#-- 空调</td>-->
<td> <#-- <td>-->
<input name="district.lightingVentilation" type="text" style="width:300px" value="${district.lightingVentilation!}" /> <#-- <input name="district.lightingVentilation" type="text" style="width:300px" value="${district.lightingVentilation!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["conditioner_time"]?? && markMap["conditioner_time"] == 1> <#-- <#if markMap?? && markMap["conditioner_time"]?? && markMap["conditioner_time"] == 1>-->
<i class="lock" name="conditioner_time""></i> <#-- <i class="lock" name="conditioner_time""></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="conditioner_time""></i> <#-- <i class="unlock" name="conditioner_time""></i>-->
</#if> <#-- </#if>-->
空调开放时间</td> <#-- 空调开放时间</td>-->
<td> <#-- <td>-->
<input name="district.conditionerTime"" type="text" style="width:300px" value="${district.conditionerTime!}" /> <#-- <input name="district.conditionerTime"" type="text" style="width:300px" value="${district.conditionerTime!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["conditioner_timelag"]?? && markMap["conditioner_timelag"] == 1> <#-- <#if markMap?? && markMap["conditioner_timelag"]?? && markMap["conditioner_timelag"] == 1>-->
<i class="lock" name="conditioner_timelag"></i> <#-- <i class="lock" name="conditioner_timelag"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="conditioner_timelag"></i> <#-- <i class="unlock" name="conditioner_timelag"></i>-->
</#if> <#-- </#if>-->
空调加时</td> <#-- 空调加时</td>-->
<td> <#-- <td>-->
<input name="district.conditionerTimelag" type="text" style="width:300px" value="${district.conditionerTimelag!}" /> <#-- <input name="district.conditionerTimelag" type="text" style="width:300px" value="${district.conditionerTimelag!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class = "t1"> <td class = "t1">
@@ -757,18 +804,18 @@
<input name="district.elevatorsCount" type="text" style="width:300px" value="${district.elevatorsCount!}" onkeydown="return justPositiveInteger(this,event);"/>个 <input name="district.elevatorsCount" type="text" style="width:300px" value="${district.elevatorsCount!}" onkeydown="return justPositiveInteger(this,event);"/>个
</td> </td>
</tr> </tr>
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["elevator_brand"]?? && markMap["elevator_brand"] == 1> <#-- <#if markMap?? && markMap["elevator_brand"]?? && markMap["elevator_brand"] == 1>-->
<i class="lock" name="elevator_brand"></i> <#-- <i class="lock" name="elevator_brand"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="elevator_brand"></i> <#-- <i class="unlock" name="elevator_brand"></i>-->
</#if> <#-- </#if>-->
电梯品牌</td> <#-- 电梯品牌</td>-->
<td> <#-- <td>-->
<input name="district.elevatorBrand" type="text" style="width:300px" value="${district.elevatorBrand!}" /> <#-- <input name="district.elevatorBrand" type="text" style="width:300px" value="${district.elevatorBrand!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class = "t1"> <td class = "t1">
<#if markMap?? && markMap["person_elevators_count"]?? && markMap["person_elevators_count"] == 1> <#if markMap?? && markMap["person_elevators_count"]?? && markMap["person_elevators_count"] == 1>
@@ -804,18 +851,18 @@
</tr> </tr>
</table> </table>
<table class = "saveTable"> <table class = "saveTable">
<tr> <#-- <tr>-->
<td class = "t1" style="width:150px;"> <#-- <td class = "t1" style="width:150px;">-->
<#if markMap?? && markMap["fitment"]?? && markMap["fitment"] == 1> <#-- <#if markMap?? && markMap["fitment"]?? && markMap["fitment"] == 1>-->
<i class="lock" name="fitment"></i> <#-- <i class="lock" name="fitment"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="fitment"></i> <#-- <i class="unlock" name="fitment"></i>-->
</#if> <#-- </#if>-->
装修情况</td> <#-- 装修情况</td>-->
<td> <#-- <td>-->
<textarea alias="richarea" name="district.fitment" style="width:400px;height:100px;">${district.fitment!}</textarea> <#-- <textarea alias="richarea" name="district.fitment" style="width:400px;height:100px;">${district.fitment!}</textarea>-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<tr> <tr>
<td class = "t1"> <td class = "t1">
<#if markMap?? && markMap["open_date"]?? && markMap["open_date"] == 1> <#if markMap?? && markMap["open_date"]?? && markMap["open_date"] == 1>
@@ -922,140 +969,140 @@
</td> </td>
</tr> </tr>
</table> </table>
<table class = "saveTable"> <#-- <table class = "saveTable">-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td class = "t1">-->
<#if markMap?? && markMap["safeSystem"]?? && markMap["safeSystem"] == 1> <#-- <#if markMap?? && markMap["safeSystem"]?? && markMap["safeSystem"] == 1>-->
<i class="lock" name="safeSystem"></i> <#-- <i class="lock" name="safeSystem"></i>-->
<#else> <#-- <#else>-->
<i class="unlock" name="safeSystem"></i> <#-- <i class="unlock" name="safeSystem"></i>-->
</#if> <#-- </#if>-->
安防系统</td> <#-- 安防系统</td>-->
<td> <#-- <td>-->
<input name="district.safeSystem" type="text" style="width:300px" value="${district.safeSystem!}" /> <#-- <input name="district.safeSystem" type="text" style="width:300px" value="${district.safeSystem!}" />-->
</td> <#-- </td>-->
</tr> <#-- </tr>-->
<#-- -->
<#-- -->
<#-- <tr>-->
<#-- <td class = "t1">-->
<#-- <#if markMap?? && markMap["network_way"]?? && markMap["network_way"] == 1>-->
<#-- <i class="lock" name="network_way"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="network_way"></i>-->
<#-- </#if>-->
<#-- 网络通讯</td>-->
<#-- <td>-->
<#-- <input name="district.networkWay" type="text" style="width:300px" value="${district.networkWay!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- </table>-->
<#-- -->
<#-- <table class = "saveTable">-->
<#-- <tr>-->
<#-- <td colspan="2" style="text-align:center">-->
<#-- <input type="submit" value="保存信息" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- </table>-->
<#-- <table class = "saveTable">-->
<#-- -->
<#-- <tr>-->
<#-- <td class = "t1" style="width:150px;">-->
<#-- <#if markMap?? && markMap["metro_info"]?? && markMap["metro_info"] == 1>-->
<#-- <i class="lock" name="metro_info"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="metro_info"></i>-->
<#-- </#if>-->
<#-- 地铁沿线</td>-->
<#-- <td>-->
<#-- <input name="district.metroInfo" type="text" style="width:300px" value="${district.metroInfo!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- -->
<#-- <tr>-->
<#-- <td class = "t1" style="width:150px;">-->
<#-- <#if markMap?? && markMap["fitment_level"]?? && markMap["fitment_level"] == 1>-->
<#-- <i class="lock" name="fitment_level"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="fitment_level"></i>-->
<#-- </#if>-->
<#-- 装修标准</td>-->
<#-- <td>-->
<#-- <input name="district.fitmentLevel" type="text" style="width:300px" value="${district.fitmentLevel!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- -->
<#-- <tr>-->
<#-- <td class = "t1">-->
<#-- <#if markMap?? && markMap["metro_names"]?? && markMap["metro_names"] == 1>-->
<#-- <i class="lock" name="metro_names"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="metro_names"></i>-->
<#-- </#if>-->
<#-- 地铁站名</td>-->
<#-- <td>-->
<#-- <input name="district.metroNames" type="text" style="width:300px" value="${district.metroNames!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class = "t1">-->
<#-- <#if markMap?? && markMap["surrounding"]?? && markMap["surrounding"] == 1>-->
<#-- <i class="lock" name="surrounding"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="surrounding"></i>-->
<#-- </#if>-->
<#-- 周边配套</td>-->
<#-- <td>-->
<#-- <textarea alias="richarea" name="district.surrounding" type="text" style="width:300px;height:100px;">${district.surrounding!}</textarea>-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class = "t1">-->
<#-- <#if markMap?? && markMap["facilities"]?? && markMap["facilities"] == 1>-->
<#-- <i class="lock" name="facilities"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="facilities"></i>-->
<#-- </#if>-->
<#-- 配套设施</td>-->
<#-- <td>-->
<#-- <input alias="richarea" name="district.facilities" type="text" style="width:300px" value="${district.facilities!}" />-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class = "t1">-->
<#-- <#if markMap?? && markMap["traffic"]?? && markMap["traffic"] == 1>-->
<#-- <i class="lock" name="traffic"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="traffic"></i>-->
<#-- </#if>-->
<#-- 交通概况</td>-->
<#-- <td>-->
<#-- <textarea alias="richarea" name="district.traffic" type="text" style="width:300px;height:100px;">${district.traffic!}</textarea>-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td class = "t1">-->
<#-- <#if markMap?? && markMap["property_info"]?? && markMap["property_info"] == 1>-->
<#-- <i class="lock" name="property_info"></i>-->
<#-- <#else>-->
<#-- <i class="unlock" name="property_info"></i>-->
<#-- </#if>-->
<#-- 物业概况</td>-->
<#-- <td>-->
<#-- <textarea name="district.propertyInfo" type="text" style="width:300px;height:100px;">${district.propertyInfo!}</textarea>-->
<#-- </td>-->
<#-- </tr>-->
<#-- -->
<#-- </table>-->
<#-- <table class = "saveTable">-->
<tr> <#-- <tr>-->
<td class = "t1"> <#-- <td colspan="2" style="text-align:center">-->
<#if markMap?? && markMap["network_way"]?? && markMap["network_way"] == 1> <#-- <input type="submit" value="保存信息" />-->
<i class="lock" name="network_way"></i> <#-- </td>-->
<#else> <#-- </tr>-->
<i class="unlock" name="network_way"></i> <#-- </table>-->
</#if>
网络通讯</td>
<td>
<input name="district.networkWay" type="text" style="width:300px" value="${district.networkWay!}" />
</td>
</tr>
</table>
<table class = "saveTable">
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" value="保存信息" />
</td>
</tr>
</table>
<table class = "saveTable">
<tr>
<td class = "t1" style="width:150px;">
<#if markMap?? && markMap["metro_info"]?? && markMap["metro_info"] == 1>
<i class="lock" name="metro_info"></i>
<#else>
<i class="unlock" name="metro_info"></i>
</#if>
地铁沿线</td>
<td>
<input name="district.metroInfo" type="text" style="width:300px" value="${district.metroInfo!}" />
</td>
</tr>
<tr>
<td class = "t1" style="width:150px;">
<#if markMap?? && markMap["fitment_level"]?? && markMap["fitment_level"] == 1>
<i class="lock" name="fitment_level"></i>
<#else>
<i class="unlock" name="fitment_level"></i>
</#if>
装修标准</td>
<td>
<input name="district.fitmentLevel" type="text" style="width:300px" value="${district.fitmentLevel!}" />
</td>
</tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["metro_names"]?? && markMap["metro_names"] == 1>
<i class="lock" name="metro_names"></i>
<#else>
<i class="unlock" name="metro_names"></i>
</#if>
地铁站名</td>
<td>
<input name="district.metroNames" type="text" style="width:300px" value="${district.metroNames!}" />
</td>
</tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["surrounding"]?? && markMap["surrounding"] == 1>
<i class="lock" name="surrounding"></i>
<#else>
<i class="unlock" name="surrounding"></i>
</#if>
周边配套</td>
<td>
<textarea alias="richarea" name="district.surrounding" type="text" style="width:300px;height:100px;">${district.surrounding!}</textarea>
</td>
</tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["facilities"]?? && markMap["facilities"] == 1>
<i class="lock" name="facilities"></i>
<#else>
<i class="unlock" name="facilities"></i>
</#if>
配套设施</td>
<td>
<input alias="richarea" name="district.facilities" type="text" style="width:300px" value="${district.facilities!}" />
</td>
</tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["traffic"]?? && markMap["traffic"] == 1>
<i class="lock" name="traffic"></i>
<#else>
<i class="unlock" name="traffic"></i>
</#if>
交通概况</td>
<td>
<textarea alias="richarea" name="district.traffic" type="text" style="width:300px;height:100px;">${district.traffic!}</textarea>
</td>
</tr>
<tr>
<td class = "t1">
<#if markMap?? && markMap["property_info"]?? && markMap["property_info"] == 1>
<i class="lock" name="property_info"></i>
<#else>
<i class="unlock" name="property_info"></i>
</#if>
物业概况</td>
<td>
<textarea name="district.propertyInfo" type="text" style="width:300px;height:100px;">${district.propertyInfo!}</textarea>
</td>
</tr>
</table>
<table class = "saveTable">
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" value="保存信息" />
</td>
</tr>
</table>
</form> </form>
</div> </div>
@@ -158,6 +158,13 @@
<th style="width:60px;">板块</th> <th style="width:60px;">板块</th>
<th style="width:80px;">装修</th> <th style="width:80px;">装修</th>
<th style="width:70px;">朝向</th> <th style="width:70px;">朝向</th>
<th style="width:20px;">梯</th>
<th style="width:20px;">户</th>
<th style="width:70px;">户型结构</th>
<th style="width:70px;">交易权属</th>
<th style="width:70px;">房权所属</th>
<#-- <th style="width:70px;">房屋年限</th>-->
<th style="width:70px;">配备电梯</th>
<th style="width:70px;">物业类型</th> <th style="width:70px;">物业类型</th>
<th style="width:90px;">来源</th> <th style="width:90px;">来源</th>
<th style="width:90px;">状态</th> <th style="width:90px;">状态</th>
@@ -200,6 +207,13 @@
<td>${it.block!}</td> <td>${it.block!}</td>
<td>${it.fitment!}</td> <td>${it.fitment!}</td>
<td>${it.direction!}</td> <td>${it.direction!}</td>
<td>${it.lift!}</td>
<td>${it.liftHousehold!}</td>
<td>${it.roomStructure!}</td>
<td>${it.tradeProperty!}</td>
<td>${it.propertyOwnership!}</td>
<#-- <td>${it.housingAge!}</td>-->
<td>${it.elevator!}</td>
<td>${it.estateType!}</td> <td>${it.estateType!}</td>
<td> <td>
<#if it.url??> <#if it.url??>
@@ -51,6 +51,7 @@ public class CityInfo implements MongoEntity {
private Double priceCreditGte66Coverage; private Double priceCreditGte66Coverage;
private Double priceCreditGte60Coverage; private Double priceCreditGte60Coverage;
private Double priceCreditGte00Coverage; private Double priceCreditGte00Coverage;
private Integer districtAliasTotalCount;
@Id @Id
@GeneratedValue @GeneratedValue
@@ -378,4 +379,13 @@ public class CityInfo implements MongoEntity {
public void setPriceCreditGte00Coverage(Double priceCreditGte00Coverage) { public void setPriceCreditGte00Coverage(Double priceCreditGte00Coverage) {
this.priceCreditGte00Coverage = priceCreditGte00Coverage; this.priceCreditGte00Coverage = priceCreditGte00Coverage;
} }
@Column(name = "district_alias_total_count")
public Integer getDistrictAliasTotalCount() {
return districtAliasTotalCount;
}
public void setDistrictAliasTotalCount(Integer districtAliasTotalCount) {
this.districtAliasTotalCount = districtAliasTotalCount;
}
} }
@@ -347,6 +347,31 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
if(source.containsKey("status")){ if(source.containsKey("status")){
seawater.setStatus(source.getInt("status")); seawater.setStatus(source.getInt("status"));
} }
if(source.containsKey("lift")){
seawater.setLift(source.getInt("lift"));
}
if(source.containsKey("lift_household")){
seawater.setLiftHousehold(source.getInt("lift_household"));
}
if(source.containsKey("room_structure")){
seawater.setRoomStructure(source.getString("room_structure"));
}
if(source.containsKey("trade_property")){
seawater.setTradeProperty(source.getString("trade_property"));
}
if(source.containsKey("property_ownership")){
seawater.setPropertyOwnership(source.getString("property_ownership"));
}
if(source.containsKey("housing_age")){
seawater.setHousingAge(source.getString("housing_age"));
}
if(source.containsKey("elevator")){
seawater.setElevator(source.getString("elevator"));
}
seawaterList.add(seawater); seawaterList.add(seawater);
} }
return seawaterList; return seawaterList;
@@ -62,6 +62,13 @@ public class Seawater implements SeawaterEntity {
private String purpose; private String purpose;
private String estateType; private String estateType;
private String buildType; private String buildType;
private Integer lift;
private Integer liftHousehold;
private String roomStructure;//户型结构
private String tradeProperty; //交易权属
private String propertyOwnership; //房权所属 非共有
private String housingAge; //房屋年限 满二年
private String elevator; //配备电梯 有/无
@Id @Id
@Column(name = "_id") @Column(name = "_id")
@@ -325,4 +332,67 @@ public class Seawater implements SeawaterEntity {
public void setBuildType(String buildType) { public void setBuildType(String buildType) {
this.buildType = buildType; this.buildType = buildType;
} }
@Column(name = "lift")
public Integer getLift() {
return lift;
}
public void setLift(Integer lift) {
this.lift = lift;
}
@Column(name = "lift_household")
public Integer getLiftHousehold() {
return liftHousehold;
}
public void setLiftHousehold(Integer liftHousehold) {
this.liftHousehold = liftHousehold;
}
@Column(name = "room_structure")
public String getRoomStructure() {
return roomStructure;
}
public void setRoomStructure(String roomStructure) {
this.roomStructure = roomStructure;
}
@Column(name = "trade_property")
public String getTradeProperty() {
return tradeProperty;
}
public void setTradeProperty(String tradeProperty) {
this.tradeProperty = tradeProperty;
}
@Column(name = "property_ownership")
public String getPropertyOwnership() {
return propertyOwnership;
}
public void setPropertyOwnership(String propertyOwnership) {
this.propertyOwnership = propertyOwnership;
}
@Column(name = "housing_age")
public String getHousingAge() {
return housingAge;
}
public void setHousingAge(String housingAge) {
this.housingAge = housingAge;
}
@Column(name = "elevator")
public String getElevator() {
return elevator;
}
public void setElevator(String elevator) {
this.elevator = elevator;
}
} }
@@ -159,6 +159,9 @@ public class District implements SeaweedEntity {
private String landCarSite;// 地上车位数 private String landCarSite;// 地上车位数
private String undergroundCarSite;// 地下车位数 private String undergroundCarSite;// 地下车位数
private String landFloor;// 地上层数
private String undergroundFloor;// 地下层数
private String clearHeight;// 净高 private String clearHeight;// 净高
private String standardHeight;// 标准层高 private String standardHeight;// 标准层高
private String standardArea;// 标准层面积 private String standardArea;// 标准层面积
@@ -1873,4 +1876,22 @@ public class District implements SeaweedEntity {
public void setNameCat(Integer nameCat) { public void setNameCat(Integer nameCat) {
this.nameCat = nameCat; this.nameCat = nameCat;
} }
@Column(name = "land_floor")
public String getLandFloor() {
return landFloor;
}
public void setLandFloor(String landFloor) {
this.landFloor = landFloor;
}
@Column(name = "underground_floor")
public String getUndergroundFloor() {
return undergroundFloor;
}
public void setUndergroundFloor(String undergroundFloor) {
this.undergroundFloor = undergroundFloor;
}
} }
@@ -0,0 +1,264 @@
package com.fangjia.open.controllers;
import com.fangjia.core.util.HttpRequest;
import com.fangjia.open.dto.addressGovernance.*;
import com.fangjia.open.interceptors.Authority;
import com.fangjia.open.interceptors.Role;
import com.fangjia.open.model.AddesssMatchModel;
import com.fangjia.open.model.AddressModel;
import com.fangjia.open.model.BasicModel;
import com.fangjia.open.model.RestfulModelAndView;
import com.fangjia.open.util.CommonDtoUtils;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* 地址治理
*
* @author shenjian
* @since 2023/5/25
*/
@Authority(role = Role.USER)
public class AddrSvcController {
/**
* 地址结构化
*
* @param model
* @return
*/
public Object structureAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("address", model.getAddress());
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure/v2", params, "UTF-8");
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if (json.containsKey("result")) {
basicModel.setResult(CommonDtoUtils.transformV(StructureDto.class, json.get("result")));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
} catch (Exception e) {
e.printStackTrace();
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
/**
* 区划识别接口
*
* @param model
* @return
*/
public Object divisionAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("address", model.getAddress());
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8");
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if (json.containsKey("result")) {
basicModel.setResult(CommonDtoUtils.transformV(DistrictIdentifyDto.class, json.get("result")));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
} catch (Exception e) {
e.printStackTrace();
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
/**
* 地址补全
*/
public Object completeAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("address", model.getAddress());
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8");
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if (json.containsKey("result")) {
basicModel.setResult(CommonDtoUtils.transformV(StructureAndCompleteDto.class, json.get("result")));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
} catch (Exception e) {
e.printStackTrace();
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
/**
* 地址验证
*/
public Object addrVerifyAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("address", model.getAddress());
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/addrVerify", params, "UTF-8");
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if (json.containsKey("result")) {
basicModel.setResult(json.get("result"));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
} catch (Exception e) {
e.printStackTrace();
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
/**
* 地址匹配
*/
public Object matchAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("address", model.getAddress());
params.put("category", model.getCategory());
params.put("district", model.getSuggestDistrict());
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/match", params, "UTF-8");
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if (json.containsKey("result")) {
basicModel.setResult(CommonDtoUtils.transformV(MatchedBuildingDto.class, json.get("result")));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
} catch (Exception e) {
e.printStackTrace();
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
/**
* 地址联想
*/
public Object suggestionAction(AddressModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getCity())) {
mav.setModel(BasicModel.buildBadRequestModel("城市不能为空"));
return mav;
}
if (StringUtils.isBlank(model.getKeyword())) {
mav.setModel(BasicModel.buildBadRequestModel("关键字不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("region", model.getRegion());
params.put("keywords", model.getKeyword());
params.put("page", "0");
params.put("size", String.valueOf(model.getMax() == 0 ? 20 : (model.getMax() > 100 ? 100 : model.getMax())));
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/addressAssociation2", params, "UTF-8");
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if (json.containsKey("result")) {
JSONObject result = (JSONObject.fromObject(json.get("result")));
if (result.getInt("totalElements") > 0) {
basicModel.setResult(CommonDtoUtils.transformListV(DistrictDto.class, result.getJSONArray("content")));
}
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
} catch (Exception e) {
e.printStackTrace();
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
}
@@ -1,24 +1,5 @@
package com.fangjia.open.controllers; package com.fangjia.open.controllers;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.validation.Valid;
import com.fangjia.core.util.*; import com.fangjia.core.util.*;
import com.fangjia.open.model.*; import com.fangjia.open.model.*;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
@@ -56,27 +37,14 @@ import com.fangjia.open.OpenConfig;
import com.fangjia.open.dto.UniversalDto; import com.fangjia.open.dto.UniversalDto;
import com.fangjia.open.interceptors.Authority; import com.fangjia.open.interceptors.Authority;
import com.fangjia.open.interceptors.Role; import com.fangjia.open.interceptors.Role;
import com.fangjia.open.model.*;
import com.fangjia.service.address.AddressParser; import com.fangjia.service.address.AddressParser;
import com.fangjia.service.address.AddressParserService; import com.fangjia.service.address.AddressParserService;
import com.fangjia.service.address.AddressParserUtil; import com.fangjia.service.address.AddressParserUtil;
import com.fangjia.service.address.mode.Address; import com.fangjia.service.address.mode.*;
import com.fangjia.service.address.mode.AddressMatchMetaData;
import com.fangjia.service.address.mode.AddressParseResult;
import com.fangjia.service.address.mode.AddressParserGoal;
import com.fangjia.service.address.mode.AddressRate;
import com.fangjia.service.address.mode.Building;
import com.fangjia.service.address.mode.BuildingType;
import com.fangjia.service.address.mode.MatchParams;
import com.fangjia.service.address.mode.MatchText;
import com.fangjia.service.address.mode.PreciseLevel;
import com.fangjia.service.api.AddressMatchProxyService; import com.fangjia.service.api.AddressMatchProxyService;
import com.fangjia.service.api.BaiduApiService; import com.fangjia.service.api.BaiduApiService;
import com.fangjia.service.bo.AddressCheckBo; import com.fangjia.service.bo.*;
import com.fangjia.service.bo.AddressCheckTruth;
import com.fangjia.service.bo.AroundConsumeGradeBo;
import com.fangjia.service.bo.CheckMatchDistrictCorrectParam;
import com.fangjia.service.bo.CityParseBo;
import com.fangjia.service.bo.MatchDistrictResult;
import com.fangjia.service.datastore.CommDataService; import com.fangjia.service.datastore.CommDataService;
import com.fangjia.service.datastore.DistrictService; import com.fangjia.service.datastore.DistrictService;
import com.fangjia.service.datastore.EvaluationService; import com.fangjia.service.datastore.EvaluationService;
@@ -86,6 +54,31 @@ import com.fangjia.service.mongo.fangjia.ServerAreaService;
import com.fangjia.service.open.WaitCrawlKeywordsService; import com.fangjia.service.open.WaitCrawlKeywordsService;
import com.fangjia.service.sql.FjtEvaluationService; import com.fangjia.service.sql.FjtEvaluationService;
import com.fangjia.service.web.AddressService; import com.fangjia.service.web.AddressService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.TermQuery;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.validation.Valid;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Authority(role = Role.USER) @Authority(role = Role.USER)
public class AddressController { public class AddressController {
@@ -985,6 +978,14 @@ public class AddressController {
return term; return term;
} }
private JSONObject addMatchPhrase(String name, String value){
JSONObject term = new JSONObject();
JSONObject match = new JSONObject();
match.put(name, value);
term.put("match_phrase", match);
return term;
}
/*** /***
* »ñÈ¡×ÔÈ»´å * »ñÈ¡×ÔÈ»´å
* @param city * @param city
@@ -1837,6 +1838,7 @@ public class AddressController {
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity()); params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
params.put("address", model.getAddress()); params.put("address", model.getAddress());
params.put("showCode", model.getShowCode());
try{ try{
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8");
} catch(Exception e){ } catch(Exception e){
@@ -3321,20 +3323,26 @@ public class AddressController {
searchKey.append(searchAddress.getString("streetNumber")); searchKey.append(searchAddress.getString("streetNumber"));
} }
if (StringUtils.isNotBlank(searchKey.toString()) && searchAddress.has("city") && StringUtils.isNotBlank(searchAddress.getString("city"))) { if (StringUtils.isNotBlank(searchKey.toString()) && searchAddress.has("city") && StringUtils.isNotBlank(searchAddress.getString("city"))) {
JSONObject jsonObject = addressMatchProxyService.searchByAmap(searchAddress.getString("city"), model.getAddress()); // JSONObject jsonObject = addressMatchProxyService.searchByAmap(searchAddress.getString("city"), model.getAddress());
JSONArray poisData = jsonObject.getJSONArray("pois"); // JSONArray poisData = jsonObject.getJSONArray("pois");
for (int i = 0; i < poisData.size(); i++) { // for (int i = 0; i < poisData.size(); i++) {
String address = poisData.getJSONObject(i).getString("address"); // String address = poisData.getJSONObject(i).getString("address");
if (address.contains(searchKey.toString())) { // if (address.contains(searchKey.toString())) {
resultMap.put("riskLevel", "A"); // resultMap.put("riskLevel", "A");
resultModel.setResult(resultMap); // resultModel.setResult(resultMap);
mav.setModel(resultModel); // mav.setModel(resultModel);
return mav; // return mav;
} else { // } else {
continue; // continue;
} // }
// }
String city = searchAddress.getString("city");
List<JSONObject> poiList = this.findPois(city, searchKey.toString());
if (CollectionUtils.isNotEmpty(poiList)) {
resultMap.put("riskLevel", "A");
} else {
resultMap.put("riskLevel", "B");
} }
resultMap.put("riskLevel", "B");
resultModel.setResult(resultMap); resultModel.setResult(resultMap);
mav.setModel(resultModel); mav.setModel(resultModel);
return mav; return mav;
@@ -3351,6 +3359,44 @@ public class AddressController {
return mav; return mav;
} }
private List<JSONObject> findPois(String city, String address) {
JSONObject reqBody = new JSONObject();
reqBody.put("from", 0);
reqBody.put("size", 1);
JSONObject query = new JSONObject();
JSONObject bool = new JSONObject();
JSONArray must = new JSONArray();
must.add(addTerm("city", city));
must.add(addMatchPhrase("address", address));
bool.put("must", must);
query.put("bool", bool);
reqBody.put("query", query);
Base64 token = new Base64();
String authenticationEncoding = token.encodeAsString((""+ES_USER+":"+ES_PASSWORD+"").getBytes());
HttpRequest request = new HttpRequest();
Map<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json");
headers.put("Authorization", "Basic "+authenticationEncoding+"");
try {
String response = request.postWithBody("http://192.168.0.45:9200/association/_search", reqBody, headers, "UTF-8");
JSONObject json = JSONObject.fromObject(response);
if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("hits")){
return Collections.emptyList();
}
JSONArray hits = json.getJSONObject("hits").getJSONArray("hits");
List<JSONObject> results = new ArrayList<JSONObject>();
for(int i=0 ;i < hits.size(); i++){
JSONObject jsonObject = hits.getJSONObject(i);
results.add(jsonObject);
}
return results;
} catch (HttpRequestException e) {
e.printStackTrace();
}
return Collections.emptyList();
}
public void setAddressService(AddressService addressService) { public void setAddressService(AddressService addressService) {
this.addressService = addressService; this.addressService = addressService;
} }
@@ -208,7 +208,7 @@ public class HouseController {
} }
@Authority(role = Role.NONE) @Authority(role = Role.USER)
public Object similarAction(@Valid CollateralSampleQuery collateralSampleQuery){ public Object similarAction(@Valid CollateralSampleQuery collateralSampleQuery){
RestfulModelAndView mav = new RestfulModelAndView(); RestfulModelAndView mav = new RestfulModelAndView();
@@ -253,7 +253,7 @@ public class HouseController {
/**ÉÌÆÌÏàËÆ·¿Ô´½Ó¿Ú*/ /**ÉÌÆÌÏàËÆ·¿Ô´½Ó¿Ú*/
@Authority(role = Role.NONE) @Authority(role = Role.USER)
public Object shopSimilarAction(@Valid ShopCollateralSampleQuery query){ public Object shopSimilarAction(@Valid ShopCollateralSampleQuery query){
RestfulModelAndView mav = new RestfulModelAndView(); RestfulModelAndView mav = new RestfulModelAndView();
ShopCollateralSampleQueryBean queryBean = new ShopCollateralSampleQueryBean(); ShopCollateralSampleQueryBean queryBean = new ShopCollateralSampleQueryBean();
@@ -39,7 +39,7 @@ public class JnBankController {
private static final Pattern STAGE_PATTERN = Pattern.compile(".*[\\w东南北中西甲乙丙丁一二三四五六七八九十百千\\d]+(期|区)$"); private static final Pattern STAGE_PATTERN = Pattern.compile(".*[\\w东南北中西甲乙丙丁一二三四五六七八九十百千\\d]+(期|区)$");
@Authority(role = Role.NONE) @Authority(role = Role.USER)
public Object searchAction(@Valid JNBankSearchModel model){ public Object searchAction(@Valid JNBankSearchModel model){
RestfulModelAndView mav = new RestfulModelAndView(); RestfulModelAndView mav = new RestfulModelAndView();
@@ -0,0 +1,61 @@
package com.fangjia.open.controllers;
import com.fangjia.core.util.HttpRequest;
import com.fangjia.open.interceptors.Authority;
import com.fangjia.open.interceptors.Role;
import com.fangjia.open.model.AddesssMatchModel;
import com.fangjia.open.model.BasicModel;
import com.fangjia.open.model.RestfulModelAndView;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import java.util.HashMap;
import java.util.Map;
@Authority(role = Role.USER)
public class MeishubaoController {
/**
* 详细地址标准化接口
*
* @param model
* @return
*/
public Object financialRatingAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("address", model.getAddress());
try{
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/meishubao/financialRating", params, "UTF-8");
} catch(Exception e){
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/meishubao/financialRating", params, "UTF-8");
} catch(Exception ex){
ex.printStackTrace();
}
}
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if(json.containsKey("result")){
basicModel.setResult(json.get("result"));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
}
@@ -822,6 +822,111 @@ public class PropertyController {
return mav; return mav;
} }
public Object detail2Action(PropertySearchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
mav.setViewType("rest");
if (StringUtils.isBlank(model.getId())
&& (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getDistrict())
|| StringUtils.isBlank(model.getName()))
&& (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getDistrict())
|| StringUtils.isBlank(model.getAddress()))) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:请输入正确的参数组合"));
return mav;
}
District district = null;
if (StringUtils.isNotBlank(model.getId())){
if(ObjectId.isValid(model.getId())){
district = districtService.findById(model.getId());
}else{
mav.setModel(BasicModel.buildBadRequestModel("非法的住宅ID"));
return mav;
}
}
if (district == null && StringUtils.isNotBlank(model.getCity()) && StringUtils.isNotBlank(model.getDistrict())
&& StringUtils.isNotBlank(model.getName())) {
district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
"district");
if (district != null) {
district = districtService.findById(district.getId());
}
}
if (district == null && StringUtils.isNotBlank(model.getCity()) && StringUtils.isNotBlank(model.getDistrict())
&& StringUtils.isNotBlank(model.getAddress())) {
Map<String, Object> result = addressParser.parse2(model.getCity(), model.getAddress(), "district", false);
saveAddressMatchLog(result, model.getAddress(), model.getCity(), model.getToken());
Integer status = (Integer) result.get("status");
Integer precise = (Integer) result.get("precise");
if (status != null && status == 0 && precise == 0) {
String id = (String) result.get("id");
district = districtService.findById(id);
}
}
if (district != null) {
fieldFilterService.filterWithProcessNUll(district);
DistrictInfoDto districtInfoDto = new DistrictInfoDto();
districtInfoDto.setId(district.getId());
districtInfoDto.setCity(district.getCity());
districtInfoDto.setDistrict(district.getRegion());
districtInfoDto.setName(district.getName());
districtInfoDto.setAlias(district.getMappingAlias());
districtInfoDto.setAddress(district.getAddress());
districtInfoDto.setAddressAlias(district.getAddrAlias());
if (district.getLat2() != null && district.getLat2() != 0 && district.getLng2() != null
&& district.getLng2() != 0) {
districtInfoDto.setLat(district.getLat2() / 10000000000D);
districtInfoDto.setLng(district.getLng2() / 10000000000D);
}
districtInfoDto.setPropertyType(district.getEstateType2());
if (HouseValidator.validateBuildingType(district.getBuildType())) {
districtInfoDto.setBuildingType(district.getBuildType());
} else {
districtInfoDto.setBuildingType("");
}
districtInfoDto.setBlock(district.getBlock());
districtInfoDto.setTownship(district.getTownship());
if (district.getLoudongCount() != null && district.getLoudongCount() > 0) {
districtInfoDto.setBuildingCount(district.getLoudongCount());
}
if (district.getHouseholdCount() != null) {
districtInfoDto.setTotalUnitCount(SeaweedUtils.formatHouseholdCount(district.getHouseholdCount().toString()));
} else {
districtInfoDto.setTotalUnitCount("");
}
districtInfoDto.setManagementFee(district.getEstateCharge());
if (district.getCarSiteCount() != null) {
districtInfoDto.setParking(SeaweedUtils.formatCarSiteCount(district.getCarSiteCount().toString()));
} else {
districtInfoDto.setParking("");
}
districtInfoDto.setOwnershipPeriod(district.getPropertyLife());
districtInfoDto.setOwnershipType(district.getHouseProperty());
districtInfoDto.setBuildingStructure(district.getBuildStructure());
districtInfoDto.setLandProperty(district.getLandProperty());
districtInfoDto.setFloorSpace(SeaweedUtils.formatAllArea(district.getAllArea()));
districtInfoDto.setConstructionSpace(district.getBuildArea());
districtInfoDto.setPlotRatio(SeaweedUtils.formatCubagePercent(district.getCubagePercent()));
districtInfoDto.setGreenPercentage(SeaweedUtils.formatVirescencePercent(district.getVirescencePercent()));
districtInfoDto.setDeveloper(district.getDeveloper());
districtInfoDto.setPropertyManagement(district.getEstateCompany());
Integer finishYear = districtService.getCreateYear(district);
if (finishYear != null) {
districtInfoDto.setFinishYear(finishYear);
}
mav.setModel(BasicModel.buildOKModel().setResult(districtInfoDto));
return mav;
}
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
return mav;
}
private void saveAddressMatchLog(Map<String, Object> resMap, String keywords, String city, String token) { private void saveAddressMatchLog(Map<String, Object> resMap, String keywords, String city, String token) {
Map<String, String> tokenMap = FangjiaApiUtil.parseToken(token); Map<String, String> tokenMap = FangjiaApiUtil.parseToken(token);
String userName = null; String userName = null;
@@ -3563,11 +3668,11 @@ public class PropertyController {
} else { } else {
b.setDirection(""); b.setDirection("");
} }
if (house.getPics() != null && !house.getPics().isEmpty()) { // if (house.getPics() != null && !house.getPics().isEmpty()) {
b.setPic(transformPicsToFangJia(house.getPics().get(house.getPics().size() / 2))); // b.setPic(transformPicsToFangJia(house.getPics().get(house.getPics().size() / 2)));
} else { // } else {
b.setPic(""); // b.setPic("");
} // }
if (house.getPublishDate() != null) { if (house.getPublishDate() != null) {
if (new Date().before(house.getPublishDate())) { if (new Date().before(house.getPublishDate())) {
house.setPublishDate(house.getModificationDate()); house.setPublishDate(house.getModificationDate());
@@ -388,7 +388,8 @@ public class WeixinController {
return postImageMessage.format(); return postImageMessage.format();
}else{ }else{
PostTextMessage postMessage = new PostTextMessage( PostTextMessage postMessage = new PostTextMessage(
"亲爱的用户,感谢关注房价网官方微信"+"\n" +"1.发送“PDS”,申请试用PDS不动产大数据服务平台;"+"\n" +"2.发送小区名称,即可获得小区均价及详情;"+"\n"+"3.发送城市名称,即可获得城市二手房均价;"+"\n"+"4.发送“调查”,即可参与小区调查;"+"\n"+"更多内容请登陆www.fangjia.com"); "欢迎关注房价网!"+"\n" +"想了解我们的产品服务及更多企业级地址数据解决方案,可登录官网http://sh.fangjia.com/\n" +
"一对一在线人工咨询,可添加企业客服微信13816692251"+"\n"+"全国客服热线:400-188-3737"+"\n\n"+"市场品牌或渠道合作,发邮件至gujia@fangjia.com");
postMessage.setToUserName(receivedMessage.getFromUserName()); postMessage.setToUserName(receivedMessage.getFromUserName());
return postMessage.format(); return postMessage.format();
} }
@@ -150,12 +150,14 @@ public class DistrictController {
District district = null; District district = null;
if(StringUtils.isNotBlank(districtModel.getId())) { if(StringUtils.isNotBlank(districtModel.getId())) {
district = districtService.findById(districtModel.getId()); district = districtService.findById(districtModel.getId());
if(district != null) { if(district != null) {
districtModel.setCityName(district.getCity()); districtModel.setCityName(district.getCity());
districtModel.setRegion(district.getRegion()); districtModel.setRegion(district.getRegion());
districtModel.setName(district.getName()); districtModel.setName(district.getName());
} }
} else { } else {
System.out.println("小区详情2");
district = districtService.findByKeyMiniModel(districtModel.getCityName(), districtModel.getRegion(), districtModel.getName(), "district"); district = districtService.findByKeyMiniModel(districtModel.getCityName(), districtModel.getRegion(), districtModel.getName(), "district");
} }
@@ -100,6 +100,7 @@ public class DistrictInfoDto {
private Integer buildingCount; private Integer buildingCount;
private Integer finishYear; private Integer finishYear;
private String township; private String township;
private String landProperty;
public String getDistrict() { public String getDistrict() {
@@ -827,4 +828,12 @@ public class DistrictInfoDto {
public void setTownship(String township) { public void setTownship(String township) {
this.township = township; this.township = township;
} }
public String getLandProperty() {
return landProperty;
}
public void setLandProperty(String landProperty) {
this.landProperty = landProperty;
}
} }
@@ -0,0 +1,50 @@
package com.fangjia.open.dto.addressGovernance;
public class DistrictDto {
private String province;
private String city;
private String region;
private String name;
private String address;
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
@@ -0,0 +1,101 @@
package com.fangjia.open.dto.addressGovernance;
/**
* Çø»®Ê±ðDTO
*
* @author shenjian
* @since 2023/5/25
*/
public class DistrictIdentifyDto {
private String province;
private String provinceCode;
private String city;
private String cityCode;
private String district;
private String districtCode;
private String township;
private String townshipCode;
private String community;
private String communityCode;
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getProvinceCode() {
return provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getDistrictCode() {
return districtCode;
}
public void setDistrictCode(String districtCode) {
this.districtCode = districtCode;
}
public String getTownship() {
return township;
}
public void setTownship(String township) {
this.township = township;
}
public String getTownshipCode() {
return townshipCode;
}
public void setTownshipCode(String townshipCode) {
this.townshipCode = townshipCode;
}
public String getCommunity() {
return community;
}
public void setCommunity(String community) {
this.community = community;
}
public String getCommunityCode() {
return communityCode;
}
public void setCommunityCode(String communityCode) {
this.communityCode = communityCode;
}
}
@@ -0,0 +1,128 @@
package com.fangjia.open.dto.addressGovernance;
/**
* 地址匹配DTO
*/
public class MatchedBuildingDto {
/**
* ID
*/
private String id;
/**
* 置信度
*/
private Double credit;
/**
* 城市
*/
private String city;
/**
* 区域
*/
private String district;
/**
* 乡镇街道
*/
private String township;
/**
* 建筑物名称
*/
private String name;
/**
* 建筑物地址
*/
private String address;
/**
* 经度(高德)
*/
private Double lng;
/**
* 纬度(高德)
*/
private Double lat;
/**
* 物业类型
*/
private String propertyType;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Double getCredit() {
return credit;
}
public void setCredit(Double credit) {
this.credit = credit;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getTownship() {
return township;
}
public void setTownship(String township) {
this.township = township;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Double getLng() {
return lng;
}
public void setLng(Double lng) {
this.lng = lng;
}
public Double getLat() {
return lat;
}
public void setLat(Double lat) {
this.lat = lat;
}
public String getPropertyType() {
return propertyType;
}
public void setPropertyType(String propertyType) {
this.propertyType = propertyType;
}
}
@@ -0,0 +1,203 @@
package com.fangjia.open.dto.addressGovernance;
/**
* 地址补全DTO
*
* @author shenjian
* @since 2023/5/25
*/
public class StructureAndCompleteDto {
/**
* 省份
*/
private String province;
/**
* 城市
*/
private String city;
/**
* 区域
*/
private String district;
/**
* 开发区
*/
private String dev;
/**
* 乡镇街道
*/
private String township;
/**
* 道路
*/
private String street;
/**
* 路号
*/
private String streetNumber;
/**
* 居委村委
*/
private String community;
/**
* 村组
*/
private String group;
/**
* 名称
*/
private String name;
/**
* 楼栋
*/
private String buildingNumber;
/**
* 单元
*/
private String unitNumber;
/**
* 楼层
*/
private String floor;
/**
* 室号
*/
private String roomNumber;
/**
* 格式化地址
*/
private String formatAddress;
/**
* 地址验证
*/
private String addrVerify;
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getDev() {
return dev;
}
public void setDev(String dev) {
this.dev = dev;
}
public String getTownship() {
return township;
}
public void setTownship(String township) {
this.township = township;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getStreetNumber() {
return streetNumber;
}
public void setStreetNumber(String streetNumber) {
this.streetNumber = streetNumber;
}
public String getCommunity() {
return community;
}
public void setCommunity(String community) {
this.community = community;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBuildingNumber() {
return buildingNumber;
}
public void setBuildingNumber(String buildingNumber) {
this.buildingNumber = buildingNumber;
}
public String getUnitNumber() {
return unitNumber;
}
public void setUnitNumber(String unitNumber) {
this.unitNumber = unitNumber;
}
public String getFloor() {
return floor;
}
public void setFloor(String floor) {
this.floor = floor;
}
public String getRoomNumber() {
return roomNumber;
}
public void setRoomNumber(String roomNumber) {
this.roomNumber = roomNumber;
}
public String getFormatAddress() {
return formatAddress;
}
public void setFormatAddress(String formatAddress) {
this.formatAddress = formatAddress;
}
public String getAddrVerify() {
return addrVerify;
}
public void setAddrVerify(String addrVerify) {
this.addrVerify = addrVerify;
}
}
@@ -0,0 +1,191 @@
package com.fangjia.open.dto.addressGovernance;
/**
* 地址结构化,请不要增加其他字段,与文档及地数输出一致
*
* @author shenjian
* @since 2023/5/25
*/
public class StructureDto {
/**
* 省份
*/
private String province;
/**
* 城市
*/
private String city;
/**
* 区域
*/
private String district;
/**
* 开发区
*/
private String dev;
/**
* 乡镇街道
*/
private String township;
/**
* 道路
*/
private String street;
/**
* 路号
*/
private String streetNumber;
/**
* 居委村委
*/
private String community;
/**
* 村组
*/
private String group;
/**
* 名称
*/
private String name;
/**
* 楼栋
*/
private String buildingNumber;
/**
* 单元
*/
private String unitNumber;
/**
* 楼层
*/
private String floor;
/**
* 室号
*/
private String roomNumber;
/**
* 地址验证
*/
private String addrVerify;
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getDev() {
return dev;
}
public void setDev(String dev) {
this.dev = dev;
}
public String getTownship() {
return township;
}
public void setTownship(String township) {
this.township = township;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getStreetNumber() {
return streetNumber;
}
public void setStreetNumber(String streetNumber) {
this.streetNumber = streetNumber;
}
public String getCommunity() {
return community;
}
public void setCommunity(String community) {
this.community = community;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBuildingNumber() {
return buildingNumber;
}
public void setBuildingNumber(String buildingNumber) {
this.buildingNumber = buildingNumber;
}
public String getUnitNumber() {
return unitNumber;
}
public void setUnitNumber(String unitNumber) {
this.unitNumber = unitNumber;
}
public String getFloor() {
return floor;
}
public void setFloor(String floor) {
this.floor = floor;
}
public String getRoomNumber() {
return roomNumber;
}
public void setRoomNumber(String roomNumber) {
this.roomNumber = roomNumber;
}
public String getAddrVerify() {
return addrVerify;
}
public void setAddrVerify(String addrVerify) {
this.addrVerify = addrVerify;
}
}
@@ -22,6 +22,8 @@ public class AddesssMatchModel extends FangjiaApiModel {
private String address_1; private String address_1;
private String address_2; private String address_2;
private String showCode;
public String getAddress_1() { public String getAddress_1() {
return address_1; return address_1;
} }
@@ -134,4 +136,12 @@ public class AddesssMatchModel extends FangjiaApiModel {
public void setDebugName(String debugName) { public void setDebugName(String debugName) {
this.debugName = debugName; this.debugName = debugName;
} }
public String getShowCode() {
return showCode;
}
public void setShowCode(String showCode) {
this.showCode = showCode;
}
} }
@@ -23,6 +23,7 @@ public class AddressModel extends FangjiaApiModel {
private String preciseLevel; private String preciseLevel;
private String province; private String province;
private String district; private String district;
private String region;
private String chooseId; private String chooseId;
@@ -36,6 +37,9 @@ public class AddressModel extends FangjiaApiModel {
private Integer pageNo; private Integer pageNo;
// 是否用于检查 // 是否用于检查
private String dataLevel; private String dataLevel;
private String keyword;
public boolean isContainsLocation() { public boolean isContainsLocation() {
return containsLocation; return containsLocation;
} }
@@ -229,4 +233,19 @@ public class AddressModel extends FangjiaApiModel {
this.dataLevel = dataLevel; this.dataLevel = dataLevel;
} }
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
} }
@@ -45,6 +45,19 @@ public class BHBankUtils {
put("22","³çÃ÷"); put("22","³çÃ÷");
}}; }};
//房屋类型传参
public static Map<String, String > houseTypeMap = new HashMap<String, String>(){{
put("8","公寓");
put("4","独立别墅");
put("5","双拼别墅");
put("6","联排别墅");
put("7","叠加别墅");
put("9","联列住宅");
put("10","花园住宅");
put("11","旧式里弄2");
put("0","其它");
}};
public static List<JSONObject> getDistrictByBhbank(String address){ public static List<JSONObject> getDistrictByBhbank(String address){
List<JSONObject> list = new ArrayList<JSONObject>(); List<JSONObject> list = new ArrayList<JSONObject>();
try { try {
@@ -116,6 +129,10 @@ public class BHBankUtils {
if(StringUtils.isNotBlank(ev.getRoomNum())){ if(StringUtils.isNotBlank(ev.getRoomNum())){
params.put("houseNo",ev.getRoomNum()); params.put("houseNo",ev.getRoomNum());
} }
if(StringUtils.isNotBlank(String.valueOf(ev.getBuildType()))){
params.put("houseType",houseTypeMap.get(String.valueOf(ev.getBuildType())));
}
if(ev.getHouseArea()>0){ if(ev.getHouseArea()>0){
if(ev.getBasementArea()!=null && ev.getBasementArea()>0){ if(ev.getBasementArea()!=null && ev.getBasementArea()>0){
double area = ev.getHouseArea() - ev.getBasementArea(); double area = ev.getHouseArea() - ev.getBasementArea();
@@ -141,7 +158,7 @@ public class BHBankUtils {
params.put("groupName", usersDetail.getOrgName()); params.put("groupName", usersDetail.getOrgName());
List<String> lists = Arrays.asList("queryFullAddr", "preCode", "preName", "countryCode", "buildName", "unitCode","floor","totalFloor","houseNo","groundArea","undergroundArea","orientName","buildYear","dealPriceTotal","specialNo","userName","userPhone","userMail","groupName"); List<String> lists = Arrays.asList("queryFullAddr", "preCode", "preName", "countryCode", "buildName", "unitCode","floor","totalFloor","houseNo","groundArea","undergroundArea","orientName","buildYear","dealPriceTotal","specialNo","userName","userPhone","userMail","groupName","houseType");
String s = ""; String s = "";
for(String key : lists){ for(String key : lists){
@@ -0,0 +1,41 @@
package com.fangjia.open.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
/**
* 通用实体与DTO互相转换工具类
*
* @author shenjian
* @date 2021/06/16
*/
public class CommonDtoUtils {
public static <T> T transformV(Class<T> targetClass, Object source) {
if (source == null) {
return null;
} else {
try {
String jsonSource = JSON.toJSONString(source);
return JSONObject.parseObject(jsonSource, targetClass);
} catch (Exception var3) {
return null;
}
}
}
public static <T> List<T> transformListV(Class<T> targetClass, List<?> listSource) {
if (listSource == null) {
return null;
} else {
try {
String jsonSource = JSON.toJSONString(listSource);
return JSONArray.parseArray(jsonSource, targetClass);
} catch (Exception var3) {
return null;
}
}
}
}
@@ -43,5 +43,11 @@
<ladder>/address/fiveDivisionStructure</ladder> <ladder>/address/fiveDivisionStructure</ladder>
</ladders> </ladders>
</rule> </rule>
<rule controller="property" action="detail2" channel="v2">
<ladders>
<ladder>/property/detail</ladder>
</ladders>
</rule>
</rules> </rules>
</urlrewrite> </urlrewrite>
@@ -8,12 +8,19 @@ import com.fangjia.datastore.driver.DataStore
import com.fangjia.script.BaseBatch import com.fangjia.script.BaseBatch
import com.fangjia.script.BatchOwner import com.fangjia.script.BatchOwner
import com.fangjia.script.Watcher import com.fangjia.script.Watcher
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.MongoUtils import com.fangjia.script.util.MongoUtils
import com.fangjia.script.util.ServerAreaMap import com.fangjia.script.util.ServerAreaMap
import com.mongodb.BasicDBObject import com.mongodb.BasicDBObject
import com.mongodb.DBCollection import com.mongodb.DBCollection
import com.mongodb.DBObject import com.mongodb.DBObject
import java.util.concurrent.CountDownLatch
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicLong
/** /**
* Created by dxy on 2016/12/15. * Created by dxy on 2016/12/15.
*/ */
@@ -23,17 +30,23 @@ class DistrictStatRankBatch extends BaseBatch {
private static final DSCollection SEAWEED = new DataStore("seaweed.db.fangjia.com", 27007).getCollection("fangjia.seaweed") private static final DSCollection SEAWEED = new DataStore("seaweed.db.fangjia.com", 27007).getCollection("fangjia.seaweed")
public static final DBCollection DIST_STAT_COLL = MongoUtils.getCollectionByName("fangjia_stat", "district_stat", "mongo.db.fangjia.com") public static final DBCollection DIST_STAT_COLL = MongoUtils.getCollectionByName("fangjia_stat", "district_stat", "mongo.db.fangjia.com")
private static final DBCollection DISTRICT_ANALY_DATA_COLL = MongoUtils.getCollectionByName("fangjia_stat", "district_analy_data", "mongo.db.fangjia.com") private static final DBCollection DISTRICT_ANALY_DATA_COLL = MongoUtils.getCollectionByName("fangjia_stat", "district_analy_data", "mongo.db.fangjia.com")
public static final DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com")
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
def DISTRICT_STAT_MAP = [:] def DISTRICT_STAT_MAP = [:]
public void process(Object args) { public void process(Object args) {
def cities = ServerAreaMap.findAllCities()
def cities = ["深圳"]//ServerAreaMap.findAllCities()
for(String city : cities) { for(String city : cities) {
DISTRICT_STAT_MAP.clear() // DISTRICT_STAT_MAP.clear()
Map<String, List<String>> regions = RegionData.getAllRegions(city) // Map<String, List<String>> regions = RegionData.getAllRegions(city)
regions.each {region, alias-> // regions.each {region, alias->
processRegionRank(city, region) // processRegionRank(city, region)
} // }
processCityRank(city) // processCityRank(city)
processCityRentRank(city)
} }
} }
@@ -257,6 +270,81 @@ class DistrictStatRankBatch extends BaseBatch {
return ret return ret
} }
def processCityRentRank(city){
def lastMonth = DateUtil.formatByPattern(DateUtil.getLastEndMonthDate(new Date()),"yyyyMMdd")
def distRentsMap = CommonDatautils.findSqmetreRentByCityAndDate(city, lastMonth)
def prices = []
distRentsMap.each{key, price->
if(!prices.contains(price)){
prices << price
}
}
// prices = prices.unique()
prices = prices.sort().reverse()
def totalCount = new AtomicLong()
def keys = distRentsMap.keySet().asList()
final CountDownLatch latch = new CountDownLatch(keys.size())
// for(def i=0;i<keys.size();i++){
// final def key = keys[i]
// fixedThreadPool.execute(new Runnable() {
// void run() {
// try {
// totalCount.addAndGet(1)
// upateDistrict(key, distRentsMap, prices)
// println totalCount.get()+" "+ key
// } catch (Exception e) {
// e.printStackTrace()
// } finally {
// latch.countDown()
// }
// }
// })
// }
// latch.await()
def index = 0
distRentsMap.each{key, price->
index ++
def arrs = key.split("##");
double percentile = calculatePercentile(prices, price);
DBObject q = new BasicDBObject("city", arrs[0])
q.append("region", arrs[1])
q.append("district_name", arrs[2])
DBObject udata = new BasicDBObject()
udata.put("rent_city_rank", (int)percentile);
udata.put("m_date", new Date())
DISTRICT_ANALY_DATA_COLL.update(q, new BasicDBObject('$set', udata), false, false)
println index +" "+ arrs[2]
}
}
def upateDistrict(key, distRentsMap, prices){
def arrs = key.split("##");
def price = distRentsMap.get(key)
double percentile = calculatePercentile(prices, price);
DBObject q = new BasicDBObject("city", arrs[0])
q.append("region", arrs[1])
q.append("district_name", arrs[2])
DBObject udata = new BasicDBObject()
udata.put("rent_city_rank", (int)percentile);
udata.put("m_date", new Date())
// DISTRICT_ANALY_DATA_COLL.update(q, new BasicDBObject('$set', udata), false, false)
}
public static int calculatePercentile(def values, def targetValue) {
// 找出数字在List中的排名
def rank = values.indexOf(targetValue) + 1
// 计算百分位数
def percentile = (int)((rank / values.size()) * 100)
return percentile;
}
static main(args) { static main(args) {
runBatch(new DistrictStatRankBatch(), args) runBatch(new DistrictStatRankBatch(), args)
@@ -6,10 +6,44 @@ import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject import com.mongodb.BasicDBObject
import com.mongodb.DBCollection import com.mongodb.DBCollection
def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\深圳三月份成交数据.xls", 0, 1) /**
* 深圳公众号成交数据录入
*/
def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\深圳4月份二手房成交数据汇总.xls", 0, 1)
def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017"; def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017";
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl) DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
//没有成交时间,随机生成
//for(def d : datas){
// def map = new BasicDBObject()
// map.city = "深圳"
// map.district_name = d['D']
// map.region = d['B']
// def roomStr = d['E']
// if(roomStr){
// def arrs = roomStr.split("-")
// try{
// map.room = arrs[0].toString().toInteger()
// }catch(Exception e){
// println "room error"
// }
// map.hall = arrs[1].toString().toInteger()
// map.toilet = arrs[3].toString().toInteger()
// }
//
// map.area = d['F'].toString().toDouble()
// map.total_price = (int)(d['G'].toString().toDouble().toInteger()*10000)
// map.avg_price = (int)(d['H'].toString().toDouble()*10000)
// def trade_date = DateUtils.getRandomDate("2023-04-01", "2023-04-30")
// map.trade_date = DateUtils.parseFromTightByPattern(trade_date, "yyyy-MM-dd")
// map.source = "深房家族"
// map.create_date = new Date()
// map.m_date = new Date()
// DEAL_PRICE_COLL.save(map)
//}
for(def d : datas){ for(def d : datas){
def map = new BasicDBObject() def map = new BasicDBObject()
map.city = "ÉîÛÚ" map.city = "ÉîÛÚ"
@@ -17,17 +51,15 @@ for(def d : datas){
map.region = d['B'] map.region = d['B']
def roomStr = d['E'] def roomStr = d['E']
if(roomStr){ if(roomStr){
def arrs = roomStr.split("-") map.room = roomStr.toString().toDouble().toInteger()
map.room = arrs[0].toString().toInteger()
map.hall = arrs[1].toString().toInteger()
map.toilet = arrs[3].toString().toInteger()
} }
map.area = d['F'].toString().toDouble() map.area = d['F'].toString().toDouble()
map.total_price = (int)(d['G'].toString().toDouble().toInteger()*10000) map.total_price = (int)(d['G'].toString().toDouble().toInteger()*10000)
map.avg_price = (int)(d['H'].toString().toDouble()*10000) map.avg_price = (int)(d['H'].toString().toDouble())
def trade_date = DateUtils.getRandomDate("2023-03-01", "2023-03-31") map.sell_price = (int)(d['I'].toString().toDouble()*10000)
map.trade_date = DateUtils.parseFromTightByPattern(trade_date, "yyyy-MM-dd") def trade_date = d['J']
map.trade_date = trade_date
map.source = "Éî·¿¼Ò×å" map.source = "Éî·¿¼Ò×å"
map.create_date = new Date() map.create_date = new Date()
map.m_date = new Date() map.m_date = new Date()
@@ -56,6 +56,7 @@ class BigdataCommbuildtypeBatch extends BaseBatch{
FileUtils.batchCreateFile(rets, fileName,headers, "utf-8", false); FileUtils.batchCreateFile(rets, fileName,headers, "utf-8", false);
println "txt 生成->导Oracle" println "txt 生成->导Oracle"
delPgData()
saveToPgSql(rets) saveToPgSql(rets)
} }
@@ -110,6 +111,11 @@ class BigdataCommbuildtypeBatch extends BaseBatch{
return rets; return rets;
} }
def delPgData(){
sqlInstance.execute("delete from base.t0831_bigdata_commbuildtype_gj_h")
println "base.t0831_bigdata_commbuildtype_gj_h 数据已删除"
}
def saveToPgSql(rows){ def saveToPgSql(rows){
def sqls = [] def sqls = []
@@ -80,8 +80,8 @@ class BigdataCommunityBatch extends BaseBatch{
// delPgData() // delPgData()
// saveToPgSql(rows) // saveToPgSql(rows)
// ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\bigdata_community.xlsx", allDatas, "数据")
// ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\bigdata_community.xlsx", allDatas, "数据")
// def datas = readTxt("d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_COMMUNITY_GJ.dat") // def datas = readTxt("d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_COMMUNITY_GJ.dat")
// delPgData() // delPgData()
// saveToPgSql2(datas) // saveToPgSql2(datas)
@@ -259,7 +259,7 @@ class BigdataCommunityBatch extends BaseBatch{
println "start: "+new Date() println "start: "+new Date()
def sql = "insert into base.t0831_bigdata_community_gj_h values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" def sql = "insert into base.t0831_bigdata_community_gj_h values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
sqlInstance.withBatch(1, sql){ ps-> sqlInstance.withBatch(50000, sql){ ps->
for(def r : rows) { for(def r : rows) {
try{ try{
ps.addBatch(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15], r[16], r[17], r[18], r[19], r[20], ps.addBatch(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15], r[16], r[17], r[18], r[19], r[20],
@@ -65,9 +65,9 @@ class BigdataDealBatch extends BaseBatch{
if(args && args.size()>=2){ if(args && args.size()>=2){
curDate = args[1].toString().toInteger() curDate = args[1].toString().toInteger()
} }
println "curDate:"+curDate println "curDate:"+curDate
for(def city : citys){ def allCitys = CommonDatautils.findAllCity()
for(def city : allCitys){
// if(!ccbCitys.contains(city)){ // if(!ccbCitys.contains(city)){
addDealPriceMatch(city); addDealPriceMatch(city);
// } // }
@@ -643,7 +643,7 @@ class BigdataDealBatch extends BaseBatch{
def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd")) def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
// def startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern("20210101", "yyyyMMdd")) // def startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern("20210101", "yyyyMMdd"))
// def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20221001", "yyyyMMdd")) // def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20221001", "yyyyMMdd"))
def trades = CcbCommonUtils.findTradesByMonth(city, startDate, endDate) def trades = CcbCommonUtils.findTradesByMonth(city, startDate)
final CountDownLatch latch = new CountDownLatch(trades.size()) final CountDownLatch latch = new CountDownLatch(trades.size())
def final AtomicInteger count_ = new AtomicInteger(0) def final AtomicInteger count_ = new AtomicInteger(0)
@@ -666,7 +666,7 @@ class BigdataDealBatch extends BaseBatch{
rMap = SeaweedDataMatchProcess.doMatch(t.city, region, null, t.address); rMap = SeaweedDataMatchProcess.doMatch(t.city, region, null, t.address);
} }
} }
if(rMap){ if(rMap && rMap.region==region){
CcbCommonUtils.updateDealPrice(t._id, rMap.city, rMap.region, rMap.name, rMap.id) CcbCommonUtils.updateDealPrice(t._id, rMap.city, rMap.region, rMap.name, rMap.id)
} }
} }
@@ -91,7 +91,7 @@ class BigdataForsaleBatch extends BaseBatch{
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
def districts = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "lng","estate_type2","name_cat","address", "alias", "finish_building_date", "house_property", "property_life", "build_type", "build_structure"]); def districts = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "lng","estate_type2","name_cat","address", "alias", "finish_building_date", "house_property", "property_life", "build_type", "build_structure"]);
// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20230118, 20230219); // exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20230118, 20230219);
exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20230318, 20230419, houseIdsfilter); exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20230418, 20230519, houseIdsfilter);
//测试通过匹配接口配房源效果 //测试通过匹配接口配房源效果
// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20201201, 20211118) // exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20201201, 20211118)
} }
@@ -203,7 +203,7 @@ class BigdataForsaleBatch extends BaseBatch{
} }
} }
println totalCount.get() +" "+city+" "+rMap.region+" "+rMap.name+" size:"+ret.size()+" "+new Date().toLocaleString() println totalCount.get() +" "+city+" "+rMap.region+" "+rMap.name+" 原始:"+ret.size()+" 过滤后:"+retMap.size()
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace() e.printStackTrace()
@@ -1127,6 +1127,7 @@ class BigdataForsaleBatch extends BaseBatch{
return count; return count;
} }
def saveToPgSql(rows){ def saveToPgSql(rows){
for(def r : rows) { for(def r : rows) {
for (def i = 0; i < r.size(); i++) { for (def i = 0; i < r.size(); i++) {
@@ -218,6 +218,7 @@ class CcbCommonUtils {
q.put("avg_price", new BasicDBObject('$gt', 0)) q.put("avg_price", new BasicDBObject('$gt', 0))
q.put("trade_date", new BasicDBObject('$gte', startDate).append('$lte',endDate)) q.put("trade_date", new BasicDBObject('$gte', startDate).append('$lte',endDate))
q.put("match_id", dist._id.toString()) q.put("match_id", dist._id.toString())
q.put("type", new BasicDBObject('$ne','车位'))
def dbcursor = DEAL_PRICE_COLL.find(q) def dbcursor = DEAL_PRICE_COLL.find(q)
def total = dbcursor.count() def total = dbcursor.count()
def rets = new HashSet() def rets = new HashSet()
@@ -430,8 +431,8 @@ class CcbCommonUtils {
q.put("visible",0) q.put("visible",0)
q.put("cat", cat); q.put("cat", cat);
q.put("city", city); q.put("city", city);
q.put("c_date", new BasicDBObject('$lt', DateUtils.parseFromTightYYYYMMDD("2023-05-01")))//因5月1日新增过多,所以暂且先去掉 // q.put("c_date", new BasicDBObject('$lt', DateUtils.parseFromTightYYYYMMDD("2023-05-01")))//因5月1日新增过多,所以暂且先去掉 此批数据改为name_cat=13
// q.put("name","锦南浦三小区") // q.put("name","金地玺湾")
// q.put("name_cat", 0); // q.put("name_cat", 0);
// q.put("estate_type2", new BasicDBObject('$in', ["普通住宅","商住"])) // q.put("estate_type2", new BasicDBObject('$in', ["普通住宅","商住"]))
@@ -445,12 +446,17 @@ class CcbCommonUtils {
def dbsour = DBUtils.seaweed.find(q,keys).batchSize(2000) def dbsour = DBUtils.seaweed.find(q,keys).batchSize(2000)
println "[${city}] 原始:"+dbsour.count() println "[${city}] 原始:"+dbsour.count()
def rets = [] def rets = []
def ids = []
for(def d : dbsour){ for(def d : dbsour){
if(d.name_cat == 0 && d.lng && ["普通住宅","商住"].contains(d.estate_type2) && !d.name.contains("洋房") && !d.name.contains("公房")){ if(d.name_cat == 0 && d.lng && ["普通住宅","商住"].contains(d.estate_type2) && !d.name.contains("洋房") && !d.name.contains("公房")){
if(d.address){ if(d.address){
d.address = d.address.replaceAll("\r|\n|\\s", ""); d.address = d.address.replaceAll("\r|\n|\\s", "");
} }
rets << d if(!ids.contains(d._id.toString())){
ids << d._id.toString()
rets << d
}
} }
} }
println "[${city}] 小区量:"+rets.size() println "[${city}] 小区量:"+rets.size()
@@ -606,11 +612,12 @@ class CcbCommonUtils {
public static def findTradesByMonth(city, startDate, endDate){ public static def findTradesByMonth(city, startDate){
def q = new BasicDBObject() def q = new BasicDBObject()
q.put("city", city) q.put("city", city)
q.put("trade_date", new BasicDBObject('$gte', startDate).append('$lte',endDate)) q.put("trade_date", new BasicDBObject('$gte', startDate))
q.put("match_id", new BasicDBObject('$exists', false)) q.put("match_id", new BasicDBObject('$exists', false))
// q.put("district_name","国贸天琴湾")
def dbcursor = DEAL_PRICE_COLL.find(q) def dbcursor = DEAL_PRICE_COLL.find(q)
def total = dbcursor.count() def total = dbcursor.count()
def rets = new HashSet() def rets = new HashSet()
@@ -28,9 +28,11 @@ class DealPriceDataProcess {
def task = new DealPriceDataProcess() def task = new DealPriceDataProcess()
// task.process()//运当成交pe值不好时行,拉升成交价格及删除pe太大数据 // task.process()//运当成交pe值不好时行,拉升成交价格及删除pe太大数据
// task.addLianJiaPrice(); // task.addLianJiaPrice();
task.deleteThirdPartyData() // task.deleteThirdPartyData()//删除第三方
// task.delDealByPe() // task.delDealByPe()
// task.delDealData() // task.delDealData()
task.exportThirdParty()
} }
def delDealByPe(){ def delDealByPe(){
@@ -372,15 +374,29 @@ class DealPriceDataProcess {
return map return map
} }
def exportThirdParty(){
def citys = CcbCommonUtils.citys_all
def results = []
results << ['城市id','城市名称','第三方id','区域','小区id','小区名称','计算类型','计算价格','成交价格','PPE']
for(def city : citys) {
def rets = findPeGteThirdParty3(city, 202305)
for(def map : rets){
results << [map.cityid, map.city, map.data_id, map.region, map.comm_id, map.district_name, map.type, map.clc_price, map.price, map.ppe]
}
println city +" "+ rets.size()
}
ExcelUtils.write("D:\\数据\\建行\\房产估值\\第三方\\202305第三方测试偏差较大案例统计数据.xlsx", results,"第三方")
}
def deleteThirdPartyData(){ def deleteThirdPartyData(){
def citys = CcbCommonUtils.citys_all def citys = CcbCommonUtils.citys_all
def month = 202303 def month = 202304
def rows = [] def rows = []
def cityCodeDatas = CcbCommonUtils.findCityCodeValue() def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
def set = new HashSet() def set = new HashSet()
for(def city : citys) { for(def city : citys) {
def rets = findPeGteThirdParty2(city, 202304) def rets = findPeGteThirdParty2(city, 202305)
def total = 0 def total = 0
println city +" "+rets.size() println city +" "+rets.size()
if(rets){ if(rets){
@@ -431,6 +447,28 @@ class DealPriceDataProcess {
return rets return rets
} }
//城市id 城市名称 成交id 区域 小区id 小区名称 计算类型 计算价格 成交价格 PPE
def findPeGteThirdParty3(cityName, yearmonth){
def sql = "SELECT urbn_id, urbn_nm, gujia_fsid,gujia_rgon_nm, gujia_comm_id,gujia_comm_nm,gujia_bds_clc_tp,gujia_bds_avprc,gujiabds_to_mkprc_mny,gujia_mns_rto from t_app_p9pha_plda.avm_evaluation_item_gj_h where gujiabds_clc_yrmo_val=${yearmonth} and gujia_data_tp='第三方' and urbn_nm='${cityName}' and gujia_mns_rto>15"
def rets = []
pgsqlInstance.eachRow(sql,{r->
def map = [:]
map.cityid = r.urbn_id
map.city = r.urbn_nm
map.data_id = r.gujia_fsid
map.region = r.gujia_rgon_nm
map.comm_id = r.gujia_comm_id
map.district_name = r.gujia_comm_nm
map.type = r.gujia_bds_clc_tp
map.clc_price = r.gujia_bds_avprc
map.price = r.gujiabds_to_mkprc_mny
map.ppe = r.gujia_mns_rto
rets << map
});
return rets
}
def delDealData(){ def delDealData(){
ExcelUtils.modify("D:\\数据\\建行\\房产估值\\成交\\杭州成交删除12-23.xlsx", { d -> ExcelUtils.modify("D:\\数据\\建行\\房产估值\\成交\\杭州成交删除12-23.xlsx", { d ->
@@ -79,9 +79,9 @@ class ExportOracleAllDataTest {
// exportCommCaseDetailGj()// // exportCommCaseDetailGj()//
// // ok文件 // // ok文件
exportInOk() // exportInOk()
SSHHelperTest jschCommand = new SSHHelperTest(); // SSHHelperTest jschCommand = new SSHHelperTest();
System.out.println(jschCommand.executeCommand("sh /home/ccb_evaluation/output/eval_package.sh ${curDate}")); // System.out.println(jschCommand.executeCommand("sh /home/ccb_evaluation/output/eval_package.sh ${curDate}"));
} }
@@ -33,7 +33,7 @@ class FjwPricePkCcbPrice {
def task = new FjwPricePkCcbPrice() def task = new FjwPricePkCcbPrice()
// task.run() // task.run()
// task.updatePrice() // task.updatePrice()
// task.addFjwPrice() task.addFjwPrice()
// task.addCcbPrice()//oracle // task.addCcbPrice()//oracle
// task.addCcbPriceFromGuided() // task.addCcbPriceFromGuided()
@@ -42,7 +42,7 @@ class FjwPricePkCcbPrice {
// task.exportFjwPriceAndCcbPrice() // task.exportFjwPriceAndCcbPrice()
// task.addNewDistPrice() // task.addNewDistPrice()
task.addCcbPrice2()//按id查 // task.addCcbPrice2()//按id查
// task.addCcbPrice3()//°´city,region,name²é // task.addCcbPrice3()//°´city,region,name²é
// task.standRegion() // task.standRegion()
// task.addGuidPrice() // task.addGuidPrice()
@@ -217,17 +217,19 @@ class FjwPricePkCcbPrice {
} }
def addFjwPrice(){ def addFjwPrice(){
ExcelUtils.multiThreadingModify("D:\\数据\\建行\\3月国信达差价_755条.xlsx",{d-> ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\指导价\\录入人工指导价_0526.xlsx",{d->
if(!d['K']){ if(!d['N']){
def dist = CommonDatautils.findDistrictById(d['C']) def dist = CommonDatautils.findDistrictById(d['E'])
if(dist){ if(dist){
def dbo = CommonDatautils.queryDistrictPrice(dist.city, dist.region, dist.name, DateUtils.parseFromTightByPattern("2023-03-26","yyyy-MM-dd")) d['N'] = dist.region
if(dbo){ // def dbo = CommonDatautils.queryDistrictPrice(dist.city, dist.region, dist.name, DateUtils.parseFromTightByPattern("2023-05-21","yyyy-MM-dd"))
d['K'] = dbo.avg_price // if(dbo){
} // d['K'] = dbo.avg_price
// }
} }
} }
}) })
} }
@@ -52,7 +52,7 @@ class GuiDingPriceBatch extends BaseBatch{
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
//添加自己库中的人工指导价 //添加自己库中的人工指导价
def prices = CcbCommonUtils.findPersonPrice(city, "2023-03-21", "2023-04-26") def prices = CcbCommonUtils.findPersonPrice(city, "2023-04-26", "2023-05-27")
// def prices = CcbCommonUtils.findPersonPrice(city, "2022-01-01", "2022-11-22") // def prices = CcbCommonUtils.findPersonPrice(city, "2022-01-01", "2022-11-22")
if(prices){ if(prices){
def distMap = getDistrictMap(city) def distMap = getDistrictMap(city)
@@ -83,8 +83,8 @@ class GuiDingPriceBatch extends BaseBatch{
FileUtils.batchCreateFile(rows, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\GUIDED_PRICE_GJ.dat", headers, "utf-8", false); FileUtils.batchCreateFile(rows, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\GUIDED_PRICE_GJ.dat", headers, "utf-8", false);
saveToPgSql(rows) saveToPgSql(rows)
//
//更新静态数据表 // //更新静态数据表
// updateVersion(DateUtils.formatDateByPattern(new Date(), "yyyy-MM")+"-28") // updateVersion(DateUtils.formatDateByPattern(new Date(), "yyyy-MM")+"-28")
} }
@@ -1,5 +1,8 @@
package com.fangjia.script.ccbevaluation package com.fangjia.script.ccbevaluation
import com.fangjia.datastore.driver.DSCollection
import com.fangjia.datastore.driver.DataStore
import com.mongodb.BasicDBObject
import groovy.sql.Sql import groovy.sql.Sql
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
@@ -12,15 +15,24 @@ class TestRepeat {
ExecutorService fixedThreadPool = Executors.newFixedThreadPool(80) ExecutorService fixedThreadPool = Executors.newFixedThreadPool(80)
def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", // def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl",
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") // "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
private DSCollection seabird = new DataStore("192.168.0.100", 37017).getCollection("fangjia.seabird")
static main(args) { static main(args) {
def task = new TestRepeat() def task = new TestRepeat()
task.run() task.run()
} }
def run(){ def run(){
def q = new BasicDBObject()
q.put("cat", "sell")
q.put("city", "ÏåÑô")
def count = seabird.count(q)
println count
// for(def d : dbcursor){
// println d.name
// }
} }
@@ -22,9 +22,9 @@ import java.util.concurrent.ConcurrentHashMap
@BatchOwner(Watcher.GaoJuan) @BatchOwner(Watcher.GaoJuan)
class ThirdPartyPriceBatch extends BaseBatch { class ThirdPartyPriceBatch extends BaseBatch {
def sDate= 202303//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); def sDate= Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));//202304//
def startDate = 202301 def startDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -3, "yyyyMM")) //202302
def endDate = 202303 def endDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); //202304
// def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -6, "yyyyMM")); // def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -6, "yyyyMM"));
static final DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "192.168.0.43") static final DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "192.168.0.43")
@@ -92,13 +92,13 @@ class TradeStatLog {
def run(){ def run(){
def citys = CcbCommonUtils.citys_all; def citys = CcbCommonUtils.citys_all;
def rets = [] def rets = []
rets << ["城市","23年1月总量","23年2月总量","23年3月总量","占比","贝壳","链家", "我爱我家","房天下","中原"] rets << ["城市","23年2月总量","23年3月总量","23年4月总量","占比","贝壳","链家", "我爱我家","房天下","中原"]
def sources = ["贝壳找房","链家在线","我爱我家","房天下","中原地产"] def sources = ["贝壳找房","链家在线","我爱我家","房天下","中原地产"]
//def startDate = "2021-05-01" //def startDate = "2021-05-01"
def startDate = "2023-01-01" def startDate = "2023-02-01"
def date = "2023-02-01" def date = "2023-03-01"
def endDate = "2023-03-01" def endDate = "2023-04-01"
def newDate = "2023-04-01" def newDate = "2023-05-01"
for(def city : citys){ for(def city : citys){
def lastMonthCount = findTradesCount(city, null, DateUtils.parseFromTightByPattern(startDate,"yyyy-MM-dd"), DateUtils.parseFromTightByPattern(date,"yyyy-MM-dd")) def lastMonthCount = findTradesCount(city, null, DateUtils.parseFromTightByPattern(startDate,"yyyy-MM-dd"), DateUtils.parseFromTightByPattern(date,"yyyy-MM-dd"))
@@ -1,5 +1,7 @@
package com.fangjia.script.ccbevaluation package com.fangjia.script.ccbevaluation
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.gj.FiledStrand
import com.fangjia.script.util.DbUtils import com.fangjia.script.util.DbUtils
import com.mongodb.BasicDBObject import com.mongodb.BasicDBObject
import groovy.sql.Sql import groovy.sql.Sql
@@ -11,7 +13,26 @@ class UpdateData {
static main(args) { static main(args) {
def task = new UpdateData(); def task = new UpdateData();
task.run() // task.run()
task.updateBlock()
}
def updateBlock(){
def citys = CommonDatautils.findAllCity()
for(def c : citys){
def dists = CommonDatautils.findAllDistrictByCity(c, "district", ["city","region", "block","name"])
for(def d : dists){
if(d.block){
def newBlock = FiledStrand.processBlock(d.city, d.region, d.block)
if(newBlock!= d.block){
def udata = new BasicDBObject()
udata.put("block", newBlock)
println d.city+" "+d.block +" "+newBlock
DbUtils.seaweed.update(new BasicDBObject('_id',d._id),new BasicDBObject('$set', udata))
}
}
}
}
} }
def run(){ def run(){
@@ -63,7 +63,7 @@ class BigdataCitypriceBatch extends BaseBatch{
def lastYearDate = DateUtils.addMonth(startDate.toString(),-12, "yyyyMMdd").toInteger(); def lastYearDate = DateUtils.addMonth(startDate.toString(),-12, "yyyyMMdd").toInteger();
cityRun(citys, startDate, endDate, cityCodeMap) cityRun(citys, startDate, endDate, cityCodeMap)
regionRun(citys, startDate, endDate, cityCodeMap) regionRun(citys, startDate, endDate, cityCodeMap)
districtRun(citys, startDate, endDate, dealStartDate, lastYearDate, cityCodeMap) // districtRun(citys, startDate, endDate, dealStartDate, lastYearDate, cityCodeMap)
} }
def cityRun(citys, startDate, endDate, cityCodeDataMap){ def cityRun(citys, startDate, endDate, cityCodeDataMap){
@@ -33,12 +33,13 @@ class ExportDistrictRongHe extends BaseBatch{
@Override @Override
void process(Object args) { void process(Object args) {
def queryDate = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM").toInteger() def queryDate = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM").toInteger()
def houseStartDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), -1), "yyyy-MM-dd") def houseStartDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), -1), "yyyy-MM-dd")
citys = CcbCommonUtils.getRunningCitys(args) citys = CcbCommonUtils.getRunningCitys(args)
def lastMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); def lastMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
def curMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), 0, "yyyyMM"));
def curDate = DateUtils.formatDateByPattern(new Date()+1, "yyyyMMdd") def curDate = DateUtils.formatDateByPattern(new Date()+1, "yyyyMMdd")
def new_dists = []//["350604","350605","410307","410308","450181"] def new_dists = []//["350604","350605","410307","410308","450181"]
@@ -66,9 +67,6 @@ class ExportDistrictRongHe extends BaseBatch{
exportBigdataCityPrice(queryDate) exportBigdataCityPrice(queryDate)
exportBigdataDistPrice(queryDate) exportBigdataDistPrice(queryDate)
exportBigdataCommPrice(queryDate) exportBigdataCommPrice(queryDate)
//1月10日 新增5张表,导92城,增量数据,2月10日导344城,其中252城所有历史数据,92城增量,3月后可能不用提供数据 //1月10日 新增5张表,导92城,增量数据,2月10日导344城,其中252城所有历史数据,92城增量,3月后可能不用提供数据
// exportCommunityBasePrice(lastMonth) // exportCommunityBasePrice(lastMonth)
// exportCommunityPdescribeGj(lastMonth) // exportCommunityPdescribeGj(lastMonth)
@@ -81,15 +79,15 @@ class ExportDistrictRongHe extends BaseBatch{
} }
if(curDate.toString().endsWith("28")){ if(curDate.toString().endsWith("28")){
exportPgBigdataSupplierStatistics(lastMonth) exportPgBigdataSupplierStatistics(curMonth)
//因为融合暂不切库,所以需要加传一张第三方均价表到融合中, 从1月10日开始传输,长期供 //因为融合暂不切库,所以需要加传一张第三方均价表到融合中, 从1月10日开始传输,长期供
def thirdPartyMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -2, "yyyyMM")); def thirdPartyMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
// exportThirdPartyPrice2(thirdPartyMonth, new_dists) // exportThirdPartyPrice2(thirdPartyMonth, new_dists)
exportPgThirdPartyPrice2(thirdPartyMonth, new_dists) exportPgThirdPartyPrice2(thirdPartyMonth, new_dists)
exportPgCommunityBasePrice(lastMonth) exportPgCommunityBasePrice(curMonth)
exportPgCommunityPdescribeGj(lastMonth) exportPgCommunityPdescribeGj(curMonth)
exportPgBigdataModelingBase(lastMonth) exportPgBigdataModelingBase(curMonth)
exportPgGuideStatistics(lastMonth) exportPgGuideStatistics(curMonth)
} }
SSHHelper jschCommand = new SSHHelper(); SSHHelper jschCommand = new SSHHelper();
@@ -36,35 +36,35 @@ class ExportDistrictRongHeTest extends BaseBatch{
// exportBigdataDealFJW2(curDate, DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date()+1,-1), "yyyy-MM-dd"), new_dists) // exportBigdataDealFJW2(curDate, DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date()+1,-1), "yyyy-MM-dd"), new_dists)
exportPgBigdataDealFJW(curDate, DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date()+1,-2), "yyyy-MM-dd"), new_dists) exportPgBigdataDealFJW(curDate, DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date()+1,-2), "yyyy-MM-dd"), new_dists)
// if(curDate.toString().endsWith("10")){ if(curDate.toString().endsWith("10")){
// exportEvaluateRate() exportEvaluateRate()
// exportBigdataBuildprojFjw() exportBigdataBuildprojFjw()
// exportBigdataCommlayoutpicFjw() exportBigdataCommlayoutpicFjw()
//
//
// exportBigdataCommunityGJRH()/ exportBigdataCommunityGJRH()/
// exportBigdataBuildingFJW()// exportBigdataBuildingFJW()//
// exportBigdataCommfeeGj()// exportBigdataCommfeeGj()//
//
// exportBigdataCommbuildstruGJ()// exportBigdataCommbuildstruGJ()//
// exportBigdataCommhousetypeGJ()// exportBigdataCommhousetypeGJ()//
// exportBigdataCommbuildyearGj()// exportBigdataCommbuildyearGj()//
// exportBigdataCommhouseuseGJ()// exportBigdataCommhouseuseGJ()//
// exportBigdataPositionGJ()// exportBigdataPositionGJ()//
// exportBigdataDistrictFJW()// exportBigdataDistrictFJW()//
// exportBigdataAliasFJW()// exportBigdataAliasFJW()//
//
//
// //本12.10上传10,11月所有数据,23年1月需改为所有城市按日期同步一期数据 //本12.10上传10,11月所有数据,23年1月需改为所有城市按日期同步一期数据
// def queryDate = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM").toInteger() def queryDate = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM").toInteger()
// exportBigdataCityPrice(queryDate) exportBigdataCityPrice(queryDate)
// exportBigdataDistPrice(queryDate) exportBigdataDistPrice(queryDate)
// exportBigdataCommPrice(queryDate) exportBigdataCommPrice(queryDate)
exportInOk() exportInOk()
// } }
SSHHelperTest jschCommand = new SSHHelperTest(); SSHHelperTest jschCommand = new SSHHelperTest();
System.out.println(jschCommand.executeCommand("sh /home/ccb_ronghe/output/rh_package.sh ${curDate}")); System.out.println(jschCommand.executeCommand("sh /home/ccb_ronghe/output/rh_package.sh ${curDate}"));
@@ -0,0 +1,261 @@
package com.fangjia.script.chongqing
import com.fangjia.script.ccbevaluation.CcbCommonUtils
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.DbUtils
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.fangjia.script.util.OpenApiClient
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import com.mongodb.DBObject
import groovy.sql.Sql
class FumingTest {
def startDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -3, "yyyyMM")) //202302
def endDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); //202304
static final DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "192.168.0.43")
def pgsqlInstance = Sql.newInstance("jdbc:postgresql://192.168.0.236:5432/warehouse",
"postgres", "postgres", "org.postgresql.Driver")
static main(args) {
def task = new FumingTest();
task.run();
}
def run() {
def path = "D:\\数据\\富民\\富民测试500-v7.xlsx"
// match(path)
// addPrice(path)
// addThirdPrice(path)
// addLastPrice(path)
addFacLevel(path)
}
def addFacLevel(path){
ExcelUtils.multiThreadingModify(path, { row ->
if(!row['K'] && row['I']){
// def obj = findCommunitySummary(row['C'])
// if(obj){
// row['K'] = obj.consumption_rating
// }else{
row['K'] = getNearByDistrictLevel(row['C'], row['I'])
// }
}
})
}
/**
* 一公里小区数量
*/
def getNearByDistrictLevel(def id, def price){
BasicDBObject district = DbUtils.seaweed.findById(id);
def level = null
if(district){
List<DBObject> list = DbUtils.findAroundDistrict(district);
println id +" 共:"+list.size()+" "+ price
if(list!=null&&list.size()>0){
for(def obj : list){
def summary = findCommunitySummary(obj._id.toString())
if(summary && summary.avg_price && summary.consumption_rating){
def pre = java.lang.Math.abs((summary.avg_price - price)*100/price)
println summary.name +" "+pre +" "+ summary.avg_price
if(pre <= 10){
level = summary.consumption_rating
break;
}
}
}
}
}
return level;
}
def addLastPrice(path){
ExcelUtils.multiThreadingModify(path, { row ->
if(!row['Z'] ){
if(row['W']){
row['Z'] = row['W']
}else if(row['R']){
row['Z'] = row['R']
}else if(row['I']){
row['Z'] = row['I']
}
if(row['Z']){
row['J'] = (int)(row['Z']*row['B'].toString().toDouble())
}
}
})
}
def match(path){
ExcelUtils.multiThreadingModify(path, { row ->
if(!row['N'] ){
def city = row['C']
def address = row['A']
def region = row['D']
def name = row['G']
println "[match] city:"+city+" region:"+region+" address:"+address
def jsonObject = OpenApiClient.addressMatch(city, address, "property", false, region, name)
if(jsonObject != null && jsonObject.precise!=-1) {
row['N'] = jsonObject.get("id")
row['O'] = jsonObject.get("city")
row['P'] = jsonObject.get("district")
row['Q'] = jsonObject.get("name")
row['R'] = jsonObject.get("propertyType")
row['S'] = jsonObject.get("address")
}
}
})
}
def addPrice(path){
ExcelUtils.multiThreadingModify(path, { row ->
def commid = row['C']
if(commid){
def dist = CommonDatautils.findDistrictById(commid.trim())
if(dist){
row['D'] = dist.city
row['E'] = dist.region
row['F'] = dist.name
row['G'] = dist.estate_type2
row['H'] = dist.address
// row['Q'] = dist.name
def priceObj = CommonDatautils.findDistrictPrice(dist.city, dist.region, dist.name)
if(priceObj){
row['I'] = priceObj.avg_price
row['J'] = (int)(priceObj.avg_price*row['B'].toString().toDouble())
row['R'] = priceObj.avg_price_2b
}
}
}
})
}
def addThirdPrice(path){
// def citys = ['昆明','廊坊','东莞','西安','南宁','成都','佛山','广州','重庆','珠海','长沙','中山','张家口','武汉','苏州','南通','贵阳','天津','大连']
def allMap = [:]
// for(def c : citys){
// def cityMap = findThirdPartyPrice(c)
// allMap << cityMap
// }
def cityCodeMap = CcbCommonUtils.findCityCodeValue()
ExcelUtils.multiThreadingModify(path, { row ->
def cityMap = findThirdPartyPrice(row['D'], row['E'], row['F'])
def priceMap = cityMap.get(row['D']+"##"+row['E']+"##"+row['F'])
if(priceMap){
if(priceMap.containsKey("lianjia_esf_price")){
row['L'] = priceMap.get("lianjia_esf_price")
}
if(priceMap.containsKey("beike_esf_price")){
row['M'] = priceMap.get("beike_esf_price")
}
if(priceMap.containsKey("anjuke_esf_price")){
row['N'] = priceMap.get("anjuke_esf_price")
}
}
def map = findAvgPrice(row['C'], cityCodeMap.get(row['D']))
if(map){
row['O'] = map.avg_price
row['P'] = map.credit_value
}
})
}
def addCcbPrice2(){
def cityCodeMap = CcbCommonUtils.findCityCodeValue()
ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\指导价\\深圳政府指导价_补充.xlsx", { d ->
if(d['C']){
def map = findAvgPrice(d['C'], cityCodeMap.get(d['E']))
if(map){
d['K'] = map.avg_price
d['L'] = map.calc_type
// d['AI'] = map.credit_value
d['M'] = map.month
}
}
})
}
def findThirdPartyPrice(def city, def region, def name){
def q = new BasicDBObject()
q.put("city", city)
q.put("region", region)
q.put("name", name)
q.put("s_date", new BasicDBObject('$gte', startDate).append('$lte',endDate))
def dbcursor = AVERAGE_STATISTICS.find(q).sort(new BasicDBObject("s_date", -1))
def map = [:]
for(def db : dbcursor){
def key = db.city+"##"+db.region+"##"+db.name
def dataMap = map.get(key)
if(!dataMap){
dataMap = [:]
map.put(key, dataMap)
}
if(!dataMap.containsKey("anjuke_esf_price") && db.anjuke_esf_price && db.anjuke_esf_price>3000){
dataMap.put("anjuke_esf_price", db.anjuke_esf_price)
}
if(!dataMap.containsKey("anjuke_esf_price") && db.get("58tc_esf_price") && db.get("58tc_esf_price")>3000){
dataMap.put("anjuke_esf_price", db.get("58tc_esf_price"))
}
if(!dataMap.containsKey("lianjia_esf_price") && db.lianjia_esf_price && db.lianjia_esf_price>3000){
dataMap.put("lianjia_esf_price", db.lianjia_esf_price)
}
if(!dataMap.containsKey("cityhouse_esf_price") && db.cityhouse_esf_price && db.cityhouse_esf_price>3000){
dataMap.put("cityhouse_esf_price", db.cityhouse_esf_price)
}
if(!dataMap.containsKey("beike_esf_price") && db.beike_esf_price && db.beike_esf_price>3000){
dataMap.put("beike_esf_price", db.beike_esf_price)
}
}
return map
}
def findAvgPrice(def commid, def cityid){
def sql = "SELECT gujia_bds_clc_avprc,gujia_bds_clmtd,gujiabds_clc_yrmo_val,gujia_bds_cfdc_dgr from t_app_p9pha_plda.avm_community_base_price_gj_h where urbn_id='${cityid}' and gujia_bds_id='${commid}' order by gujiabds_clc_yrmo_val desc limit 1"
def map = [:]
pgsqlInstance.eachRow(sql, { r ->
map.avg_price = r.gujia_bds_clc_avprc
map.type = r.gujia_bds_clmtd
map.month = r.gujiabds_clc_yrmo_val
map.credit_value = r.gujia_bds_cfdc_dgr
if(r.gujia_bds_clmtd == 1){
map.calc_type = "人工估值"
}else if(r.gujia_bds_clmtd == 2){
map.calc_type = "样本计算"
}else if(r.gujia_bds_clmtd == 3){
map.calc_type = "神经网络"
}
})
return map
}
def findCommunitySummary(id){
def obj = null
def sql = "select * from community_summary where id='${id}'"
ElasticUtils.executeSqlQuery(sql, {
obj = it
})
return obj
}
}
@@ -26,7 +26,7 @@ class MingShenPocTest {
def run(){ def run(){
def path = "D:\\数据\\民生\\poc测试.xlsx" def path = "D:\\数据\\民生\\poc测试.xlsx"
//9级标准化 //9级标准化
//structureV2(path)//针对海南poc地址数据此接口不合适使用 structureV2(path)//针对海南poc地址数据此接口不合适使用
//省市区拆分 //省市区拆分
// ner(path)//城市,区域带市带区 // ner(path)//城市,区域带市带区
// match(path) // match(path)
@@ -34,7 +34,7 @@ class MingShenPocTest {
// addLatLng(path) // addLatLng(path)
// addAroundPrice(path) // addAroundPrice(path)
// addAuthor(path) // addAuthor(path)
addHouse(path) // addHouse(path)
} }
def structureV2(path){ def structureV2(path){
@@ -71,6 +71,9 @@ class CommonDatautils {
public static final DBCollection LOUDONG_LINE_COLL = MongoUtils.getCollectionByName2("fangjia_base", "loudong", mongoDbUrl) public static final DBCollection LOUDONG_LINE_COLL = MongoUtils.getCollectionByName2("fangjia_base", "loudong", mongoDbUrl)
public static final DBCollection HOUSE_LOUDONG_COLL = MongoUtils.getCollectionByName2("fangjia", "house_loudong", mongoDbUrl) public static final DBCollection HOUSE_LOUDONG_COLL = MongoUtils.getCollectionByName2("fangjia", "house_loudong", mongoDbUrl)
public static final DBCollection CITY_INFO_COLL = MongoUtils.getCollectionByName2("fangjia_data_ana", "city_info", mongoDbUrl) public static final DBCollection CITY_INFO_COLL = MongoUtils.getCollectionByName2("fangjia_data_ana", "city_info", mongoDbUrl)
public static final DBCollection REGION_INFO_CONN = MongoUtils.getCollectionByName("fangjia_data_ana", "region_info", MongoUtils.MongoDB_Domain_mongo);
public static final DBCollection DISTRICT_ANALY_DATA_COLL = MongoUtils.getCollectionByName("fangjia_stat", "district_analy_data", "mongo.db.fangjia.com")
public static DSCollection getHouseDataStoreConnection(){ public static DSCollection getHouseDataStoreConnection(){
if(house_dataStoreConnection != null) { if(house_dataStoreConnection != null) {
@@ -229,6 +232,7 @@ class CommonDatautils {
q.put("visible", 0); q.put("visible", 0);
q.put("cat", cat); q.put("cat", cat);
q.put("city", city); q.put("city", city);
// q.put("name", "³¤Ì²ÃÀÊûÈýÆÚ")
DBObject keys = new BasicDBObject(); DBObject keys = new BasicDBObject();
if(fields){ if(fields){
@@ -780,7 +784,7 @@ class CommonDatautils {
public static def findDistrictByCityAndRegions(def city, def cat, def regions, def fields){ public static def findDistrictByCityAndRegions(def city, def cat, def regions, def fields){
DBObject q = new BasicDBObject(); DBObject q = new BasicDBObject();
q.put("visible",0) q.put("status",0)
q.put("cat", cat); q.put("cat", cat);
q.put("city", city); q.put("city", city);
q.put("region", new BasicDBObject('$in', regions)) q.put("region", new BasicDBObject('$in', regions))
@@ -2990,6 +2994,19 @@ class CommonDatautils {
return names; return names;
} }
public static def getCityByRegion(region){
DBObject q = new BasicDBObject();
q.put("category", "region");
q.put("name", region);
def cursor = REGION_BLOCK_COLL.find(q);
def citys = [];
for(def obj : cursor){
citys << obj.city;
}
return citys;
}
static def findBusLineCount(def city, def maxLat, def minLat, def maxLng, def minLng){ static def findBusLineCount(def city, def maxLat, def minLat, def maxLng, def minLng){
DBObject q = new BasicDBObject() DBObject q = new BasicDBObject()
q.put("city", city); q.put("city", city);
@@ -3404,11 +3421,27 @@ class CommonDatautils {
dbcursor.setOptions(Bytes.QUERYOPTION_NOTIMEOUT) dbcursor.setOptions(Bytes.QUERYOPTION_NOTIMEOUT)
def sqmetreRentMap = [:] def sqmetreRentMap = [:]
for(def d : dbcursor){ for(def d : dbcursor){
sqmetreRentMap.put(d.city+"##"+d.region+"##"+d.district_name, d.avg_price) // sqmetreRentMap.put(d.city+"##"+d.region+"##"+d.district_name, d.avg_price)
sqmetreRentMap.put(d.city+"##"+d.region+"##"+d.district_name, d.precise_avg_price)
} }
return sqmetreRentMap; return sqmetreRentMap;
} }
static def findAllSqmetreRentPrices(def city, def weekend){
def q = new BasicDBObject()
q.put("city", city)
q.put("cat","district")
q.put("weekend", weekend)
def dbcursor = SQMETRE_RENT_COLL.find(q).batchSize(2000)
dbcursor.setOptions(Bytes.QUERYOPTION_NOTIMEOUT)
def prices = []
for(def d : dbcursor){
prices << d.avg_price
}
return prices;
}
static def findNewSqmetreRent(def city, def region, def name){ static def findNewSqmetreRent(def city, def region, def name){
def q = new BasicDBObject() def q = new BasicDBObject()
q.put("city", city) q.put("city", city)
@@ -3465,4 +3498,25 @@ class CommonDatautils {
return null return null
} }
static def findRegionPriceRate(city, region){
def q = new BasicDBObject()
q.put("city", city)
q.put("region", region)
def cur = REGION_INFO_CONN.find(q).sort(new BasicDBObject("weekend", -1)).limit(1)
def obj = null
while(cur.hasNext()) {
obj = cur.next()
}
return obj
}
static def findDistrictAnalyStat(city, region, name){
def q = new BasicDBObject()
q.put("city", city)
q.put("region", region)
q.put("district_name", name)
def analyData = DISTRICT_ANALY_DATA_COLL.findOne(q)
return analyData
}
} }
@@ -1,5 +1,7 @@
package com.fangjia.script.dataAna package com.fangjia.script.dataAna
import com.fangjia.script.ccbevaluation.CcbCommonUtils
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.MongoUtils import com.fangjia.script.util.MongoUtils
import java.text.DecimalFormat import java.text.DecimalFormat
@@ -57,35 +59,34 @@ class CityInfoAnaBatch extends BaseBatch {
final static def CITYS = []; final static def CITYS = [];
//floorplan_pics :'floorplanPics',out_pics :'outPics',out_pics : 'outPics', pics : 'pics',licence :'licence',
public static final def DISTRICT_FIELDS_MAP = [ public static final def DISTRICT_FIELDS_MAP = [
name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',household_count :'householdCount',open_date :'openDate',live_date :'liveDate',build_date:'buildDate', name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',household_count :'householdCount',open_date :'openDate',live_date :'liveDate',build_date:'buildDate',
all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',cubage_percent :'cubagePercent',virescence_percent :'virescencePercent',
car_site :'carSite',estate_charge :'estateCharge',floorplan_pics :'floorplanPics',out_pics :'outPics',finish_building_date :'finishBuildingDate',business_quarter :'businessQuarter',
start_building_date :'startBuildingDate',loop_line_info :'loopLineInfo',property_life :'propertyLife',house_property :'houseProperty',licence :'licence',build_structure :'buildStructure',
lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', out_pics : 'outPics', pics : 'pics',street_community:'streetCommunity',committee:'committee',schools:'schools',house_structure:'houseStructure',
alias:'alias',addr_alias:'addrAlias','main_type_area':'mainTypeArea',loudong_count:'loudongCount'
]
public static final def OFFICE_FIELDS_MAP = [
name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',household_count :'householdCount',open_date :'openDate',live_date :'liveDate',
all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',cubage_percent :'cubagePercent',virescence_percent :'virescencePercent', all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',cubage_percent :'cubagePercent',virescence_percent :'virescencePercent',
car_site :'carSite',estate_charge :'estateCharge',finish_building_date :'finishBuildingDate',start_building_date :'startBuildingDate',build_structure :'buildStructure', car_site :'carSite',estate_charge :'estateCharge',finish_building_date :'finishBuildingDate',business_quarter :'businessQuarter',
facilities : 'facilities',characteristic:'characteristic',car_site_count :'carSiteCount',bed_kind:'bedKind',alias:'alias', start_building_date :'startBuildingDate',loop_line_info :'loopLineInfo',property_life :'propertyLife',house_property :'houseProperty',build_structure :'buildStructure',
lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', out_pics : 'outPics', pics : 'pics',addr_alias:'addrAlias',business_quarter:'businessQuarter',loop_line_info:'loopLineInfo',licence:'licence', lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', street_community:'streetCommunity',committee:'committee',schools:'schools',house_structure:'houseStructure',
sideset:'sideset',real_use_percent:'realUsePercent',build_designer:'buildDesigner',cons_company:'consCompany',estate_charge:'estateCharge', alias:'alias',addr_alias:'addrAlias','main_type_area':'mainTypeArea',loudong_count:'loudongCount',car_site_count:'carSiteCount',mapping_alias:'mappingAlias',is_elevator:'elevator',
floor_info:'floorInfo',underground_car_site:'undergroundCarSite',land_car_site:'landCarSite',parking_fee:'parkingFee',sight:'sight',property_life:'propertyLife', township:'township',kindergartens:'kindergartens',main_type:'mainType',land_property:'landProperty',usage_card:'usageCard',occupancy_rate:'occupancyRate',land_usage_start:'landUsageStart'
conditioner_time:'conditionerTime',elevators_count:'elevatorsCount',person_elevators_count:'personElevatorsCount', ]
goods_elevator_count:'goodsElevatorCount',network_way:'networkWay',fitment_level:'fitmentLevel',standard_height:'standardHeight',clear_height:'clearHeight',standard_area:'standardArea', //out_pics : 'outPics', pics : 'pics',household_count :'householdCount',build_structure :'buildStructure', facilities : 'facilities',characteristic:'characteristic',licence:'licence',sideset:'sideset',real_use_percent:'realUsePercent',build_designer:'buildDesigner',cons_company:'consCompany',
is_foreign:'foreign',is_register:'register',lighting_ventilation:'lightingVentilation',lobby_height:'lobbyHeight' //conditioner_time:'conditionerTime',network_way:'networkWay',fitment_level:'fitmentLevel',lighting_ventilation:'lightingVentilation',
public static final def OFFICE_FIELDS_MAP = [
name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',open_date :'openDate',live_date :'liveDate',
all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',cubage_percent :'cubagePercent',virescence_percent :'virescencePercent',
car_site :'carSite',estate_charge :'estateCharge',finish_building_date :'finishBuildingDate',start_building_date :'startBuildingDate',
car_site_count :'carSiteCount',bed_kind:'bedKind',alias:'alias',lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', addr_alias:'addrAlias',business_quarter:'businessQuarter',loop_line_info:'loopLineInfo',
estate_charge:'estateCharge',floor_info:'floorInfo',underground_car_site:'undergroundCarSite',land_car_site:'landCarSite',parking_fee:'parkingFee',sight:'sight',property_life:'propertyLife',
elevators_count:'elevatorsCount',person_elevators_count:'personElevatorsCount',goods_elevator_count:'goodsElevatorCount',standard_height:'standardHeight',clear_height:'clearHeight',standard_area:'standardArea',
is_foreign:'foreign',is_register:'register',lobby_height:'lobbyHeight',township:'township',divisible :'divisible',land_floor:'landFloor',underground_floor:'undergroundFloor'
] ]
// out_pics : 'outPics', pics : 'pics',
public static final def SHOP_FIELDS_MAP = [ public static final def SHOP_FIELDS_MAP = [
name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',open_date :'openDate',live_date :'liveDate', name :'name',region :'region',block :'block',address :'address', alias:'alias',addr_alias:'addrAlias',estate_type2 :'estateType2',open_date :'openDate',live_date :'liveDate',
all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany', all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',car_site :'carSite',estate_charge :'estateCharge',floor :'floor',
rent_type :'rentType',lease_term :'leaseTerm',car_site :'carSite',estate_charge :'estateCharge',divisible :'divisible',floor :'floor', finish_building_date :'finishBuildingDate',business_quarter :'businessQuarter',start_building_date :'startBuildingDate',bay_area :'bayArea', property_life :'propertyLife',business_status :'businessStatus',parking_fee:'parkingFee',
finish_building_date :'finishBuildingDate',business_quarter :'businessQuarter',start_building_date :'startBuildingDate', lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2',township:'township',loop_line_info :'loopLineInfo',land_floor:'landFloor',underground_floor:'undergroundFloor',real_use_percent:'realUsePercent'
bay_area :'bayArea', property_life :'propertyLife',unified_manage :'unifiedManage',licence :'licence',business_status :'businessStatus',
lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', out_pics : 'outPics', pics : 'pics'
] ]
public static CITY_GRADE_MAP = [1000: "一线" , 1500 : "新一线" , 2000 : "二线" , 3000:"三线" ,4000 : "四线" ,5000 : "五线"] public static CITY_GRADE_MAP = [1000: "一线" , 1500 : "新一线" , 2000 : "二线" , 3000:"三线" ,4000 : "四线" ,5000 : "五线"]
@@ -109,6 +110,7 @@ class CityInfoAnaBatch extends BaseBatch {
@Override @Override
public void process(Object args) { public void process(Object args) {
// 当期周末 // 当期周末
Date weekend = DateUtil.getFirstDayOfWeek(new Date()); Date weekend = DateUtil.getFirstDayOfWeek(new Date());
//周日开始跑,需要跑加上7天,周一跑不需要 //周日开始跑,需要跑加上7天,周一跑不需要
@@ -123,7 +125,7 @@ class CityInfoAnaBatch extends BaseBatch {
SERVER_AREA_CONN.find(cityQuery).each { allCitys.put(it.display, it); } SERVER_AREA_CONN.find(cityQuery).each { allCitys.put(it.display, it); }
allCitys.each {k,v -> allCitys.each {k,v ->
// if(["上海","深圳","北京","广州","杭州","苏州","重庆","成都"].contains(k.toString())){ // if(["ÄϾ©"].contains(k.toString())){
CITYS << k.toString(); CITYS << k.toString();
// } // }
} }
@@ -574,7 +576,7 @@ class CityInfoAnaBatch extends BaseBatch {
entity.put("price_credit_gte_00_coverage", DataUtil.roundDouble(creditGte00Count/count, 4)) entity.put("price_credit_gte_00_coverage", DataUtil.roundDouble(creditGte00Count/count, 4))
} }
entity.put('district_detail', districtDetail(disCount, cityName)); entity.put('district_detail', districtDetail(disCount, cityName));
entity.put('district_alias_total_count', districtAliasStat(cityName));
entity.put('district_facilitys_detail', districtFacilitysDetail(disCount, cityName)); entity.put('district_facilitys_detail', districtFacilitysDetail(disCount, cityName));
} else { } else {
entity.put('district_detail', [:]); entity.put('district_detail', [:]);
@@ -1032,11 +1034,30 @@ class CityInfoAnaBatch extends BaseBatch {
return CITY_INFO_CONN.findOne(query); return CITY_INFO_CONN.findOne(query);
} }
def districtDetail(def disCount, def cityName) { def districtAliasStat(def cityName){
DBObject query = new BasicDBObject(); DBObject query = new BasicDBObject();
query.put('city', cityName); query.put('city', cityName);
query.put('cat', 'district'); query.put('cat', 'district');
query.put('visible', 0); query.put('visible', 0);
DBObject fields = new BasicDBObject()
fields.put("alias", 1)
DSCursor cur = SEAWEED.find(query, fields).batchSize(2000)
Iterator<DBObject> iter = cur.iterator()
def aliasCount = 0
while(iter.hasNext()) {
def dbo = iter.next()
if(dbo && dbo.alias){
aliasCount = aliasCount + dbo.alias.size()
}
}
return aliasCount;
}
def districtDetail(def disCount, def cityName) {
DBObject query = new BasicDBObject();
query.put('city', cityName);
query.put('cat', 'district');
query.put('status', 0);
DBObject fields = new BasicDBObject() DBObject fields = new BasicDBObject()
DISTRICT_FIELDS_MAP.each() {key,skey-> DISTRICT_FIELDS_MAP.each() {key,skey->
@@ -1046,7 +1067,6 @@ class CityInfoAnaBatch extends BaseBatch {
DSCursor cur = SEAWEED.find(query, fields).batchSize(2000) DSCursor cur = SEAWEED.find(query, fields).batchSize(2000)
Iterator<DBObject> iter = cur.iterator() Iterator<DBObject> iter = cur.iterator()
def countMap = [:] def countMap = [:]
while(iter.hasNext()) { while(iter.hasNext()) {
def dbo = iter.next() def dbo = iter.next()
@@ -82,20 +82,21 @@ class DistrictInfoExportBatch extends BaseBatch{
} }
} }
def removeDists = CommonDatautils.findRemoveDistricts(city, "district", null, "2022-01-01"); def removeDists = CommonDatautils.findRemoveDistricts(city, "district", null, "2022-01-01");
for(def dist : removeDists){ // for(def dist : removeDists){
def key = dist.city +"##"+dist.region+"##"+dist.name // def key = dist.city +"##"+dist.region+"##"+dist.name
if(!distKeys.contains(key)){ // if(!distKeys.contains(key)){
distKeys << key // distKeys << key
districts << dist // districts << dist
} // }
} // }
def lastDate = DateUtils.getLastDayOfMonth(new Date(), -1) def lastDate = DateUtils.getLastDayOfMonth(new Date(), -1)
def startDate = DateUtils.getFirstDayOfMonth(lastDate); def startDate = DateUtils.getFirstDayOfMonth(lastDate);
def fzAddrMap = getFzAddress(); def fzAddrMap = getFzAddress();
//因为福州个性化问题,又不想影响自家数据库数据,所以另存一个福州小区库,用于手动添加数据 //因为福州个性化问题,又不想影响自家数据库数据,所以另存一个福州小区库,用于手动添加数据
saveOrUpdateFzDist(districts) // saveOrUpdateFzDist(districts)
remarkRemoveDist(removeDists)
def fzDistricts = getFzDistricts(city) def fzDistricts = getFzDistricts(city)
for(def rMap : fzDistricts){ for(def rMap : fzDistricts){
@@ -185,6 +186,15 @@ class DistrictInfoExportBatch extends BaseBatch{
} }
def remarkRemoveDist(removeDists){
for(def rd : removeDists){
def udate = new BasicDBObject()
udate.put("status",1)
udate.put("m_date", new Date())
FZ_DIST_COLL.update(new BasicDBObject('_id',rd.get('_id')), new BasicDBObject('$set', udate));
}
}
def getFzDistricts(def city){ def getFzDistricts(def city){
def q = new BasicDBObject() def q = new BasicDBObject()
q.put("city", city) q.put("city", city)
@@ -143,13 +143,15 @@ class DistrictSellStatBatch extends BaseBatch {
if(weekendPriceObj.value_type!=1){ if(weekendPriceObj.value_type!=1){
if(dist.city == "¸£ÖÝ"){ if(dist.city == "¸£ÖÝ"){
if(Math.abs(mom)*100>3){ if(Math.abs(mom)*100>3){
def randMarkup = nextDouble(0, 3) if(dist.region != "Âíβ"){
if(mom < 0){ def randMarkup = nextDouble(0, 3)
mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4) if(mom < 0){
}else{ mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4)
mom = DataUtil.roundDouble(randMarkup/100, 4) }else{
mom = DataUtil.roundDouble(randMarkup/100, 4)
}
curPrice = (int)(lastMonthPriceObj.avg_price*mom + lastMonthPriceObj.avg_price)
} }
curPrice = (int)(lastMonthPriceObj.avg_price*mom + lastMonthPriceObj.avg_price)
} }
}else{ }else{
if(Math.abs(mom)*100>10){ if(Math.abs(mom)*100>10){
@@ -25,7 +25,7 @@ class FzDataResultStat {
static main(args) { static main(args) {
def task = new FzDataResultStat() def task = new FzDataResultStat()
task.priceMarkupRun(); task.priceMarkupRun();
task.regionPriceTrendRun() // task.regionPriceTrendRun()
//// task.margeExcel() //// task.margeExcel()
// task.saveCsvData() // task.saveCsvData()
} }
@@ -1,5 +1,6 @@
package com.fangjia.script.fuzhou package com.fangjia.script.fuzhou
import com.fangjia.core.RegionData
import com.fangjia.core.util.GeocodeUtils import com.fangjia.core.util.GeocodeUtils
import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.gj.EsUtils import com.fangjia.script.gj.EsUtils
@@ -11,26 +12,91 @@ import com.mongodb.DBCollection
import org.apache.commons.io.FileUtils import org.apache.commons.io.FileUtils
import org.bson.types.ObjectId import org.bson.types.ObjectId
DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "192.168.0.43")
DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
def datas = FileUtils.readLines("D:\\Êý¾Ý\\ÆäËü\\FJW_COMM_20221015.csv") ExcelUtils.modify("C:\\Users\\gaojuan\\Downloads\\第三方小区区域.xlsx", { d ->
def rets = [] def city = RegionData.formatCity("余姚")
for(def d : datas){ d['D'] = city
def arrs = d.split("@") if(city){
rets << ["commId":arrs[0], "avg_price":arrs[4]] d['E'] = RegionData.formatRegion(city, d['C'])
}
for(def r : rets){
if(r.avg_price){
def udata = new BasicDBObject()
udata.put("date", 202210)
udata.put("avg", r.avg_price.toInteger())
DISTRICT_SELL_STAT.update(new BasicDBObject("commid", r.commId) , new BasicDBObject('$set', data),false,false)
}else{
println r.commId +" ²»´æÔÚ"
} }
// if(!d['D']){
// def citys = CommonDatautils.getCityByRegion(d['A'])
// if(citys && citys.size()==1){
// d['F'] = citys.get(0)
// }
// }
})
//def datas = ExcelUtils.read("D:\\数据\\福州\\202305月福州统计数据\\福州马尾第三方.xlsx", 0, 1)
//def m = [:]
//for(def d : datas){
// m.put(d['B'], d)
//}
//ExcelUtils.modify("D:\\数据\\福州\\202305月福州统计数据\\福州马尾.xlsx",{d->
// def dist = CommonDatautils.findDistrict(d['A'], d['B'], d['C'], "district")
// if(dist){
// def ret = m.get(dist._id.toString())
// if(ret){
// d['E'] = ret['J']
// d['F'] = ret['N']
// }
// def dbo = findThirdPrice(d['A'], d['B'], d['C'], AVERAGE_STATISTICS)
// if(dbo){
// if(dbo.beike_esf_price){
// d['G'] = dbo.beike_esf_price
// }else if(dbo.beike_esf_price){
// d['G'] = dbo.beike_esf_price
// }
//
// if(dbo.maitian_esf_price){
// d['H'] = dbo.maitian_esf_price
// }
// }
// def dbo = CommonDatautils.queryDistrictPrice(d['A'], d['B'], d['C'], DateUtils.parseFromTightByPattern("2023-05-21", "yyyy-MM-dd"))
// if(dbo){
// d['K'] = dbo.avg_price
// d['L'] = dbo.value_type
// }
//
// }
//})
def findThirdPrice(city, region, name, AVERAGE_STATISTICS){
def q = new BasicDBObject()
q.put("city", city)
q.put("region", region)
q.put("name", name)
q.put("s_date", 202304)
return AVERAGE_STATISTICS.findOne(q)
} }
//DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
//def datas = FileUtils.readLines("D:\\数据\\其它\\FJW_COMM_20221015.csv")
//def rets = []
//for(def d : datas){
// def arrs = d.split("@")
// rets << ["commId":arrs[0], "avg_price":arrs[4]]
//}
//
//for(def r : rets){
// if(r.avg_price){
// def udata = new BasicDBObject()
// udata.put("date", 202210)
// udata.put("avg", r.avg_price.toInteger())
// DISTRICT_SELL_STAT.update(new BasicDBObject("commid", r.commId) , new BasicDBObject('$set', data),false,false)
// }else{
// println r.commId +" 不存在"
// }
//}
@@ -14,7 +14,7 @@ import com.mongodb.DBCollection
//福州第三方均价统计,发送钉钉消息 //福州第三方均价统计,发送钉钉消息
//def datas = ExcelUtils.read("d:\\数据\\福州\\福州4月2.xlsx",0,1) //def datas = ExcelUtils.read("d:\\数据\\福州\\福州4月2.xlsx",0,1)
//def datas = CsvUtils.read("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202105.csv"); //def datas = CsvUtils.read("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202105.csv");
def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202303.csv") def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202304.csv")
def count0 = 0 def count0 = 0
def count1 = 0 def count1 = 0
def count2 = 0 def count2 = 0
@@ -29,8 +29,11 @@ class AddAvgpriceBatch {
} }
def test(){ def test(){
//发重算均价命令 def districts = CommonDatautils.findDistrictByCityAndRegions("福州","district", ["马尾"], ["city","region","name", "estate_type2"])
addPrice("上海","闵行","君莲闵都雅苑", "普通住宅", DateUtils.parseFromTightByPattern('2023-04-23','yyyy-MM-dd'),DateUtils.parseFromTightByPattern('2023-04-30','yyyy-MM-dd')) for(def dist : districts){
//发重算均价命令
addPrice(dist.city,dist.region,dist.name, dist.estate_type2, DateUtils.parseFromTightByPattern('2023-05-01','yyyy-MM-dd'),DateUtils.parseFromTightByPattern('2023-05-30','yyyy-MM-dd'))
}
} }
def run(){ def run(){
@@ -96,17 +96,28 @@ class CityStatExport {
} }
def regionStat(){ def regionStat(){
def citys = ["杭州","宁波","温州","嘉兴","台州","湖州","绍兴","金华","舟山","衢州","丽水"] def citys = ['淮南','阜阳','黄山','亳州','安庆','六安','淮北','宣城','池州','铜陵','滁州','蚌埠','合肥','芜湖','马鞍山','宿州']
def ret = [] def ret = []
ret << ["城市","区域","小区总量"] ret << ["城市","区域","小区总量"]
for(def city : citys){ for(def city : citys){
def regions = CommonDatautils.getRegionListByCity(city) def regions = CommonDatautils.getRegionListByCity(city)
for(def r : regions){ for(def r : regions){
def row = []
row << city
row << r
def districts = CommonDatautils.findDistricts(city, r, null) def districts = CommonDatautils.findDistricts(city, r, null)
println city +" "+ r +" "+ districts.size() println city +" "+ r +" "+ districts.size()
row << CommonDatautils.queryCityRegionPrice(city, r, null)
def obj = CommonDatautils.findRegionPriceRate(city, r)
row << obj.price_coverage*100
row << districts.size()
ret << row
} }
} }
ExcelUtils.write("D:\\数据\\浙江省城市统计(楼盘量).xlsx",ret,"区县") ExcelUtils.write("D:\\数据\\安徽省城市统计(楼盘量).xlsx",ret,"区县")
} }
@@ -29,16 +29,16 @@ class EsHouseStat {
DBCollection LOG = MongoUtils.getCollectionByName("business", "open_uri_log", "192.168.0.42", 52002) DBCollection LOG = MongoUtils.getCollectionByName("business", "open_uri_log", "192.168.0.42", 52002)
// DBCollection LOG = MongoUtils.getCollectionByName("business", "open_uri_log", "192.168.0.206", 27020) // DBCollection LOG = MongoUtils.getCollectionByName("business", "open_uri_log", "192.168.0.206", 27020)
// public static JdbcDataSource dataSource = new JdbcDataSource() public static JdbcDataSource dataSource = new JdbcDataSource()
// private static final String address = "jdbc:es://http://seawater.es.db.fangjia.com:9200/timezone=UTC&page.size=250&connect.timeout=120s&network.timeout=120s&page.timeout=120s" private static final String address = "jdbc:es://http://seawater.es.db.fangjia.com:9200/timezone=UTC&page.size=250&connect.timeout=120s&network.timeout=120s&page.timeout=120s"
// public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(50) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(50)
// static { static {
// dataSource.setUrl(address) dataSource.setUrl(address)
// Properties connectionProperties = new Properties() Properties connectionProperties = new Properties()
// connectionProperties.put("user", "developer") connectionProperties.put("user", "developer")
// connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3") connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3")
// dataSource.setProperties(connectionProperties) dataSource.setProperties(connectionProperties)
// } }
public static final def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017"; public static final def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017";
public static final DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl) public static final DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
@@ -1,5 +1,7 @@
package com.fangjia.script.gj package com.fangjia.script.gj
import com.fangjia.core.BlockData
import com.fangjia.core.RegionData
import com.fangjia.core.util.DateUtil import com.fangjia.core.util.DateUtil
import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.linxsh.util.AddressUtil import com.fangjia.script.linxsh.util.AddressUtil
@@ -270,6 +272,45 @@ class FiledStrand {
return null return null
} }
static def processName(name){
name = name.replace('·','').replace('.','').replace('●','').replace('@','').replace('%','').replace('?','').replace('Ⅰ期','一期')
if (name.contains('(') && name.contains(')')){
def rep_str = name.subsring(name.index('('),name.lastIndex(')')+1)
name = name.replace(rep_str, '')
}
if (name.contains('(') && name.contains(')')){
def rep_str = name.subsring(name.index('('),name.rfind(')')+1)
name = name.replace(rep_str, '')
}
if (name.find('【')!=-1 && name.find('】')!=-1){
def rep_str = name[name.index('【'):name.rfind('】')+1]
name = name.replace(rep_str, '')
}
if (name.find('【')!=-1 && name.find('】')!=-1){
def rep_str = name[name.index('【'):name.rfind('】')+1]
name = name.replace(rep_str, '')
}
if (name.find('(')!=-1 && name.find(')')!=-1){
def rep_str = name[name.index('('):name.rfind(')')+1]
name = name.replace(rep_str, '')
}
if (name.find('「')!=-1 && name.find('」')!=-1){
def rep_str = name[name.index('「'):name.rfind('」')+1]
name = name.replace(rep_str, '')
}
return name
}
static def processCarSite(car_site_count){ static def processCarSite(car_site_count){
def v = getValue(car_site_count.toString()); def v = getValue(car_site_count.toString());
if(v){ if(v){
@@ -285,7 +326,7 @@ class FiledStrand {
} }
static def processCarSiteDesc(car_site){ static def processCarSiteDesc(car_site){
if(car_site && car_site.size()<=20){ if(car_site && car_site.size()<=20 && car_site.size()>=2 && !car_site.contains("待定") && !car_site.contains("暂无")){
return car_site.toString() return car_site.toString()
} }
return null return null
@@ -337,6 +378,83 @@ class FiledStrand {
return null return null
} }
static def processBlock(city, region, def block){
if(block){
if(block.contains("无") || block.toString().length()>10){
return null
}
// block = BlockData.formatBlock(city, region, block);
return block
}
return null
}
static def processBuildType(def buildType, def estateType){
if(buildType){
def types = []
if(estateType == "别墅"){
def arrs = ["多层","小高层","高层","超高层","花园洋房","老洋房","四合院"]
for(def s : arrs){
if(buildType.contains(s)){
types << s
}
}
}else if(estateType == "商住"){
def arrs = ["独栋","双拼","联排","叠加","老式别墅洋房"]
for(def s : arrs){
if(buildType.contains(s)){
types << s
}
}
}else{
def arrs = ["多层","小高层","高层","超高层","SOHO","soho","LOFT","loft","酒店式公寓"]
for(def s : arrs){
if(buildType.contains(s)){
types << s
}
}
}
if(types){
return types.join(",").toString()
}
}
return null
}
static def processlandProperty(val){
if(val){
def arrs = ["经适房","限价房","廉租房","宅基地","保障房","动迁房","配套房","商品房"]
def property = null
for(def s : arrs){
if(val.contains(s)){
property = s
break;
}
}
return property
}
return null
}
static def processBuildStructure(val) {
if (val) {
def buildStructure= null
if(val.indexOf("砖木")>-1){
buildStructure = "砖木结构"
}else if(val.indexOf("钢结构")>-1){
buildStructure = "钢结构";
}else if(val.indexOf("钢、钢筋混凝土")>-1){
buildStructure = "钢、钢筋混凝土结构";
}else if(val.indexOf("钢筋混凝土")>-1){
buildStructure = "钢筋混凝土结构";
}else if(val.indexOf("混合")>-1){
buildStructure = "混合结构";
}
return buildStructure
}
return null
}
static def isRoad(def s){ static def isRoad(def s){
def pattern = Pattern.compile("[·|½Ö|´óµÀ|Ïï]"); def pattern = Pattern.compile("[·|½Ö|´óµÀ|Ïï]");
def matcher = pattern.matcher(s) def matcher = pattern.matcher(s)
@@ -500,6 +618,12 @@ class FiledStrand {
}else{ }else{
return null; return null;
} }
}else if(estateType2=="写字楼"){
if(estateCharege>=0.35 && estateCharege<=60){
return estateCharege;
}else{
return null;
}
} }
}catch (Exception e){ }catch (Exception e){
println "estateCharege ת²»ÁË "+estateCharege println "estateCharege ת²»ÁË "+estateCharege
@@ -567,7 +567,7 @@ class OpenApiUtils {
} }
static def financialRating(city, address){ static def financialRating(city, address){
def url = "http://open.fangjia.com/address/financialRating?city=${city}&address=${address}&token=2C5B1EDE22A17EDA191B1863B8BD319308E3D89AFBDC76DCD511B639DDF1FC404DA43FE52CB5D8BC666444D9753B39378041962D82A67C4BB45A0E481EE0CA3FF8438C2696B9B57F85B7C110E088361345E89BFEA62FB65442C4ED4508DCEAA931B6C2C05402A3A3" def url = "http://open.fangjia.com/address/financialRating?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
String content = new HttpRequest().get(url, "utf-8"); String content = new HttpRequest().get(url, "utf-8");
if(content){ if(content){
def doc = new JsonSlurper().parseText(content) def doc = new JsonSlurper().parseText(content)
@@ -580,5 +580,79 @@ class OpenApiUtils {
} }
//源地址的完整性进行验证
static def addrVerify(city, address){
def url = "http://open.fangjia.com/addrSvc/addrVerify?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.code ==0 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
// 省、市、区、街道、社区居委、POI补全
static def complete(city, address){
def url = "http://open.fangjia.com/addrSvc/complete?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.code ==0 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
//五级(省/市/区/街道/社区居委)解析、补全
static def division(city, address){
def url = "http://open.fangjia.com/addrSvc/division?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.code ==0 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
//识别地址中省、市、区、道路、POI同时进行地址验证
static def structure(city, address){
def url = "http://open.fangjia.com/addrSvc/structure?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.code ==0 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
/**
* 招商银行测试
* @param city
* @param address
* @return
*/
static def cmbTest(city, address){
def url = "http://open.fangjia.com/address/cmbTest?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.code ==0 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
} }
@@ -0,0 +1,49 @@
package com.fangjia.script.gj
import com.fangjia.core.RegionData
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils
ExcelUtils.multiThreadingModify("C:\\Users\\gaojuan\\Desktop\\成交未匹配.xlsx",{d->
if(d['A'] && !d['E']){
// def dist = CommonDatautils.findDistrict(d['A'], d['B'], d['C'].toString(), "district")
// def dist = CommonDatautils.findDistrictByAlias(d['A'], d['B'], d['C'].toString(), "district")
println d['A'] +" "+d['C']
// def total = findDatas(d['A'], d['B'], d['C'])
// d['D'] = total
def c = getAmapLocation(d['A']+"市", d['B']+"区", d['C'].replace("?","").replace("·","").replace("?","").replace("|","").replace("·",""))
d['E'] = c
}
})
def getAmapLocation(city, region, name){
String sql = "select * from amap_poi_detail where cityname='${city}' and adname='${region}' and MATCH(name, '${name}') "
def total = 0
ElasticUtils.executeSqlQuery(sql,{ d->
if(d.name.contains(name) && d.type.contains("住宅")){
total ++
}
})
return total;
}
def findDatas(def city, def region, def name){
def sql = "select count(*) as count from community where city='${city}' and region='${region}' and name='${name}'"
def total = 0
ElasticUtils.executeSqlQuery(sql, { d->
total = d.count
})
return total;
}
//ExcelUtils.modify("C:\\Users\\gaojuan\\Desktop\\city.xlsx",{d->
// def region = RegionData.formatCity(d['A'])
// if(!region && d['A']){
// println d['A']
// }
//})
@@ -48,11 +48,11 @@ class YouDaDataParser {
def final AtomicInteger count_ = new AtomicInteger(0) def final AtomicInteger count_ = new AtomicInteger(0)
static def statDate = "2023-03-01" static def statDate = "2023-04-01"
static main(args) { static main(args) {
def task = new YouDaDataParser(); def task = new YouDaDataParser();
// task.newHouseparse();//友达一手房存入mongo // task.newHouseparse();//友达一手房存入mongo
// task.esfParser("D:\\数据\\友达\\2023年3月\\查询1.DBF");//友达二手房存入mongo // task.esfParser("D:\\数据\\友达\\2023年5月\\查询1.DBF");//友达二手房存入mongo
// task.newhouseToSaveEs();//新房保存到es // task.newhouseToSaveEs();//新房保存到es
task.esfhouseToSaveEs();//二手房保存到es task.esfhouseToSaveEs();//二手房保存到es
// task.updateFinishDateByEsfTrade();//根据二手成交的竣工时间修改seaweed库中的竣工时间 // task.updateFinishDateByEsfTrade();//根据二手成交的竣工时间修改seaweed库中的竣工时间
@@ -76,24 +76,24 @@ MongoCollection<Document> OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.S
def startDate = DateUtil.parseDate("20230501", "yyyyMMdd") //def startDate = DateUtil.parseDate("20230501", "yyyyMMdd")
def endDate = DateUtil.parseDate("20230508", "yyyyMMdd") //def endDate = DateUtil.parseDate("20230508", "yyyyMMdd")
Calendar calendar = Calendar.getInstance() //Calendar calendar = Calendar.getInstance()
calendar.setTime(startDate) //calendar.setTime(startDate)
def count = 0 //def count = 0
def hashSet = [] //def hashSet = []
def data = [["用户ID", "用户名称", "IP", "访问链接", "访问时间", "dataStatus", "code", "msg", "参数", "resMap"]] //def data = [["用户ID", "用户名称", "IP", "访问链接", "访问时间", "dataStatus", "code", "msg", "参数", "resMap"]]
//
OPEN_URI_LOG.find(and(eq("user_id", "1007779"), eq("data_status", 1), lt("c_date", endDate), gte("c_date", startDate))).each { Document doc -> //OPEN_URI_LOG.find(and(eq("user_id", "1007779"), eq("data_status", 1), lt("c_date", endDate), gte("c_date", startDate))).each { Document doc ->
def result = JSONObject.fromObject(doc.res_map.result) // def result = JSONObject.fromObject(doc.res_map.result)
def item = [doc._id.toString(), "辽宁卓信普惠征信", doc.ip, doc.request_uri, doc.c_date.format("yyyy-MM-dd HH:mm:ss"), doc.data_status, doc.code, doc.msg, JSONObject.fromObject(doc.parameter_map).toString(), result.toString()] // def item = [doc._id.toString(), "辽宁卓信普惠征信", doc.ip, doc.request_uri, doc.c_date.format("yyyy-MM-dd HH:mm:ss"), doc.data_status, doc.code, doc.msg, JSONObject.fromObject(doc.parameter_map).toString(), result.toString()]
data << item // data << item
hashSet << result // hashSet << result
} //}
//
//
//FileUtils.batchCreateFile(data, "d:\\浙商调用详情1.csv",null, "utf-8", false); ////FileUtils.batchCreateFile(data, "d:\\浙商调用详情1.csv",null, "utf-8", false);
ExcelUtils.write("D:\\辽宁卓信普惠征信${startDate.format('yyyyMM')}.xlsx", data, "查询日志") //ExcelUtils.write("D:\\辽宁卓信普惠征信${startDate.format('yyyyMM')}.xlsx", data, "查询日志")
//def startDate = DateUtil.parseDate("20221201", "yyyyMMdd") //def startDate = DateUtil.parseDate("20221201", "yyyyMMdd")
@@ -116,3 +116,26 @@ ExcelUtils.write("D:\\
// //
////FileUtils.batchCreateFile(data, "d:\\浙商调用详情1.csv",null, "utf-8", false); ////FileUtils.batchCreateFile(data, "d:\\浙商调用详情1.csv",null, "utf-8", false);
//ExcelUtils.write("D:\\小区详情${startDate.format('yyyyMM')}.xlsx", data, "查询日志") //ExcelUtils.write("D:\\小区详情${startDate.format('yyyyMM')}.xlsx", data, "查询日志")
def startDate = DateUtil.parseDate("20230501", "yyyyMMdd")
def endDate = DateUtil.parseDate("20230524", "yyyyMMdd")
Calendar calendar = Calendar.getInstance()
calendar.setTime(startDate)
def count = 0
def hashSet = []
def data = [[ "用户名称", "IP", "访问链接", "访问时间", "dataStatus", "code", "msg","访问时长","parameter_map.showCode", "参数-城市", "参数-地址","省","省编码","城市","城市编码","区","区编码","镇","镇","街道","社区","社区编码","poi","楼栋号","单元号","经度","纬度","格式化地址","有效性","路号","楼层","室号"]]
OPEN_URI_LOG.find(and(eq("user_id", "1007780"), eq("request_uri","/v2/address/standard"), eq("data_status", 1), lt("c_date", endDate), gte("c_date", startDate))).each { Document doc ->
def result = JSONObject.fromObject(doc.res_map.result)
def item = [ "福建顶点软件", doc.ip, doc.request_uri, doc.c_date.format("yyyy-MM-dd HH:mm:ss"), doc.data_status, doc.code, doc.msg,doc.time,doc.parameter_map.showCode,
doc.parameter_map.city,doc.parameter_map.address, result.province,result.provinceCode,result.city,result.cityCode,result.district,result.districtCode,result.township,result.townshipCode,result.street,result.community,result.communityCode,result.name,result.buildingNumber,result.unitNumber,result.lng,result.lat,result.formatAddress,result.addrVerify,result.streetNumber,result.floor,result.roomNumber]
data << item
hashSet << result
}
//FileUtils.batchCreateFile(data, "d:\\浙商调用详情1.csv",null, "utf-8", false);
ExcelUtils.write("D:\\福建顶点软件${startDate.format('yyyyMM')}.xlsx", data, "查询日志")
@@ -78,4 +78,16 @@ class FileUtils {
} }
out.close(); out.close();
} }
static def readTxt(def file){
def f = new File(file)
def ret = [];
if(f.exists()){
def lines = org.apache.commons.io.FileUtils.readLines(f,"utf-8")
for(line in lines) {
ret << line;
}
}
return ret;
}
} }
@@ -0,0 +1,207 @@
package com.fangjia.script.gj.data
import com.fangjia.core.util.DateUtil
import com.fangjia.datastore.driver.DSCursor
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import com.mongodb.DBObject
/**
* 按区域统计覆盖率
*/
class XiamenStat {
public static DBCollection cityInfoColl = MongoUtils.getCollectionByName("fangjia_data_ana", "city_info", "mongo.db.fangjia.com")
public static final def DISTRICT_FIELDS_MAP = [
name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',household_count :'householdCount',open_date :'openDate',live_date :'liveDate',build_date:'buildDate',
all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',cubage_percent :'cubagePercent',virescence_percent :'virescencePercent',
car_site :'carSite',estate_charge :'estateCharge',finish_building_date :'finishBuildingDate',business_quarter :'businessQuarter',
start_building_date :'startBuildingDate',loop_line_info :'loopLineInfo',property_life :'propertyLife',house_property :'houseProperty',build_structure :'buildStructure',
lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', street_community:'streetCommunity',committee:'committee',schools:'schools',house_structure:'houseStructure',
alias:'alias',addr_alias:'addrAlias','main_type_area':'mainTypeArea',loudong_count:'loudongCount',car_site_count:'carSiteCount',mapping_alias:'mappingAlias',is_elevator:'elevator',
township:'township',kindergartens:'kindergartens',main_type:'mainType',land_property:'landProperty',usage_card:'usageCard',occupancy_rate:'occupancyRate',land_usage_start:'landUsageStart'
]
static main(args) {
def task = new XiamenStat();
task.run()
}
def run(){
ExcelUtils.modify("D:\\数据\\厦门农商金融\\厦门银行统计1.xlsx",{d->
if(d['D'] && d['D']=="全市"){
def dbo = CommonDatautils.findCityInfo(d['C'].replace("市",""))
if(dbo){
def detail = dbo.district_detail
if(detail){
d['E'] = dbo.existing_district_count//数据量
d['F'] = detail.township*100// 乡镇街道
d['G'] = detail.address*100// 地址
d['H'] = detail.addrAlias*100// 地址别名
d['I'] = detail.name*100// 名称
d['J'] = detail.alias*100// 别名
d['K'] = detail.alias*100// 映射别名
d['L'] = detail.lat2*100// 经纬度(百度)
d['M'] = detail.lat*100// 经纬度(高德)
d['N'] = detail.estateType2*100// 物业类型
d['O'] = detail.buildType*100// 建筑类型
d['P'] = detail.streetCommunity*100// 街道社区
d['Q'] = detail.committee*100// 居委会
d['R'] = detail.businessQuarter*100// 商圈
d['S'] = detail.schools*100// 对口小学
d['T'] = detail.kindergartens*100// 对口幼儿园
d['U'] = detail.loudongCount*100// 楼栋总数
d['V'] = detail.householdCount*100// 户数
d['W'] = detail.estateCharge*100// 物业费
d['X'] = detail.carSiteCount*100// 停车位
d['Y'] = ""// 电梯
d['Z'] = detail.propertyLife*100// 产权年限
d['AA'] = detail.houseProperty*100// 产权性质
d['AB'] = detail.buildStructure*100// 建筑结构(按材料划分)
d['AC'] = detail.landProperty*100// 小区性质
d['AD'] = detail.finishBuildingDate*100// 竣工时间
d['AE'] = detail.openDate*100// 交房时间
d['AF'] = detail.allArea*100// 占地面积
d['AG'] = detail.buildArea*100// 建筑面积
d['AH'] = detail.cubagePercent*100// 容积率
d['AI'] = detail.virescencePercent*100// 绿化率
d['AJ'] = detail.mainType*100// 主力户型
d['AK'] = detail.mainTypeArea*100// 主力户型面积
d['AL'] = detail.developer*100// 开发商
d['AM'] = detail.estateCompany*100// 物业公司
d['AN'] = dbo.price_coverage*100// 小区当前均价
}
}
}else{
def fields = DISTRICT_FIELDS_MAP.keySet().asList()
def regionDistricts = CommonDatautils.findDistrictByCityAndRegions(d['C'].replace("市",""), "district", [d['D'].replace("区","")], fields)
def detail = districtDetail(regionDistricts.size(), regionDistricts);
if(detail){
d['E'] = regionDistricts.size()//数据量
d['F'] = detail.township*100// 乡镇街道
d['G'] = detail.address*100// 地址
d['H'] = detail.addrAlias*100// 地址别名
d['I'] = detail.name*100// 名称
d['J'] = detail.alias*100// 别名
d['K'] = detail.alias*100// 映射别名
d['L'] = detail.lat2*100// 经纬度(百度)
d['M'] = detail.lat*100// 经纬度(高德)
d['N'] = detail.estateType2*100// 物业类型
d['O'] = detail.buildType*100// 建筑类型
d['P'] = detail.streetCommunity*100// 街道社区
d['Q'] = detail.committee*100// 居委会
d['R'] = detail.businessQuarter*100// 商圈
d['S'] = detail.schools*100// 对口小学
d['T'] = detail.kindergartens*100// 对口幼儿园
d['U'] = detail.loudongCount*100// 楼栋总数
d['V'] = detail.householdCount*100// 户数
d['W'] = detail.estateCharge*100// 物业费
d['X'] = detail.carSiteCount*100// 停车位
d['Y'] = ""// 电梯
d['Z'] = detail.propertyLife*100// 产权年限
d['AA'] = detail.houseProperty*100// 产权性质
d['AB'] = detail.buildStructure*100// 建筑结构(按材料划分)
d['AC'] = detail.landProperty*100 // 小区性质
d['AD'] = detail.finishBuildingDate*100// 竣工时间
d['AE'] = detail.openDate*100// 交房时间
d['AF'] = detail.allArea*100// 占地面积
d['AG'] = detail.buildArea*100// 建筑面积
d['AH'] = detail.cubagePercent*100// 容积率
d['AI'] = detail.virescencePercent*100// 绿化率
d['AJ'] = detail.mainType*100// 主力户型
d['AK'] = detail.mainTypeArea*100// 主力户型面积
d['AL'] = detail.developer*100// 开发商
d['AM'] = detail.estateCompany*100// 物业公司
// d['AN'] = ""// 小区当前均价
}
}
})
}
def districtDetail(def disCount, def regionDistricts) {
def countMap = [:]
for(def dbo : regionDistricts) {
DISTRICT_FIELDS_MAP.each() {key,skey->
if (isValid(dbo.get(key))) {
if(countMap.containsKey(key)) {
countMap.put(key, countMap.get(key) + 1)
}else {
countMap.put(key, 1)
}
}
}
}
def districtDetail = [:];
DISTRICT_FIELDS_MAP.each() {key,skey->
if(countMap.containsKey(key)) {
districtDetail.put(skey, roundDouble(countMap.get(key), disCount))
}else {
districtDetail.put(skey, 0)
}
}
if(countMap.containsKey("lat") && countMap.containsKey("lng")) {
districtDetail.put('latLng', roundDouble((countMap.lat > countMap.lng ? countMap.lat : countMap.lng), disCount));
}else {
districtDetail.put('latLng', 0);
}
if(countMap.containsKey("lat2") && countMap.containsKey("lng2")) {
districtDetail.put('latLng2', roundDouble((countMap.lat2 > countMap.lng2 ? countMap.lat2 : countMap.lng2), disCount));
}else {
districtDetail.put('latLng2', 0);
}
return districtDetail;
}
def CONTAINS_KWS = ["...", "暂无", "待定", "未知"]
def EQUALS_KWS = ["0.0", "-", "0.00", "0", "."]
def isValid(def value) {
if (!value) {
return false;
}
if (value instanceof String) {
value = value.trim()
for(String ck : CONTAINS_KWS) {
if(value.contains(ck)) {
return false;
}
}
for(String ek : EQUALS_KWS) {
if(ek.equals(value)) {
return false;
}
}
} else if (value instanceof Number) {
if (value <= 0) {
return false;
}
} else if (value instanceof Collection || value instanceof Map) {
if (value.size() == 0) {
return false;
}
}
return true;
}
double roundDouble(int a, int base) {
if(a == 0 || base == 0) {
return 0
}
return ((double)a / (double)base * 10000.0).toInteger() / 10000.0
}
}
@@ -7,9 +7,11 @@ import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.common.DataHandleUtils import com.fangjia.script.common.DataHandleUtils
import com.fangjia.script.gj.FiledStrand import com.fangjia.script.gj.FiledStrand
import com.fangjia.script.lixue.util.DBUtils import com.fangjia.script.lixue.util.DBUtils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.DbUtils import com.fangjia.script.util.DbUtils
import com.fangjia.script.util.ElasticUtils import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.Jms
import com.fangjia.script.util.MongoUtils import com.fangjia.script.util.MongoUtils
import com.fangjia.script.util.OpenApiClient import com.fangjia.script.util.OpenApiClient
import com.mongodb.BasicDBObject import com.mongodb.BasicDBObject
@@ -17,6 +19,7 @@ import com.mongodb.DBCollection
import com.rabbitmq.client.impl.AMQImpl import com.rabbitmq.client.impl.AMQImpl
import org.bson.types.ObjectId import org.bson.types.ObjectId
import java.text.SimpleDateFormat
import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.CountDownLatch import java.util.concurrent.CountDownLatch
import java.util.concurrent.ExecutorService import java.util.concurrent.ExecutorService
@@ -31,15 +34,32 @@ import java.util.regex.Pattern
class DistrictFieldAddBatch extends BaseBatch{ class DistrictFieldAddBatch extends BaseBatch{
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10)
static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616');
DBCollection SEAWEEDMAP_COLL = MongoUtils.getCollectionByName("fangjia", "seaweedmap", "192.168.0.235", 27018) DBCollection SEAWEEDMAP_COLL = MongoUtils.getCollectionByName("fangjia", "seaweedmap", "192.168.0.235", 27018)
//"安居客":"安居客小程序","链家":"链家","幸福里":"幸福里","城市房产":"城市房产小程序","搜房":"搜房" //"安居客":"安居客小程序","链家":"链家","幸福里":"幸福里","城市房产":"城市房产小程序","搜房":"搜房"
//,"安居客":"安居客小程序","链家":"链家","幸福里":"幸福里","城市房产":"城市房产小程序","搜房":"搜房","我爱我家":"我爱我家" //
def sourceMap = ["安居客-新房":"安居客-新房","禧泰":"中国房价行情","安居客":"安居客小程序","链家":"链家","幸福里":"幸福里","城市房产":"城市房产小程序","搜房":"搜房","我爱我家":"我爱我家"] //key:穆融合表的来源 valve:es解析表的来源 def sourceMap = ["安居客-新房":"安居客-新房","禧泰":"中国房价行情","安居客":"安居客小程序","链家":"链家","幸福里":"幸福里","城市房产":"城市房产小程序","搜房":"搜房","我爱我家":"我爱我家","诸葛找房":"诸葛找房APP","贝壳找房":"贝壳找房",
"乐有家":"乐有家","吉屋":"吉屋","C21":"C21","365淘房":"365淘房"] //key:穆融合表的来源 valve:es解析表的来源
//"alias":"alias", //"alias":"alias",
def fieldsMap = ["estate_charge":"property_fee","estate_type2":"estate_type2","build_date":"build_year","estate_company":"property_company","developer":"developer","virescence_percent":"greening_rate","cubage_percent":"plot_ratio","build_area":"build_area","all_area":"land_area","household_count":"households","car_site_count":"parking_cnt","car_site":"parking_cnt","property_life":"land_usage_period","address":"address"]//key:seaweed表字段 value:es表字段 //ownership_type:权属类型 为商品房、经适房、动迁房等
//house_property 产权性质:国有产权 "house_property":"网站没有",
def fieldsMap = ["estate_charge":"property_fee","block":"block","build_date":"build_year","estate_company":"property_company","developer":"developer",
"virescence_percent":"greening_rate","cubage_percent":"plot_ratio","build_area":"build_area","all_area":"land_area","household_count":"households",
"car_site_count":"parking_cnt","car_site":"parking_cnt","property_life":"land_usage_period","address":"address","build_structure":"building_structure",
"build_type":"build_type", "land_property":"ownership_type","live_date":"live_date",
"loop_line_info":"loop_line"]//key:seaweed表字段 value:es表字段
def fieldsNameMap = ["estate_charge":"物业费","block":"板块","build_date":"建筑年代","estate_company":"物业公司","developer":"开发商",
"virescence_percent":"绿化率","cubage_percent":"容积率","build_area":"建筑面积","all_area":"占地面积","household_count":"户型",
"car_site_count":"车位","car_site":"车位描述","property_life":"产权年限","address":"地址","build_structure":"建筑结构",
"build_type":"建筑类型", "land_property":"权属类别","live_date":"入住时间","loop_line_info":"环线"]
final static def EMAILS = [
"gaojuan@fangjia.com"
]
static main(args) { static main(args) {
runBatch(new DistrictFieldAddBatch(), args) runBatch(new DistrictFieldAddBatch(), args)
@@ -47,21 +67,39 @@ class DistrictFieldAddBatch extends BaseBatch{
@Override @Override
void process(Object args) { void process(Object args) {
def citys = ["漳州","福州","常州","龙岩","厦门","扬州","徐州","镇江","南通","泰州","连云港","盐城","淮安","宿迁","南京","苏州","合肥","无锡","上海","北京","昆明","琼海","呼和浩特","南平","青岛","常德","黄石","黄冈","汉中","安康","榆林","南充","泸州","资阳","克拉玛依","荆门","铜川","内江","达州","巴中","鄂州","十堰","遂宁","随州","广安","荆州","咸宁","阿克苏","喀什","昌吉","吐鲁番","哈密","和田","塔城","阿勒泰","博尔塔拉","巴音郭楞","克孜勒苏","伊犁","恩施","咸阳","宜宾","自贡","攀枝花","延安","德阳","西安","重庆","成都","绵阳","乌鲁木齐","宜昌","武汉","乐山","眉山","宝鸡","襄阳","孝感","拉萨","深圳","三门峡","杭州","怀化","聊城","图木舒克","渭南","金华","宁德","三明","泉州","莆田","营口","牡丹江","盘锦","本溪","铁岭","齐齐哈尔","四平","辽源","锦州","佳木斯","白山","绥化","鸡西","七台河","白城","朝阳","双鸭山","通化","鹤岗","黑河","阜新","抚顺","葫芦岛","伊春","松原","大兴安岭","延边","吉林","沈阳","大连","长春","哈尔滨","鞍山","大庆","丹东"] //"广州", "成都","杭州", "深圳", "重庆","苏州","上海","北京" def citys = CommonDatautils.findAllCity().reverse()
def analysRets = [] def analysRets = []
def rh_analysRets = []
def fields = fieldsMap.keySet() as List
def headers = ["来源", "城市"]
fields.each{it->
headers << fieldsNameMap.get(it)
}
headers << "抓取量"
headers << "匹配量"
headers << "0.9分以上量"
headers << "匹配率"
headers << "0.9以上匹配率"
// analysRets << headers
for(def c : citys){ for(def c : citys){
def totalCount = CommonDatautils.findAllDistrictCount("district", c) def totalCount = CommonDatautils.findAllDistrictCount("district", c)
// addFieldFromRonghe(c, totalCount) if(totalCount){
analysRets = addFieldFromMatch(c, totalCount, analysRets) // rh_analysRets = addFieldFromRonghe(c, totalCount, rh_analysRets)
analysRets = addFieldFromMatch(c, totalCount, analysRets)
}
} }
println analysRets.toString() println analysRets.toString()
sendStatEmail(headers, analysRets, rh_analysRets)
ExcelUtils.write("D:\\数据\\小区\\覆盖率.xlsx", analysRets, "数据") // ExcelUtils.write("D:\\数据\\小区\\覆盖率.xlsx", analysRets, "数据")
} }
def addFieldFromMatch(c, totalCount, analysRets){ def addFieldFromMatch(c, totalCount, analysRets){
def fields = fieldsMap.keySet() as List
sourceMap.each { seaweedmapSource, esWebSource -> sourceMap.each { seaweedmapSource, esWebSource ->
def esRets = findEsDatas(c, esWebSource) def esRets = findEsDatas(c, esWebSource)
def matchRets1 = matchApi(esRets) def matchRets1 = matchApi(esRets)
@@ -80,7 +118,18 @@ class DistrictFieldAddBatch extends BaseBatch{
pre1 = DataHandleUtils.getDoubleRound(2, matchRets1.size()*100/esRets.size()) pre1 = DataHandleUtils.getDoubleRound(2, matchRets1.size()*100/esRets.size())
pre2 = DataHandleUtils.getDoubleRound(2, matchRets2.size()*100/esRets.size()) pre2 = DataHandleUtils.getDoubleRound(2, matchRets2.size()*100/esRets.size())
} }
analysRets << [seaweedmapSource, c, precentMap.get("property_fee"), esRets.size(), matchRets1.size(), matchRets2.size(), pre1, pre2] def analyRet = []
analyRet << seaweedmapSource
analyRet << c
fields.each{key->
analyRet << precentMap.get(key)
}
analyRet << esRets.size()
analyRet << matchRets1.size()
analyRet << matchRets2.size()
analyRet << pre1
analyRet << pre2
analysRets << analyRet
} }
return analysRets; return analysRets;
} }
@@ -88,7 +137,8 @@ class DistrictFieldAddBatch extends BaseBatch{
def addFieldFromRonghe(c, totalCount){ def addFieldFromRonghe(c, totalCount, rh_analysRets){
def fields = fieldsMap.keySet() as List
sourceMap.each{seaweedmapSource,esWebSource-> sourceMap.each{seaweedmapSource,esWebSource->
def rhRets = findRongheDists(c, seaweedmapSource) def rhRets = findRongheDists(c, seaweedmapSource)
def esRets = findEsDistrict(c, esWebSource) def esRets = findEsDistrict(c, esWebSource)
@@ -99,13 +149,35 @@ class DistrictFieldAddBatch extends BaseBatch{
println c +" "+precentMap.toString() println c +" "+precentMap.toString()
updateDB(c, updateRets) updateDB(c, updateRets)
println "----------------------------------------------------------------------------------" println "----------------------------------------------------------------------------------"
def pre1 = 0
def pre2 = 0
if(esRets){
pre1 = DataHandleUtils.getDoubleRound(2, rhRets.size()*100/esRets.size())
pre2 = DataHandleUtils.getDoubleRound(2, esRets.size()*100/esRets.size())
}
def analyRet = []
analyRet << seaweedmapSource
analyRet << c
fields.each{key->
analyRet << precentMap.get(key)
}
analyRet << esRets.size()
analyRet << rhRets.size()
analyRet << esRets.size()
analyRet << pre1
analyRet << pre2
rh_analysRets << analyRet
} }
return rh_analysRets;
} }
def processFieldsFromRh(c, rhRets, esRets){ def processFieldsFromRh(c, rhRets, esRets){
def fields = fieldsMap.keySet() as List def fields = fieldsMap.keySet() as List
def fieldValueMap = [:] def fieldValueMap = [:]
for(def rhDist : rhRets){ for(def rhDist : rhRets){
if(rhDist.commid && rhDist.commid!="null"){
continue
}
def dist = CommonDatautils.findDistrictFieldById(rhDist.commid, fields) def dist = CommonDatautils.findDistrictFieldById(rhDist.commid, fields)
if(!dist){ if(!dist){
println c+" "+rhDist.commid+" 不存在" println c+" "+rhDist.commid+" 不存在"
@@ -116,26 +188,7 @@ class DistrictFieldAddBatch extends BaseBatch{
println c+" "+rhDist.id+" 不存在[ES]" println c+" "+rhDist.id+" 不存在[ES]"
continue continue
} }
def newValues = [:] def newValues = strandField(c, dist, esDbo)
fieldsMap.each{seaweedfield,esField->
def val = dist.get(seaweedfield)
if(!val){
def esVal = esDbo.get(esField)
if(esVal){
def newVal = null
if(seaweedfield == "estate_charge"){
newVal = FiledStrand.processEstateCharge(c, FiledStrand.getNumber(esVal), dist.estate_type2)
newVal = newVal.toString()
}
if(seaweedfield == "build_date"){
newVal = FiledStrand.processFinishBuildingDate(esVal)
}
if(newVal){
newValues.put(seaweedfield, newVal)
}
}
}
}
if(newValues){ if(newValues){
fieldValueMap.put(dist._id.toString(), newValues) fieldValueMap.put(dist._id.toString(), newValues)
} }
@@ -149,77 +202,15 @@ class DistrictFieldAddBatch extends BaseBatch{
def processFieldsFromMatch(c,matchRets){ def processFieldsFromMatch(c,matchRets){
def fields = fieldsMap.keySet() as List def fields = fieldsMap.keySet() as List
fields << "city" fields << "city"
fields << "estate_type2"
def fieldValueMap = [:] def fieldValueMap = [:]
for(def matchDist : matchRets){ for(def matchDist : matchRets){
def dist = CommonDatautils.findDistrictFieldById(matchDist.match_id, fields) def dist = CommonDatautils.findDistrictFieldById(matchDist.match_id, fields)
if(!dist){ if(!dist){
println c+" "+matchDist.match_id+" 不存在" println c+" "+matchDist.match_id+" 不存在"
continue continue
} }
def newValues = strandField(c, dist, matchDist)
def newValues = [:]
fieldsMap.each{seaweedfield,esField->
def val = dist.get(seaweedfield)
if(!val){
def esVal = matchDist.get(esField)
if(esVal){
def newVal = null
if(seaweedfield == "estate_charge"){
newVal = FiledStrand.processEstateCharge(c, FiledStrand.getNumber(esVal), dist.estate_type2)
newVal = newVal.toString()
}
if(seaweedfield == "build_date"){
newVal = FiledStrand.processFinishBuildingDate(esVal)
}
if(seaweedfield == "estate_company" || seaweedfield == "developer"){
newVal = FiledStrand.processCompany(esVal)
}
if(seaweedfield =="virescence_percent"){
newVal = FiledStrand.processVirescencePercent(esVal)
}
if(seaweedfield =="cubage_percent"){
newVal = FiledStrand.processCubagePercent(esVal)
}
if(seaweedfield =="all_area" || seaweedfield =="build_area"){
newVal = FiledStrand.processArea(esVal)
newVal = newVal.toString()
}
if(seaweedfield =="household_count"){
newVal = FiledStrand.processHouseholdCount(esVal, dist.estate_type2)
}
if(seaweedfield =="loudong_count"){
newVal = FiledStrand.processLoudongCount(esVal)
}
if(seaweedfield =="car_site_count"){
newVal = FiledStrand.processCarSite(esVal)
}
if(seaweedfield =="car_site"){
newVal = FiledStrand.processCarSiteDesc(esVal)
}
if(seaweedfield =="property_life"){
newVal = FiledStrand.processPropertyLife(esVal)
}
if(seaweedfield =="alias"){
newVal = FiledStrand.processAlias(esVal, dist.name, dist.alias)
}
if(seaweedfield =="address"){
newVal = FiledStrand.processAddress(esVal, dist.city)
}
if(newVal){
newValues.put(seaweedfield, newVal)
}
}
}
}
if(newValues){ if(newValues){
println dist._id.toString()+" "+newValues.toString() println dist._id.toString()+" "+newValues.toString()
fieldValueMap.put(dist._id.toString(), newValues) fieldValueMap.put(dist._id.toString(), newValues)
@@ -229,6 +220,89 @@ class DistrictFieldAddBatch extends BaseBatch{
return fieldValueMap; return fieldValueMap;
} }
def strandField(c,dist, matchDist){
def newValues = [:]
fieldsMap.each{seaweedfield,esField->
def val = dist.get(seaweedfield)
if(!val){
def esVal = matchDist.get(esField)
if(esVal){
def newVal = null
if(seaweedfield == "estate_charge"){
newVal = FiledStrand.processEstateCharge(c, FiledStrand.getNumber(esVal), dist.estate_type2)
newVal = newVal.toString()
}
if(seaweedfield == "build_date" || seaweedfield == "live_date"){
newVal = FiledStrand.processFinishBuildingDate(esVal)
}
if(seaweedfield == "estate_company" || seaweedfield == "developer"){
newVal = FiledStrand.processCompany(esVal)
}
if(seaweedfield =="virescence_percent"){
newVal = FiledStrand.processVirescencePercent(esVal)
}
if(seaweedfield =="cubage_percent"){
newVal = FiledStrand.processCubagePercent(esVal)
}
if(seaweedfield =="all_area" || seaweedfield =="build_area"){
newVal = FiledStrand.processArea(esVal)
if(newVal){
newVal = newVal.toString()
}
}
if(seaweedfield =="household_count"){
newVal = FiledStrand.processHouseholdCount(esVal, dist.estate_type2)
}
if(seaweedfield =="loudong_count"){
newVal = FiledStrand.processLoudongCount(esVal)
}
if(seaweedfield =="car_site_count"){
newVal = FiledStrand.processCarSite(esVal)
}
if(seaweedfield =="car_site"){
newVal = FiledStrand.processCarSiteDesc(esVal)
}
if(seaweedfield =="property_life"){
newVal = FiledStrand.processPropertyLife(esVal)
}
if(seaweedfield =="alias"){
newVal = FiledStrand.processAlias(esVal, dist.name, dist.alias)
}
if(seaweedfield =="address"){
newVal = FiledStrand.processAddress(esVal, dist.city)
}
if(seaweedfield =="block"){
newVal = FiledStrand.processBlock(dist.city, dist.region, esVal)
}
if(seaweedfield == "build_type"){
newVal = FiledStrand.processBuildType(esVal, dist.estate_type2)
}
if(seaweedfield == "land_property"){
newVal = FiledStrand.processlandProperty(esVal)
}
if(seaweedfield == "build_structure"){
newVal = FiledStrand.processBuildStructure(esVal)
}
if(newVal){
newValues.put(seaweedfield, newVal)
}
}
}
}
return newValues;
}
def findRongheDists(def city, def source){ def findRongheDists(def city, def source){
@@ -285,9 +359,9 @@ class DistrictFieldAddBatch extends BaseBatch{
def precentMap = [:] def precentMap = [:]
fieldsMap.each() {key,skey-> fieldsMap.each() {key,skey->
if(countMap.containsKey(key)) { if(countMap.containsKey(key)) {
precentMap.put(skey, DataHandleUtils.getDoubleRound(2, countMap.get(key)*100/total)) precentMap.put(key, DataHandleUtils.getDoubleRound(2, countMap.get(key)*100/total))
}else { }else {
precentMap.put(skey, 0) precentMap.put(key, 0)
} }
} }
return precentMap; return precentMap;
@@ -414,4 +488,61 @@ class DistrictFieldAddBatch extends BaseBatch{
} }
return false return false
} }
def sendStatEmail(headers, analysRets, rh_nalysRets){
Date dateTime = DateUtils.mins(1);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
StringBuffer sb = new StringBuffer();
if(analysRets){
sb.append("<table border='1' style='border-collapse:collapse; border-spacing:0'>")
sb.append("<tr><font style='size:15px;color:grey;'>字段补充情况分析</tr>")
sb.append("<tr style='color:black;font-size:18px;cellspacing:1px;'>")
headers.each{it->
if(it=="来源" || it=="城市"){
sb.append("<th style='width:80px;'>"+ it+"</th>")
}else{
sb.append("<th >"+ it+"</th>")
}
}
sb.append("</tr>")
for(def ret : analysRets){
sb.append("<tr style='text-align:center;font-color:gray;cellspacing:1px;'>");
ret.each{it->
sb.append("<td>" + it + "</td>")
}
sb.append("</tr>");
}
sb.append("</table><br/>");
}
StringBuffer rh_sb = new StringBuffer();
if(rh_nalysRets){
rh_sb.append("<table border='1' style='border-collapse:collapse; border-spacing:0'>")
rh_sb.append("<tr><font style='size:15px;color:grey;'>字段补充情况分析</tr>")
rh_sb.append("<tr style='color:black;font-size:18px;cellspacing:1px;'>")
headers.each{it->
if(it=="来源" || it=="城市"){
rh_sb.append("<th style='width:80px;'>"+ it+"</th>")
}else{
rh_sb.append("<th >"+ it+"</th>")
}
}
rh_sb.append("</tr>")
for(def ret : rh_nalysRets){
rh_sb.append("<tr style='text-align:center;font-color:gray;cellspacing:1px;'>");
ret.each{it->
rh_sb.append("<td>" + it + "</td>")
}
rh_sb.append("</tr>");
}
rh_sb.append("</table><br/>");
}
for (def email : EMAILS) {
jms.sendMail(email, "字段填充情况分析", sb.toString()+rh_sb.toString());
}
}
} }
@@ -0,0 +1,69 @@
package com.fangjia.script.gj.district
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.common.DataHandleUtils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
/**
* 字段提升率统计
*/
DBCollection CITY_INFO_CONN = MongoUtils.getCollectionByName("fangjia_data_ana", "city_info", MongoUtils.MongoDB_Domain_mongo);
def fieldsMap = ["district_count":"小区数量","name":"名称" ,"region":"区域" ,"block":"板块" ,"address":"地址" ,"estateType2":"物业类型" ,"householdCount":"户数" ,"openDate":"开盘时间" ,"liveDate":"入住时间" ,"buildDate":"建筑年代" ,"allArea":"占地面积" ,"buildArea":"建筑面积" ,"buildType":"建筑类型" ,"developer":"开发商" ,"estateCompany":"物业公司" ,"cubagePercent":"容积率" ,"virescencePercent":"绿化率" ,"carSite":"停车位" ,"estateCharge":"物业费" ,"floorplanPics":"户型图" ,"outPics":"外景图" ,"finishBuildingDate":"竣工时间" ,"businessQuarter":"商圈" ,"startBuildingDate":"开建时间" ,"loopLineInfo":"环线" ,"propertyLife":"产权年限" ,"houseProperty":"产权性质" ,"licence":"预售许可证" ,"buildStructure":"建筑结构" ,"lat":"百度纬度" ,"pics":"图片" ,"streetCommunity":"街道" ,"schools":"学校" ,"houseStructure":"房屋结构" ,"alias":"别名" ,"addrAlias":"地址别名" ,"mainTypeArea":"主力面积" ,"loudongCount":"楼栋数" ,"latLng" :"高德经度" ,"rentPrice":"租金" ]
def weeknd = DateUtils.getFirstDayOfWeek(new Date())
def lastWeeknd = DateUtils.getFirstDayOfWeek(new Date()-7)
def weekendDatas = CITY_INFO_CONN.find(new BasicDBObject("weekend", weeknd))
def lastWeekendDatas = CITY_INFO_CONN.find(new BasicDBObject("weekend", lastWeeknd))
def weekendMapDatas = findDataByCity(weekendDatas)
def lastWeekendMapDatas = findDataByCity(lastWeekendDatas)
def citys = CommonDatautils.findAllCity()
def fields = fieldsMap.keySet() as List
def rets = []
def headers = []
headers << "城市"
fields.each{k->
headers << fieldsMap.get(k)
}
rets << headers
for(def c : citys){
def weekendDetailMap = weekendMapDatas.get(c)
def lastWeekendDetailMap = lastWeekendMapDatas.get(c)
def ret = []
ret << c
fields.each{key->
if(weekendDetailMap){
def v1 = weekendDetailMap.get(key)
def v2 = lastWeekendDetailMap.get(key)
if(v1 && v2){
ret << DataHandleUtils.getDoubleRound(4, v1-v2)*100
}else{
ret << "-"
}
}else{
ret << "-"
}
}
rets << ret
}
ExcelUtils.write("D:\\数据\\小区\\字段提升率"+DateUtils.formatDateByPattern(weeknd,"yyyy-MM-dd")+".xlsx", rets, "字段提升率统计")
def findDataByCity(weekendDatas){
def map = [:]
for(def d : weekendDatas){
d.district_detail.district_count = d.existing_district_count
map.put(d.city, d.district_detail)
}
return map
}
@@ -95,7 +95,7 @@ class FangjiaClientUtils {
try { try {
if(address){ if(address){
address = address.replace("{","") address = address.replace("{","")
def url = "http://192.168.0.19:31080/FangJiaAddressService/structure/v2?address="+URLEncoder.encode(address,"UTF-8") def url = "http://192.168.0.100:32080/FangJiaAddressService/structure/v2?address="+URLEncoder.encode(address,"UTF-8")
if(city){ if(city){
url = url +"&city="+URLEncoder.encode(city,"UTF-8") url = url +"&city="+URLEncoder.encode(city,"UTF-8")
} }
@@ -0,0 +1,79 @@
package com.fangjia.script.gj.district
import com.fangjia.script.BaseBatch
import com.fangjia.script.BatchOwner
import com.fangjia.script.Watcher
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.gj.FiledStrand
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
/**
* 写字楼字段清洗入库(自动入库)
*/
@BatchOwner(Watcher.GaoJuan)
class OfficeFieldCleanBatch extends BaseBatch{
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10)
static main(args) {
runBatch(new OfficeFieldCleanBatch(), args)
}
@Override
void process(Object args) {
def citys = CommonDatautils.findAllCity().reverse()
for(def c : citys){
def offices = findAllOffice(c)
strandField(offices)
}
}
def strandField(offices){
def fields = ["property_fee","build_area","","","","","","","","","",""]
for(def office : offices){
fields.each{
def newVal = null
if(it == "property_fee"){
newVal = FiledStrand.processEstateCharge(office.city,office.get(it), "写字楼")
newVal = newVal.toString()
}
if(it =="all_area" || it =="build_area"){
newVal = FiledStrand.processArea(office.get(it))
if(newVal && newVal > 5000){
newVal = newVal.toString()
}
}
if(it =="name"){
newVal = FiledStrand.processName(office.get(it))
if(newVal){
newVal = newVal.toString()
}
}
}
}
}
def findAllOffice(city){
def sql = "select * from office where city='${city}'"
def rets = []
ElasticUtils.executeSqlQuery(sql, { d->
rets << d
})
return rets
}
}
@@ -26,8 +26,10 @@ class SeaweedDataMatchProcess {
rMap.region = obj.region rMap.region = obj.region
rMap.alias = obj.alias rMap.alias = obj.alias
rMap.name = obj.name rMap.name = obj.name
rMap.lat = obj.lat/10000000000.0 if(obj.lat){
rMap.lng = obj.lng/10000000000.0 rMap.lat = obj.lat/10000000000.0
rMap.lng = obj.lng/10000000000.0
}
rMap.id = obj._id.toString() rMap.id = obj._id.toString()
rMap.address = obj.address rMap.address = obj.address
} }
@@ -142,5 +144,8 @@ class SeaweedDataMatchProcess {
} }
public static void main(def agrs){
doMatch("上海", "静安", "金家巷西弄", null)
}
} }
@@ -1,7 +1,9 @@
package com.fangjia.script.gj.es package com.fangjia.script.gj.es
import com.fangjia.core.RegionData
import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.common.DataHandleUtils import com.fangjia.script.common.DataHandleUtils
import com.fangjia.script.gj.OpenApiUtils
import com.fangjia.script.util.DateUtils import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ElasticUtils import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils import com.fangjia.script.util.ExcelUtils
@@ -19,11 +21,44 @@ class EsMonthHouseStat {
def task = new EsMonthHouseStat() def task = new EsMonthHouseStat()
// task.run() // task.run()
// task.tradeRun() // task.tradeRun()
task.houseRun() // task.houseRun()
// task.statHouseUpdateCount() // task.statHouseUpdateCount()
// task.statDistHouse() // task.statDistHouse()
task.statRent()
}
def statRent(){
def index = 0
ExcelUtils.multiThreadingModify("D:\\Êý¾Ý\\ÆäËü\\×â½ð.xlsx", { d ->
index++
def region = RegionData.formatRegion(d['A'], d['B'])
if(region){
def dist = CommonDatautils.findDistrict(d['A'], region, d['C'], "district")
if(!dist){
dist = OpenApiUtils.matchDistrictByAddr(d['A'], d['C'], region)
if(dist){
dist = CommonDatautils.findDistrictById(dist.id)
}
}
def alias = []
if(dist.alias){
if(!dist.alias.contains(dist.name)){
dist.alias << dist.name
}
alias = dist.alias
}else{
alias << dist.name
}
def distCount = findHouseCount(dist.city, dist.region, alias, 20220501, 20230501)
d['G'] = distCount
d['E'] = dist.region
d['F'] = dist.name
println index+" "+ d['C'] +" "+distCount
}
});
} }
def statDistHouse(){ def statDistHouse(){
@@ -172,7 +207,7 @@ class EsMonthHouseStat {
def total = 0 def total = 0
try{ try{
aliasStr = escapeExprSpecialWord(alias.join("','")) aliasStr = escapeExprSpecialWord(alias.join("','"))
String sql = "select count(*) as c from latest_seawater where cat='sell' and city='${city}' and p_date >= ${startDate} and p_date<${endDate} and region='${region}' and district_name in ('${aliasStr}')" String sql = "select count(*) as c from latest_seawater where cat='rent' and city='${city}' and p_date >= ${startDate} and p_date<${endDate} and region='${region}' and district_name in ('${aliasStr}') and root='lianjia.com'"
ElasticUtils.executeSqlQuery(sql,{data-> ElasticUtils.executeSqlQuery(sql,{data->
total = data.c total = data.c
@@ -15,7 +15,7 @@ String address = "jdbc:es://http://192.168.0.86:9200/timezone=UTC&page.size=250&
stat() stat()
def stat(){ def stat(){
def datas = ExcelUtils.read("D:\\数据\\fjw-提交.xlsx",0,1) def datas = ExcelUtils.read("D:\\数据\\fjw-提交3.xlsx",0,1)
def map=[:] def map=[:]
for(def d : datas){ for(def d : datas){
def count = map.get(d['C']) def count = map.get(d['C'])
@@ -69,8 +69,8 @@ def findLogs(){
def findFangjiaLogs(){ def findFangjiaLogs(){
def startDate = DateUtil.parseDate("20230329", "yyyyMMdd") def startDate = DateUtil.parseDate("20230501", "yyyyMMdd")
def endDate = DateUtil.parseDate("20230429", "yyyyMMdd") def endDate = DateUtil.parseDate("20230531", "yyyyMMdd")
Calendar calendar = Calendar.getInstance() Calendar calendar = Calendar.getInstance()
calendar.setTime(startDate) calendar.setTime(startDate)
def list = [] def list = []
@@ -84,14 +84,21 @@ def findFangjiaLogs(){
QueryBuilder date_range = QueryBuilders.rangeQuery("@timestamp").from(startDate).to(nextDate).includeLower(true).includeUpper(false); QueryBuilder date_range = QueryBuilders.rangeQuery("@timestamp").from(startDate).to(nextDate).includeLower(true).includeUpper(false);
def q = QueryBuilders.fuzzyQuery("request", "/doAdd2") // def q = QueryBuilders.fuzzyQuery("request", "/doAdd2")
// QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(q).must(date_range)
def q = QueryBuilders.fuzzyQuery("request", "/enquire")
QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(q).must(date_range) QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(q).must(date_range)
def houses = ElasticUtils.executeSimpleQuery("192.168.0.86", "fangjia-log*", queryBuilder); def houses = ElasticUtils.executeSimpleQuery("192.168.0.86", "fangjia-log*", queryBuilder);
println houses.size() println houses.size()
if (houses) { if (houses) {
for (def d : houses) { for (def d : houses) {
def reqStr = d.request.toString() def reqStr = d.request.toString()
if(!reqStr.contains("/enquire")){
continue
}
def mid = null def mid = null
if (reqStr.contains("mid=")) { if (reqStr.contains("mid=")) {
@@ -107,5 +114,5 @@ def findFangjiaLogs(){
startDate = nextDate startDate = nextDate
} }
ExcelUtils.write("D:\\数据\\fjw-提交.xlsx", data, "查询日志") ExcelUtils.write("D:\\数据\\fjw-提交3.xlsx", data, "查询日志")
} }
@@ -0,0 +1,232 @@
package com.fangjia.script.gj.es
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils
import org.apache.commons.lang.StringUtils
import org.apache.lucene.queryparser.classic.QueryParser
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.CountDownLatch
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicLong
class HouseAnaly {
public static final String[] TAGS = ["独栋", "联排", "叠加", "双拼", "花园面积", "泳池", "别墅", "带花园", "洋房", "叠拼", "独院", "联体", "微墅", "大平墅"];
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(30)
static main(args) {
def task = new HouseAnaly()
task.run()
}
def run(){
def citys = CommonDatautils.findAllCity()
def allRets = []
for(def city : citys){
def districts = CommonDatautils.findAllDistrictByCity(city,"district", ["city","region","name","alias", "estate_type2"])
def rets = processing(districts)
println "[${city}] 写文件 "+rets.size()
allRets.addAll(rets)
}
ExcelUtils.write("d:\\数据\\样本房源分析(20%).xlsx", allRets, "房源分析")
}
def processing(dists){
def rets = new CopyOnWriteArrayList()
rets << ["小区ID","城市","区域","名称","是否是主名","样本量","最大值","最小值","平均值","中位值","10分位置","90分位置","住宅样本量","别墅样本量","商住样本量"]
def totalCount = new AtomicLong()
final CountDownLatch latch = new CountDownLatch(dists.size())
for(def i=0;i<dists.size();i++){
final def dist = dists[i]
fixedThreadPool.execute(new Runnable() {
void run() {
try{
totalCount.addAndGet(1)
if(dist.alias && dist.alias.size()>=1){
def ret = analy(dist)
if(ret){
rets.addAll(ret)
}
}
} catch (Exception e) {
e.printStackTrace()
} finally {
latch.countDown()
}
}
});
}
latch.await()
return rets;
}
def analy(dist){
def masterRet = runAnalying(dist._id, dist.city, dist.region, dist.name, "是");
def alias = dist.alias
for(def aliasName : alias){
if(!aliasName.contains(dist.name) && !dist.name.contains(aliasName)){
def aliaRet = runAnalying(dist._id, dist.city, dist.region, aliasName, "否");
if(aliaRet){
masterRet.addAll(aliaRet)
}
}
}
if(masterRet.size()>=2){
def masterAvgPrice = 0
def masterMidPrice = 0
def back = false
for(def row : masterRet){
if(row.get(4)=="是"){
masterAvgPrice = row.get(8)
masterMidPrice = row.get(9)
}else{
def pre1 = 0
def pre2 = 0
if(masterAvgPrice>0){
pre1 = java.lang.Math.abs((row.get(8)-masterAvgPrice)*100/masterAvgPrice)
}
if(masterMidPrice>0){
pre2 = java.lang.Math.abs((row.get(9)-masterMidPrice)*100/masterMidPrice)
}
if(pre1>=20 || pre2>=20){
back = true
}
}
}
if(back){
return masterRet
}
}
return null;
}
//小区ID 城市 区域 名称 是否是主名 样本量 最大值 最小值 平均值 中位值 10分位置 90分位置 住宅样本量 别墅样本量 商住样本量
def runAnalying(id, city, region, name, flag){
def houses = findHouse(city, region, name);
def rets = []
if(houses && houses.size()>=5){
def prices = []
for(def house : houses){
prices << house.avg_price
}
prices = prices.sort()
def average = (int)(prices.sum() / prices.size())
def midPrice = getMidPrice(prices)
def price10 = null
def price90 = null
if(houses.size()>=10){
def postion = Math.round(houses.size()/10)
price10 = prices.get((int)(postion-1))
price90 = prices.get((int)(houses.size()-postion-1))
}
def countMap = classType(houses)
// def pre = java.lang.Math.abs((midPrice-average)*100/average)
// if(pre>=20){
rets << [id.toString(), city, region, name, flag, prices.size(), prices.get(prices.size()-1), prices.get(0), average, midPrice, price10, price90, countMap.get("district"), countMap.get("villa"), countMap.get("business")]
// }
}
return rets
}
def classType(houses){
def district = 0
def villa = 0
def business = 0
for(def h : houses){
if(h.estate_type){
if(h.estate_type == "别墅"){
villa = villa + 1
continue
}else if(h.estate_type.contains("商住") || h.estate_type.contains("商业") || h.estate_type.contains("商务")){
business = business + 1
continue
}
}
def valla = isVilla(h.area, h.name, h.height, h.room)
if(valla){
villa = villa + 1
continue
}
district = district + 1
}
return ["district":district, "villa":villa, "business":business]
}
/**
* 是否是别墅
* @return
*/
public boolean isVilla(area, name, height, room) {
if (area == null) {
return false;
}
if (area >= 150 && StringUtils.indexOfAny(name, TAGS) > -1) {
return true;
}
boolean ret = false;
if (height != null && room != null) {
if (height <= 3) {
if (area > 200 && room >= 5) {
ret = true;
}
}
} else if (height == null && room != null) {
if (area > 360 && room >= 6) {
ret = true;
}
} else if (height == null && room == null) {
if (area > 500) {
ret = true;
}
}
return ret;
}
def getMidPrice(def prices){
def mid = prices.size()/2
if(mid > (int)mid){
return prices.get((int)mid)
}else{
def total = prices.get((int)(mid-1))+prices.get((int)(mid+1-1))
return (int)(total/2)
}
return null
}
def findHouse(def city, def region, def name){
def houses = []
try{
name = escapeExprSpecialWord(name)
String sql = "select * from latest_seawater where cat='sell' and city='${city}' and p_date >= 20230101 and region='${region}' and district_name='${name}'"
ElasticUtils.executeSqlQuery(sql,{ d->
def r = ["name":d.name, "avg_price":d.avg_price, "area":d.area,"floor": d.floor, "height":d.height,"estate_type": d.estate_type, "build_type":d.build_type]
houses << r
// println r
})
}catch(Exception e){
e.printStackTrace()
}
return houses
}
/**
* 转义字符串中的特殊字符
* 仅过滤Lucene regexps, 其他的勿用
* @param keyword
* @return
*/
public static String escapeExprSpecialWord(String keyword) {
return QueryParser.escape(keyword);
}
@@ -21,13 +21,23 @@ class GaoDeMapSearchTest {
static main(args) { static main(args) {
def task = new GaoDeMapSearchTest(); def task = new GaoDeMapSearchTest();
def path = "D:\\数据\\光大\\光大测试-V2.xlsx" def path = "D:\\数据\\富民\\富民测试500.xlsx"
// task.structureV2(path) // task.structureV2(path)
// task.match(path) // task.match(path)
// task.mapSearch(path) // task.mapSearch(path)
task.baiduMapSearch(path) // task.baiduMapSearch(path)
task.checkTrue(path) // task.checkTrue(path)
task.addFinancialLevel(path)
}
def addFinancialLevel(path){
ExcelUtils.multiThreadingModify(path, { row ->
def results = com.fangjia.script.gj.OpenApiUtils.financialRating(null, row['A'])
if(results){
row['V'] = results.consumptionRating
}
});
} }
def checkTrue(path){ def checkTrue(path){
@@ -3,6 +3,7 @@ package com.fangjia.script.gj.paimai
import com.fangjia.core.RegionData import com.fangjia.core.RegionData
import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.crawl.JQueryUtils import com.fangjia.script.crawl.JQueryUtils
import com.fangjia.script.gj.ccb.FileUtils
import com.fangjia.script.thirdPriceCrawl.CrawalDBUtil import com.fangjia.script.thirdPriceCrawl.CrawalDBUtil
import com.fangjia.script.util.DateUtils import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.MongoUtils import com.fangjia.script.util.MongoUtils
@@ -34,6 +35,8 @@ public class BeiKeCrawlByChrome {
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl) DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
def startMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -1, "yyyy-MM") def startMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -1, "yyyy-MM")
//广州,佛山 重庆
static main(args) { static main(args) {
def task = new BeiKeCrawlByChrome(); def task = new BeiKeCrawlByChrome();
task.run() task.run()
@@ -49,27 +52,8 @@ public class BeiKeCrawlByChrome {
WebDriver driver = new ChromeDriver() WebDriver driver = new ChromeDriver()
def citys = getAllCityUrls(driver) def citys = getAllCityUrls(driver)
// citys = citys.reverse()
// def index = 0 driver = getLogin(driver, "https://sh.ke.com/")
// for(def c : citys){
// index++
// if(c.city=="合肥"){
// break
// }
// }
// citys = citys[index..citys.size()-1]
def start = 0
// for(def i=0;i<citys.size();i++){
// def m = citys[i]
// println i+" "+ m.city
// if(m.city=="天津"){
// start = i
// break;
// }
//
// }
// citys = citys[(start+1)..(citys.size()-1)]
getLogin(driver)
crawlData(driver, citys) crawlData(driver, citys)
@@ -108,15 +92,45 @@ public class BeiKeCrawlByChrome {
} }
} }
def checkDocument(driver, url){
def s = driver.getPageSource()
def flag = true
while(flag){
if(s && (s.contains("无法访问此网站") || s.contains("<title>登录</title>"))){
driver = getLogin(driver, url)
driver.get(url)
Thread.sleep(5000)
s = driver.getPageSource()
}else{
flag = false
}
}
return Jsoup.parse(s);
}
def crawlData(driver, citys){ def crawlData(driver, citys){
def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017"; def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017";
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl) DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
def runedCitys = FileUtils.readTxt("d:\\数据\\成交抓取\\贝壳已抓城市.txt")
for(def m : citys){ for(def m : citys){
def city = m[0] def city = m[0]
if(runedCitys.contains(city)){
println city +" 已运行"
continue
}
def newCity = RegionData.formatCity(city)
if(!newCity){
if(city=="昆山"){
newCity = "苏州"
}
println city +" 无法格式化"
}
def url = m[1] def url = m[1]
driver.get(url+"/chengjiao/") def newUrl = url+"/chengjiao/"
driver.get(newUrl)
Thread.sleep(10000) Thread.sleep(10000)
def doc = Jsoup.parse(driver.getPageSource()); def doc = checkDocument(driver, newUrl);
def regions = JQueryUtils.select(".position dl:contains(位置)+dl a", doc) def regions = JQueryUtils.select(".position dl:contains(位置)+dl a", doc)
if(regions){ if(regions){
for(def r : regions){ for(def r : regions){
@@ -124,14 +138,19 @@ public class BeiKeCrawlByChrome {
def href = url+ r.attr("href") def href = url+ r.attr("href")
println "开始抓取【${city}】【${regionText}】【${href}】" println "开始抓取【${city}】【${regionText}】【${href}】"
def detailUrls = getPageDeail(driver, city, href, regionText) if(city == "昆山"){
regionText = "昆山"
}
def detailUrls = getPageDeail(driver, newCity, href, regionText)
println url +" 详情链接:"+detailUrls.size() println url +" 详情链接:"+detailUrls.size()
} }
} }
FileUtils.batchCreateFile([[city]], "d:\\数据\\成交抓取\\贝壳已抓城市.txt", [], "utf-8", true);
// def detailUrls = getPageDeail(driver, m.city, m.url) // def detailUrls = getPageDeail(driver, m.city, m.url)
// println m.city +" 详情链接:"+detailUrls.size() // println m.city +" 详情链接:"+detailUrls.size()
// crawlDetail(driver, DEAL_PRICE_COLL, detailUrls) // crawlDetail(driver, DEAL_PRICE_COLL, detailUrls)
} }
} }
@@ -172,13 +191,9 @@ public class BeiKeCrawlByChrome {
def detailUrls = [] def detailUrls = []
while(!stop){ while(!stop){
def url = cityUrl + "pg${page}/" def url = cityUrl + "pg${page}/"
try{ driver.get(url)
driver.get(url) // def doc = Jsoup.parse(driver.getPageSource());
}catch(Exception e){ def doc = checkDocument(driver, url);
println url +" 出错"
}
def doc = Jsoup.parse(driver.getPageSource());
def elements = JQueryUtils.select(".listContent li", doc) def elements = JQueryUtils.select(".listContent li", doc)
if(elements){ if(elements){
for(def e : elements){ for(def e : elements){
@@ -188,7 +203,10 @@ public class BeiKeCrawlByChrome {
def endDate = DateUtils.parseFromTightByPattern(startMonth + "-01", "yyyy-MM-dd") def endDate = DateUtils.parseFromTightByPattern(startMonth + "-01", "yyyy-MM-dd")
if(dealDate && dealDate.getTime()>=endDate.getTime()){ if(dealDate && dealDate.getTime()>=endDate.getTime()){
detailUrls << durl detailUrls << durl
parse(city, e, region) def dbo = findTrade(durl , "贝壳找房")
if (!dbo) {
parse(city, e, region, driver)
}
}else{ }else{
stop = true; stop = true;
break; break;
@@ -206,12 +224,20 @@ public class BeiKeCrawlByChrome {
return detailUrls return detailUrls
} }
def parse(city,e, region){ def parse(city,e, region, driver){
try { try {
def detailUrl = e.select(".title a").attr("href")
driver.get(detailUrl)
def detailDoc = checkDocument(driver, detailUrl);
def title = e.select(".title a").text() def title = e.select(".title a").text()
if (title) { if (title) {
def detail = new BasicDBObject() def detail = new BasicDBObject()
def arrs = title.split(" ") def arrs = title.split(" ")
if(title.contains("车位")){
detail.type = "车位"
}
detail.city = city detail.city = city
detail.district_name = arrs[0] detail.district_name = arrs[0]
detail.region = region//findRegionByThirdPary(detail.city, detail.district_name) detail.region = region//findRegionByThirdPary(detail.city, detail.district_name)
@@ -220,6 +246,9 @@ public class BeiKeCrawlByChrome {
} }
def roomStr = arrs[1] def roomStr = arrs[1]
if(roomStr && !roomStr.contains("室")){
roomStr = arrs[2]
}
if (roomStr) { if (roomStr) {
if (roomStr.indexOf("室") > 0) { if (roomStr.indexOf("室") > 0) {
roomStr = roomStr.substring(0, roomStr.indexOf("室")) roomStr = roomStr.substring(0, roomStr.indexOf("室"))
@@ -235,7 +264,13 @@ public class BeiKeCrawlByChrome {
} }
} }
def areaStr = arrs[2].replace("平米", "") def areaStr = arrs[2]
if(areaStr && !areaStr.contains("平米")){
if(arrs.size()>=4){
areaStr = arrs[3]
}
}
areaStr = areaStr.replace("平米","")
if (areaStr && areaStr.isNumber()) { if (areaStr && areaStr.isNumber()) {
detail.area = areaStr.toDouble() detail.area = areaStr.toDouble()
} }
@@ -254,28 +289,42 @@ public class BeiKeCrawlByChrome {
} }
detail.source = "贝壳找房" detail.source = "贝壳找房"
if(detail.total_price){ def liftStr = JQueryUtils.selectText("li:contains(梯户比例)",detailDoc).replace("梯户比例","")
def detailUrl = e.select(".title a").attr("href") if(liftStr){
detail.url = detailUrl detail.lift = DataFormatUtils.parseLift(liftStr)
def dbo = findTrade(detail) detail.lift_household = DataFormatUtils.parseHousehold(liftStr)
if (!dbo) { }
def houseInfo = e.select(".houseInfo").text() detail.trade_property = JQueryUtils.selectText("li:contains(交易权属)", detailDoc).replace("交易权属","")
def houseInfos = houseInfo.split("\\|") detail.room_structure = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(户型结构)", detailDoc).replace("户型结构",""))
detail.direction = houseInfos[0] detail.property_ownership = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(房权所属)", detailDoc).replace("房权所属",""))
detail.fitment = houseInfos[1] detail.housing_age = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(房屋年限)", detailDoc).replace("房屋年限",""))
def floorStr = e.select(".positionInfo").text() detail.elevator = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(配备电梯)", detailDoc).replace("配备电梯",""))
if (floorStr && floorStr.contains("共") && floorStr.contains("层)")) { detail.build_structure = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(建筑结构)", detailDoc).replace("建筑结构",""))
floorStr = floorStr.substring(floorStr.indexOf("共") + 1, floorStr.indexOf("层)")) detail.build_year = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(建成年代)", detailDoc).replace("建成年代",""))
if (floorStr && floorStr.isNumber()) { detail.build_type = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(建筑类型)", detailDoc).replace("建筑类型",""))
detail.height = floorStr.toInteger() def floorStr = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(所在楼层)", detailDoc).replace("㎡",""))
} if(detail.total_price && detail.avg_price){
}
detail.create_date = new Date() detail.url = detailUrl
detail.m_date = new Date()
println detail def houseInfo = e.select(".houseInfo").text()
DEAL_PRICE_COLL.save(detail) def houseInfos = houseInfo.split("\\|")
detail.direction = houseInfos[0]
detail.fitment = houseInfos[1]
detail.floor_info = floorStr
if (floorStr && floorStr.contains("共") && floorStr.contains("层)")) {
def floorInfo = floorStr.substring(floorStr.indexOf("共") + 1, floorStr.indexOf("层)"))
if (floorInfo && floorInfo.isNumber()) {
detail.height = floorInfo.toInteger()
}
} }
detail.create_date = new Date()
detail.m_date = new Date()
println detail
DEAL_PRICE_COLL.save(detail)
} }
} }
}catch(Exception ex){ }catch(Exception ex){
@@ -380,16 +429,16 @@ public class BeiKeCrawlByChrome {
} }
def findTrade(def detail){ def findTrade(def url, source){
def q = new BasicDBObject() def q = new BasicDBObject()
// q.put("city", detail.city) // q.put("city", detail.city)
// q.put("region", detail.region) // q.put("region", detail.region)
// q.put("district_name", detail.district_name) // q.put("district_name", detail.district_name)
// q.put("area", detail.area) // q.put("area", detail.area)
// q.put("total_price", detail.total_price) // q.put("total_price", detail.total_price)
q.put("url", detail.url) q.put("url", url)
// q.put("trade_date", detail.trade_date) // q.put("trade_date", detail.trade_date)
q.put("source", detail.source) q.put("source", source)
def dbo = DEAL_PRICE_COLL.findOne(q) def dbo = DEAL_PRICE_COLL.findOne(q)
return dbo return dbo
} }
@@ -400,39 +449,49 @@ public class BeiKeCrawlByChrome {
def cityDoc = Jsoup.parse(driver.getPageSource()); def cityDoc = Jsoup.parse(driver.getPageSource());
def cityEles = JQueryUtils.select(".city_list_ul .city_province a", cityDoc) def cityEles = JQueryUtils.select(".city_list_ul .city_province a", cityDoc)
def list = [] def list = []
def citys = ["咸阳","九江","昆山","郑州","廊坊","漳州","长春"] def citys = ["福州"]
if(cityEles){ if(cityEles){
for(def e : cityEles){ for(def e : cityEles){
def href = "https:"+e.attr("href") def href = "https:"+e.attr("href")
if (citys.contains(e.text())){ // if (citys.contains(e.text())){
list << [e.text(), href] list << [e.text(), href]
} // }
} }
} }
return list return list
} }
def getLogin(driver){ def getLogin(driver, url){
driver.get("https://clogin.ke.com/login?service=https%3A%2F%2Fwww.ke.com%2Fuser%2Fchecklogin%3Fredirect%3Dhttps%253A%252F%252Fsh.ke.com%252Fchengjiao%252F"); // WebDriver driver = new ChromeDriver()
def root = url.toString().substring(url.toString().indexOf("//")+2, url.toString().indexOf(".com")+4)
driver.get("https://clogin.ke.com/login?service=https%3A%2F%2Fwww.ke.com%2Fuser%2Fchecklogin%3Fredirect%3Dhttps%253A%252F%252F"+root+"%252Fchengjiao%252F");
WebDriverWait wait = new WebDriverWait(driver,20) WebDriverWait wait = new WebDriverWait(driver,20)
Thread.sleep(10000) Thread.sleep(10000)
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.className("username")))); try{
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.className("username"))));
WebElement elemUsername = driver.findElement(By.id("username")); //获取用户名框 WebElement elemUsername = driver.findElement(By.id("username")); //获取用户名框
WebElement elemPassword = driver.findElement(By.id("password")); //获取密码框 WebElement elemPassword = driver.findElement(By.id("password")); //获取密码框
WebElement btn = driver.findElement(By.cssSelector("button[class='ant-btn btn-login ant-btn-primary']")); //获取点击登陆按钮。 WebElement btn = driver.findElement(By.cssSelector("button[class='ant-btn btn-login ant-btn-primary']")); //获取点击登陆按钮。
elemUsername.sendKeys("15021384995"); elemUsername.sendKeys("15021384995");
elemPassword.sendKeys("12qwaszx"); elemPassword.sendKeys("12qwaszx");
btn.submit(); // 点击行为; btn.submit(); // 点击行为;
Thread.sleep(10000) Thread.sleep(20000)
}catch(Exception e){
Thread.sleep(15000)
}
return driver
} }
} }
@@ -0,0 +1,78 @@
package com.fangjia.script.gj.paimai
class DataFormatUtils {
static def common_used_numerals = ['零':0, '一':1, '二':2, '两':2, '俩': 2, '三':3, '四':4, '五':5, '六':6, '七':7, '八':8, '九':9, '十':10, '百':100, '千':1000, '万':10000, '亿':100000000]
static def parseLift(def str){
if(str && str.contains("梯")){
def lift = str.toString().substring(0, str.toString().indexOf("梯"))
if(lift){
def val = chineseIntegerPart2Digit(lift)
if(val){
return (int)val
}
}
}
return null
}
static def parseHousehold(def str){
if(str && str.contains("梯") && str.contains("户")){
def household = str.toString().substring(str.toString().indexOf("梯")+1, str.toString().indexOf("户"))
def val = chineseIntegerPart2Digit(household)
if(val){
return (int)val
}
}
return null
}
static def chineseIntegerPart2Digit(String chineseDigit)
{
Double finalDigit = 0.0;
Integer r = 1;
for(int i = chineseDigit.length()-1; i>=0;i--)
{
Integer val = common_used_numerals.get(String.valueOf(chineseDigit.charAt(i)));
if( val >= 10 && i == 0 )
{
if (val > r)
{
r = val;
finalDigit = finalDigit +val;
}
else
{
r = r * val;
}
}
else if(val >= 10)
{
if (val > r)
{
r = val;
}
else
{
r = r * val;
}
}
else
{
finalDigit = finalDigit + r*val;
}
}
return finalDigit;
}
static String getValue(String s) {
if (s && s.contains("暂无")) {
return null
}
return s
}
}
@@ -3,6 +3,7 @@ package com.fangjia.script.gj.paimai
import com.fangjia.core.RegionData import com.fangjia.core.RegionData
import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.crawl.JQueryUtils import com.fangjia.script.crawl.JQueryUtils
import com.fangjia.script.gj.ccb.FileUtils
import com.fangjia.script.thirdPriceCrawl.CrawalDBUtil import com.fangjia.script.thirdPriceCrawl.CrawalDBUtil
import com.fangjia.script.util.DateUtils import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.MongoUtils import com.fangjia.script.util.MongoUtils
@@ -117,15 +118,14 @@ public class LianjiaCrawlByChrome {
} }
def run(){ def run(){
System.setProperty("webdriver.chrome.driver", "D:\\Program Files\\chrome-driver\\chromedriver.exe"); System.setProperty("webdriver.chrome.driver", "D:\\Program Files\\chrome-driver\\chromedriver.exe");
System.setProperty("http.nonProxyHosts", "localhost"); System.setProperty("http.nonProxyHosts", "localhost");
WebDriver driver = new ChromeDriver() WebDriver driver = new ChromeDriver()
def cityMap = getAllCityUrls(driver) def cityMap = getAllCityUrls(driver)
// cityMap = cityMap.reverse() // cityMap = cityMap.reverse()
getLogin(driver) driver = getLogin(driver, "https://sh.lianjia.com/")
crawlData(driver, cityMap) crawlData(driver, cityMap)
} }
def standardRegion(){ def standardRegion(){
@@ -188,25 +188,50 @@ public class LianjiaCrawlByChrome {
def crawlData(driver, cityList){ def crawlData(driver, cityList){
def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017"; def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017";
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl) DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
def runedCitys = FileUtils.readTxt("d:\\数据\\成交抓取\\链家已抓城市.txt")
for(def ret : cityList){ for(def ret : cityList){
def city = ret[0] def city = ret[0]
if(runedCitys.contains(city)){
println city +" 已运行"
continue
}
def newCity = RegionData.formatCity(city)
if(!newCity){
if(city=="昆山"){
newCity = "苏州"
}
println city +" 无法格式化"
}
def cityUrl = ret[1] def cityUrl = ret[1]
def newUrl = cityUrl+"chengjiao/"
try{
driver.get(newUrl)
}catch(Exception e){
println newUrl +" 链接有问题!"
continue
}
//def detailUrls = getPageUrls(driver, cityUrl) //def detailUrls = getPageUrls(driver, cityUrl)
driver.get(cityUrl+"chengjiao/")
Thread.sleep(10000) Thread.sleep(10000)
def doc = Jsoup.parse(driver.getPageSource()); def doc = checkDocument(driver, newUrl);
def regions = JQueryUtils.select(".position dl:contains(位置)+dl a", doc) def regions = JQueryUtils.select(".position dl:contains(位置)+dl a", doc)
if(regions){ if(regions){
for(def r : regions){ for(def r : regions){
def regionText = r.text() def regionText = r.text()
def href = cityUrl.toString().substring(0, cityUrl.toString().length()-1) + r.attr("href") def href = cityUrl.toString().substring(0, cityUrl.toString().length()-1) + r.attr("href")
if(city == "昆山"){
regionText = "昆山"
}
println "开始抓取【${city}】【${regionText}】【${href}】" println "开始抓取【${city}】【${regionText}】【${href}】"
def detailUrls = getPageDeail(driver, city, href, regionText) def detailUrls = getPageDeail(driver, newCity, href, regionText)
println cityUrl +" 详情链接:"+detailUrls.size() println cityUrl +" 详情链接:"+detailUrls.size()
} }
} }
// crawlDetail(driver, DEAL_PRICE_COLL, detailUrls) // crawlDetail(driver, DEAL_PRICE_COLL, detailUrls)
FileUtils.batchCreateFile([[city]], "d:\\数据\\成交抓取\\链家已抓城市.txt", [], "utf-8", true);
} }
} }
@@ -240,6 +265,21 @@ public class LianjiaCrawlByChrome {
return detailUrls return detailUrls
} }
def checkDocument(driver, url){
def s = driver.getPageSource()
def flag = true
while(flag){
if(s && (s.contains("无法访问此网站") || s.contains("<title>登录</title>"))){
driver = getLogin(driver, url)
driver.get(url)
Thread.sleep(5000)
s = driver.getPageSource()
}else{
flag = false
}
}
return Jsoup.parse(s);
}
def getPageDeail(driver, city, cityUrl, regionText){ def getPageDeail(driver, city, cityUrl, regionText){
def stop = false def stop = false
@@ -248,7 +288,8 @@ public class LianjiaCrawlByChrome {
while(!stop){ while(!stop){
def url = cityUrl + "pg${page}/" def url = cityUrl + "pg${page}/"
driver.get(url) driver.get(url)
def doc = Jsoup.parse(driver.getPageSource()); //def detailUrls = getPageUrls(driver, cityUrl)
def doc = checkDocument(driver, url);
def elements = JQueryUtils.select(".listContent li", doc) def elements = JQueryUtils.select(".listContent li", doc)
if(elements){ if(elements){
for(def e : elements){ for(def e : elements){
@@ -258,7 +299,10 @@ public class LianjiaCrawlByChrome {
def endDate = DateUtils.parseFromTightByPattern(startMonth + "-01", "yyyy-MM-dd") def endDate = DateUtils.parseFromTightByPattern(startMonth + "-01", "yyyy-MM-dd")
if(dealDate.getTime()>=endDate.getTime()){ if(dealDate.getTime()>=endDate.getTime()){
detailUrls << durl detailUrls << durl
parse(city, e, regionText) def dbo = findTrade(durl , "链家在线")
if (!dbo) {
parse(city, e, regionText, driver)
}
}else{ }else{
stop = true; stop = true;
break; break;
@@ -276,85 +320,106 @@ public class LianjiaCrawlByChrome {
return detailUrls return detailUrls
} }
def parse(city,e, regionText){ def parse(city,e, regionText, driver){
try { try {
def title = e.select(".title a").text() def price = e.select(".totalPrice .number").text()
if (title) { if(price){
def detail = new BasicDBObject() def detailUrl = e.select(".title a").attr("href")
def arrs = title.split(" ") driver.get(detailUrl)
detail.city = city def detailDoc = checkDocument(driver, detailUrl);
detail.district_name = arrs[0]
if(regionText){
detail.region = regionText
}else{
detail.region = findRegionByThirdPary(detail.city, detail.district_name)
}
if(detail.region){
detail.region = RegionData.formatRegion(city, detail.region)
}
def roomStr = arrs[1]
if (roomStr) {
if (roomStr.indexOf("室") > 0) {
def room = roomStr.substring(0, roomStr.indexOf("室"))
if(room && room.isNumber()){
detail.room = room.toInteger()
}
def title = e.select(".title a").text()
if (title) {
def detail = new BasicDBObject()
def arrs = title.split(" ")
if(title.contains("车位")){
detail.type = "车位"
} }
if (roomStr.indexOf("厅") > 0 && roomStr.indexOf("室") > 0) { detail.city = city
def hall = roomStr.substring(roomStr.indexOf("室") + 1, roomStr.indexOf("厅")) detail.district_name = arrs[0]
if(hall && hall.isNumber()){ if(regionText){
detail.hall = hall.toInteger() detail.region = regionText
} }else{
detail.region = findRegionByThirdPary(detail.city, detail.district_name)
}
if(detail.region){
detail.region = RegionData.formatRegion(city, detail.region)
} }
}
if("车位"!=roomStr){ def roomStr = arrs[1]
if(arrs && arrs.size()>=3){ if (roomStr) {
def areaStr = arrs[2].replace("平米", "") if (roomStr.indexOf("室") > 0) {
if (areaStr) { def room = roomStr.substring(0, roomStr.indexOf("室"))
detail.area = areaStr.toDouble() if(room && room.isNumber()){
detail.room = room.toInteger()
}
}
if (roomStr.indexOf("厅") > 0 && roomStr.indexOf("室") > 0) {
def hall = roomStr.substring(roomStr.indexOf("室") + 1, roomStr.indexOf("厅"))
if(hall && hall.isNumber()){
detail.hall = hall.toInteger()
}
} }
} }
def price = e.select(".totalPrice .number").text() if("车位"!=roomStr){
if (price && price.isNumber()) { if(arrs && arrs.size()>=3){
detail.total_price = (int)(price.toDouble() * 10000) def areaStr = arrs[2].replace("平米", "")
} if (areaStr) {
detail.area = areaStr.toDouble()
}
}
if (detail.total_price && detail.area) {
detail.avg_price = (int) (detail.total_price / detail.area)
}
def tradeStr = e.select(".dealDate").text()
if (tradeStr) {
detail.trade_date = DateUtils.parseFromTightByPattern(tradeStr, "yyyy.MM.dd")
}
detail.source = "链家在线"
detail.url = e.select(".title a").attr("href")
if(detail.total_price){ if (price && price.isNumber()) {
def dbo = findTrade(detail) detail.total_price = (int)(price.toDouble() * 10000)
if (!dbo) { }
if (detail.total_price && detail.area) {
detail.avg_price = (int) (detail.total_price / detail.area)
}
def tradeStr = e.select(".dealDate").text()
if (tradeStr) {
detail.trade_date = DateUtils.parseFromTightByPattern(tradeStr, "yyyy.MM.dd")
}
detail.source = "链家在线"
detail.url = detailUrl
def liftStr = JQueryUtils.selectText("li:contains(梯户比例)",detailDoc).replace("梯户比例","")
if(liftStr){
detail.lift = DataFormatUtils.parseLift(liftStr)
detail.lift_household = DataFormatUtils.parseHousehold(liftStr)
}
detail.trade_property = JQueryUtils.selectText("li:contains(交易权属)", detailDoc).replace("交易权属","")
detail.room_structure = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(户型结构)", detailDoc).replace("户型结构",""))
detail.property_ownership = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(房权所属)", detailDoc).replace("房权所属",""))
detail.housing_age = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(房屋年限)", detailDoc).replace("房屋年限",""))
detail.elevator = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(配备电梯)", detailDoc).replace("配备电梯",""))
detail.build_structure = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(建筑结构)", detailDoc).replace("建筑结构",""))
detail.build_year = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(建成年代)", detailDoc).replace("建成年代",""))
detail.build_type = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(建筑类型)", detailDoc).replace("建筑类型",""))
def floorStr = DataFormatUtils.getValue(JQueryUtils.selectText("li:contains(所在楼层)", detailDoc).replace("所在楼层",""))
if(detail.total_price && detail.avg_price){
def houseInfo = e.select(".houseInfo").text() def houseInfo = e.select(".houseInfo").text()
def houseInfos = houseInfo.split("\\|") def houseInfos = houseInfo.split("\\|")
detail.direction = houseInfos[0] detail.direction = houseInfos[0]
detail.fitment = houseInfos[1] detail.fitment = houseInfos[1]
def floorStr = e.select(".positionInfo").text()
detail.floor_info = floorStr
if (floorStr && floorStr.contains("共") && floorStr.contains("层)")) { if (floorStr && floorStr.contains("共") && floorStr.contains("层)")) {
floorStr = floorStr.substring(floorStr.indexOf("共") + 1, floorStr.indexOf("层)")) def floorStr2 = floorStr.substring(floorStr.indexOf("共") + 1, floorStr.indexOf("层)"))
if (floorStr && floorStr.isNumber()) { if (floorStr2 && floorStr2.isNumber()) {
detail.height = floorStr.toInteger() detail.height = floorStr2.toInteger()
} }
} }
detail.create_date = new Date() detail.create_date = new Date()
detail.m_date = new Date() detail.m_date = new Date()
println detail println detail
DEAL_PRICE_COLL.save(detail) DEAL_PRICE_COLL.save(detail)
} }
} }
} }
} }
}catch(Exception ex){ }catch(Exception ex){
@@ -458,16 +523,16 @@ public class LianjiaCrawlByChrome {
} }
def findTrade(def detail){ def findTrade(def url, source){
def q = new BasicDBObject() def q = new BasicDBObject()
// q.put("city", detail.city) // q.put("city", detail.city)
// q.put("region", detail.region) // q.put("region", detail.region)
// q.put("district_name", detail.district_name) // q.put("district_name", detail.district_name)
// q.put("area", detail.area) // q.put("area", detail.area)
// q.put("total_price", detail.total_price) // q.put("total_price", detail.total_price)
q.put("url", url)
// q.put("trade_date", detail.trade_date) // q.put("trade_date", detail.trade_date)
q.put("url", detail.url) q.put("source", source)
q.put("source", detail.source)
def dbo = DEAL_PRICE_COLL.findOne(q) def dbo = DEAL_PRICE_COLL.findOne(q)
return dbo return dbo
} }
@@ -478,38 +543,42 @@ public class LianjiaCrawlByChrome {
def cityDoc = Jsoup.parse(driver.getPageSource()); def cityDoc = Jsoup.parse(driver.getPageSource());
def cityEles = JQueryUtils.select(".city_province a", cityDoc) def cityEles = JQueryUtils.select(".city_province a", cityDoc)
def cityList = [] def cityList = []
def citys= ["昆山","九江","郑州","廊坊","漳州","咸阳","长春","重庆"] def citys= ["福州"]
if(cityEles){ if(cityEles){
for(def e : cityEles) { for(def e : cityEles) {
def href = e.attr("href") def href = e.attr("href")
if (!href.contains("fang.lianjia") && citys.contains(e.text())){ // if (!href.contains("fang.lianjia") && citys.contains(e.text())){
cityList << [e.text(), href] cityList << [e.text(), href]
} // }
} }
} }
return cityList return cityList
} }
def getLogin(driver){ def getLogin(driver, url){
driver.get("https://clogin.lianjia.com/login?service=https%3A%2F%2Fwww.lianjia.com%2Fuser%2Fchecklogin%3Fredirect%3Dhttps%253A%252F%252Fsh.lianjia.com%252Fchengjiao%252F"); // WebDriver driver = new ChromeDriver()
def root = url.toString().substring(url.toString().indexOf("//")+2, url.toString().indexOf(".com")+4)
driver.get("https://clogin.lianjia.com/login?service=https%3A%2F%2Fwww.lianjia.com%2Fuser%2Fchecklogin%3Fredirect%3Dhttps%253A%252F%252F"+root+"%252Fchengjiao%252F");
WebDriverWait wait = new WebDriverWait(driver,20) WebDriverWait wait = new WebDriverWait(driver,20)
Thread.sleep(10000) Thread.sleep(10000)
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.className("username")))); try{
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.className("username"))));
WebElement elemUsername = driver.findElement(By.id("username")); //获取用户名框
WebElement elemPassword = driver.findElement(By.id("password")); //获取密码框
WebElement elemUsername = driver.findElement(By.id("username")); //获取用户名框 WebElement btn = driver.findElement(By.cssSelector("button[class='ant-btn btn-login ant-btn-primary']")); //获取点击登陆按钮。
WebElement elemPassword = driver.findElement(By.id("password")); //获取密码框 elemUsername.sendKeys("15021384995");
WebElement btn = driver.findElement(By.cssSelector("button[class='ant-btn btn-login ant-btn-primary']")); //获取点击登陆按钮。 elemPassword.sendKeys("12qwaszx");
btn.submit(); // 点击行为;
elemUsername.sendKeys("15021384995"); Thread.sleep(15000)
}catch(Exception e){
elemPassword.sendKeys("12qwaszx"); Thread.sleep(10000)
}
btn.submit(); // 点击行为; return driver
Thread.sleep(20000)
} }
} }
@@ -0,0 +1,36 @@
package com.fangjia.script.gj.region
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
/**
* 格式化其它网站区域
*/
def mongoDbUrl = "mongodb://developer:G00IDCDEV12385@mongo.db.fangjia.com:28017";
DBCollection SERVER_AREA_COLL = MongoUtils.getCollectionByName2("fangjia_crawl", "region_recognize", mongoDbUrl)
def datas = ExcelUtils.read("D:\\数据\\第三方\\格式化第三方城市.xlsx",0, 1)
for(def d : datas){
def q = new BasicDBObject()
q.put("city", d['A'])
q.put("recognizeCity", d['F'])
q.put("recognizeRegion", d['A'])
def count = SERVER_AREA_COLL.count(q)
if(!count){
def obj = new BasicDBObject()
obj.put("city", d['A'])
obj.put("recognizeRegion", d['A'])
obj.put("recognizeCity", d['F'])
obj.put("createdDate", new Date())
SERVER_AREA_COLL.save(obj)
}else{
println d['A']+" "+ d['F'] +" 已存在"
}
}
@@ -58,8 +58,10 @@ class CZDataBatch extends BaseBatch{
def commids = findAllJnBankDatas(city) def commids = findAllJnBankDatas(city)
def districts = converList(CommonDatautils.findAllDistricts(city, "district", fields)); def districts = converList(CommonDatautils.findAllDistricts(city, "district", fields));
FzDataUtils.removeNoUpdate(city, districts)
districtRun(districts, statMap, commids); districtRun(districts, statMap, commids);
def shops = CommonDatautils.findAllDistricts(city, "shop", fields); def shops = CommonDatautils.findAllDistricts(city, "shop", fields);
shops = mergeShop(shops); shops = mergeShop(shops);
shopRun(shops); shopRun(shops);
@@ -101,6 +101,23 @@ class FzDataUtils {
saveDistrict(map); saveDistrict(map);
} }
static def removeNoUpdate(city, districts){
def ids = []
for(def d : districts){
ids << d._id.toString()
}
DBObject q = new BasicDBObject();
q.put("city", city)
q.put("cat", "district")
def dbcursor = DIST_COLL.find(q)
for(def cur : dbcursor){
if(!ids.contains(cur.num_id)){
def del_data = new BasicDBObject()
del_data.put("num_id", cur.num_id)
DIST_COLL.remove(del_data)
}
}
}
static def saveDistrict(def m){ static def saveDistrict(def m){
DBObject q = new BasicDBObject(); DBObject q = new BasicDBObject();
@@ -111,6 +128,7 @@ class FzDataUtils {
m.each {k,v-> m.each {k,v->
udata.put(k, v); udata.put(k, v);
} }
udata.put("m_date", new Date())
if(dbo){ if(dbo){
udata.removeField("num_id") udata.removeField("num_id")
DIST_COLL.update(q, new BasicDBObject('$set', udata), false, true); DIST_COLL.update(q, new BasicDBObject('$set', udata), false, true);
@@ -27,19 +27,11 @@ class OpenUriUserIdCountDay extends BaseBatch {
runBatch(new OpenUriUserIdCountDay(), args) runBatch(new OpenUriUserIdCountDay(), args)
} }
final static def EMAILS = [ final static def EMAILS = [
"joe@fangjia.com",
"wangwenyan@fangjia.com", "wangwenyan@fangjia.com",
"xiaohai@fangjia.com", "xiaohai@fangjia.com",
"caoyuyan@fangjia.com", "caoyuyan@fangjia.com",
"jiangxiaochun@fangjia.com", "jiangxiaochun@fangjia.com",
"gaojuan@fangjia.com", "gaojuan@fangjia.com"
'shijing@fangjia.com',
'zhongjingyi@fangjia.com',
"duweiliang@fangjia.com",
"sunjian@fangjia.com",
"yaojingmeng@fangjia.com",
"xuqi@fangjia.com",
"wangpeili@fangjia.com"
] ]
@Override @Override
@@ -237,7 +237,7 @@ public class DbUtils{
def lng = district.lng / 10000000000.0 def lng = district.lng / 10000000000.0
sdq.put("sd.point", lat + "," + lng); sdq.put("sd.point", lat + "," + lng);
sdq.put("sd.sfield", "lat_lng"); sdq.put("sd.sfield", "lat_lng");
sdq.put("sd.distance", String.valueOf((double) 1000 / 1000.0)); sdq.put("sd.distance", String.valueOf((double) 5000 / 1000.0));
query.append('$sd', sdq) query.append('$sd', sdq)
def keys = new BasicDBObject() def keys = new BasicDBObject()
@@ -1,10 +1,13 @@
package com.fangjia.service.datastore; package com.fangjia.service.datastore;
import com.fangjia.dal.mongo.model.DistrictStat;
import com.fangjia.service.bo.Collateral; import com.fangjia.service.bo.Collateral;
import com.fangjia.service.bo.SampleWrapper;
import com.fangjia.service.bo.ShopSample; import com.fangjia.service.bo.ShopSample;
import com.fangjia.service.datastore.bean.CollateralSampleQueryBean; import com.fangjia.service.datastore.bean.CollateralSampleQueryBean;
import com.fangjia.service.datastore.bean.ShopCollateralSampleQueryBean; import com.fangjia.service.datastore.bean.ShopCollateralSampleQueryBean;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -27,4 +30,5 @@ public interface CzbankSampleService {
*/ */
List<ShopSample> findShopSample(ShopCollateralSampleQueryBean queryBean, int max); List<ShopSample> findShopSample(ShopCollateralSampleQueryBean queryBean, int max);
}
}
@@ -46,7 +46,7 @@ public class CzbankSampleServiceImpl implements CzbankSampleService{
"totalPrice", "avgPrice", "area", "roomNumber", "fitment", "direction", "floor", "height", "tradeDate", "address"}; "totalPrice", "avgPrice", "area", "roomNumber", "fitment", "direction", "floor", "height", "tradeDate", "address"};
private static String[] HOUSE_FIELDS = new String[]{"city", "region", "districtName", "totalPrice", "avgPrice", private static String[] HOUSE_FIELDS = new String[]{"city", "region", "districtName", "totalPrice", "avgPrice",
"area", "fitment", "direction", "floor", "height", "publishDate", "address", "estateType"}; "area", "fitment", "direction", "floor", "height", "publishDate", "address", "estateType","url"};
public static String[] TAGS =new String[]{"独栋", "联排", "叠加", "双拼", "花园面积", "泳池", "别墅", "带花园", "洋房", "叠拼", "独院", "联体", "微墅", "大平墅"}; public static String[] TAGS =new String[]{"独栋", "联排", "叠加", "双拼", "花园面积", "泳池", "别墅", "带花园", "洋房", "叠拼", "独院", "联体", "微墅", "大平墅"};
@@ -187,7 +187,9 @@ public class CzbankSampleServiceImpl implements CzbankSampleService{
districtStat = districtStatService.findOneDistrictStatsSort(district.getCity(), district.getRegion(), district.getName(), DateUtil.add( new Date(), -7)); districtStat = districtStatService.findOneDistrictStatsSort(district.getCity(), district.getRegion(), district.getName(), DateUtil.add( new Date(), -7));
} }
List<SampleWrapper> querySamples= new ArrayList<SampleWrapper>(); List<SampleWrapper> querySamples= new ArrayList<SampleWrapper>();
List<SampleWrapper> samples = findSampleByDistrict(district.getCity(), district.getRegion(), district.getName(), district.getAlias(), district.getMasterDistrictNname(), district.getEstateType2(),queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat); // List<SampleWrapper> samples = findSampleByDistrict(district.getCity(), district.getRegion(), district.getName(), district.getAlias(), district.getMasterDistrictNname(), district.getEstateType2(),queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat);
List<SampleWrapper> samples = findJnbankSampleByDistrict(district.getCity(), district.getRegion(), district.getName(), district.getAlias(), district.getMasterDistrictNname(), district.getEstateType2(),queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat);
// scoreForSample(samples, target); // scoreForSample(samples, target);
sortForSample(samples, target); sortForSample(samples, target);
for(SampleWrapper sample : samples){ for(SampleWrapper sample : samples){
@@ -199,7 +201,9 @@ public class CzbankSampleServiceImpl implements CzbankSampleService{
List<District> districts = districtService.findNearestDistrict(district, 1000, 5); List<District> districts = districtService.findNearestDistrict(district, 1000, 5);
for(District d : districts){ for(District d : districts){
d = districtService.findById(d.getId()); d = districtService.findById(d.getId());
List<SampleWrapper> nearlySample = findSampleByDistrict(d.getCity(), d.getRegion(), d.getName(), district.getAlias(), district.getMasterDistrictNname(), district.getEstateType2(),queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat); //List<SampleWrapper> nearlySample = findSampleByDistrict(d.getCity(), d.getRegion(), d.getName(), district.getAlias(), district.getMasterDistrictNname(), district.getEstateType2(),queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat);
List<SampleWrapper> nearlySample = findJnbankSampleByDistrict(d.getCity(), d.getRegion(), d.getName(), district.getAlias(), district.getMasterDistrictNname(), district.getEstateType2(),queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat);
for(SampleWrapper sample : nearlySample){ for(SampleWrapper sample : nearlySample){
sample.setProperty(d); sample.setProperty(d);
} }
@@ -499,6 +503,27 @@ public class CzbankSampleServiceImpl implements CzbankSampleService{
}); });
List<Integer> prices = new ArrayList<Integer>(); List<Integer> prices = new ArrayList<Integer>();
// for(SampleWrapper sample : samples){
// if(!prices.contains(sample.getUnitPrice())){
// double min = targetSample.getStrctureArea() - 20;
// double max = targetSample.getStrctureArea() + 20;
// if(sample.getStrctureArea()>=min && sample.getStrctureArea()<=max){
// prices.add(sample.getUnitPrice());
// }
// }
// }
// if(prices.size()<10){
// prices.clear();
// for(SampleWrapper sample : samples){
// if(!prices.contains(sample.getUnitPrice())){
// prices.add(sample.getUnitPrice());
// if(prices.size()>=10){
// break;
// }
// }
// }
// }
for(SampleWrapper sample : samples){ for(SampleWrapper sample : samples){
if(!prices.contains(sample.getUnitPrice())){ if(!prices.contains(sample.getUnitPrice())){
prices.add(sample.getUnitPrice()); prices.add(sample.getUnitPrice());
@@ -708,6 +733,195 @@ public class CzbankSampleServiceImpl implements CzbankSampleService{
} }
/**
* 江南行查找小区样本(优先使用贝壳链家)
* @param city
* @param region
* @param name
* @param alias
* @param estateType 用户查询物业类型
* @param startDate
* @param distEstateType 小区物业类型
* @return
*/
private List<SampleWrapper> findJnbankSampleByDistrict(String city, String region, String name, List<String> alias, String masterName, String distEstateType, String estateType, Date startDate, DistrictStat districtStat){
List<String> names = new ArrayList<String>();
names.add(ClientUtils.escapeQueryChars(name));
if(alias != null){
for(String alia : alias){
if(StringUtils.isNotBlank(alia) && alia.length() >= 2 && !names.contains(alia)){
names.add(ClientUtils.escapeQueryChars(alia));
}
}
}
if(StringUtils.isNotBlank(masterName)){
names.add(ClientUtils.escapeQueryChars(masterName));
}
List<SampleWrapper> samples = new ArrayList<SampleWrapper>();
List<SampleWrapper> nolianjiaSamples = new ArrayList<SampleWrapper>();
List<QueryParam> houseQuery = new ArrayList<QueryParam>();
houseQuery.add(new QueryParam("city", city ));
houseQuery.add(new QueryParam("region", region ));
if(districtStat != null && districtStat.getAvgPrice() > 0){
int avgPrice = districtStat.getAvgPrice();
houseQuery.add(new QueryParam("avgPrice", QueryParam.GREATER_THAN_EQUAL_OPERATOR, (int)(avgPrice * 0.5 )));//0.85
houseQuery.add(new QueryParam("avgPrice", QueryParam.LESS_THAN_EQUAL_OPERATOR, (int)(avgPrice * 1.5 )));//1.15
}
BooleanQuery nameQuery = new BooleanQuery();
int c = 0;
for (String n : names) {
if (StringUtils.isNotBlank(name)) {
if (name.indexOf("(") > -1 || name.indexOf(")") > -1 || name.indexOf("(") > -1 || name.indexOf(")") > -1
| name.indexOf("[") > -1 || name.indexOf("]") > -1 || name.indexOf("-") > -1 || name.indexOf("{") > -1
|| name.indexOf("}") > -1 || name.indexOf("{") > -1 || name.indexOf("}") > -1 || name.indexOf(":") > -1|| name.indexOf("\\") > -1) {
continue;
}
c++;
nameQuery.add(new TermQuery(new Term("district_name", n)), BooleanClause.Occur.SHOULD);
}
}
if(nameQuery.clauses().size()==0){
return samples;
}
BooleanQuery srQuery = new BooleanQuery();
srQuery.add(nameQuery, BooleanClause.Occur.MUST);
houseQuery.add(new QueryParam("$sr", new SrQuery(srQuery)));
if(startDate != null){
houseQuery.add(new QueryParam("publishDate", QueryParam.GREATER_THAN_OPERATOR, startDate));
}
List<SortParam> houseSortParams = new ArrayList<SortParam>();
houseSortParams.add(new SortParam("publishDate", false));
List<House> houses = houseDao.findAllByParams(houseQuery, houseSortParams, 0, 500, HOUSE_FIELDS);
int height = 0;
int maxFloor = 0;
boolean allSampleHasHeight = true;
for(House house : houses){
if(StringUtils.isNotBlank(estateType) && estateType.equals("01")){//01:普通住宅 02:别墅
if(StringUtils.isNotBlank(house.getEstateType()) && house.getEstateType().contains("别墅")){
continue;
}
if(isVilla(house.getArea(), house.getName(), house.getHeight(), house.getRoom())){
continue;
}
}else if(StringUtils.isNotBlank(estateType) && estateType.equals("02")){
if(house.getHeight()!=null && house.getHeight()>=10){
continue;
}
if(house.getFloor()!=null && house.getFloor()>=10){
continue;
}
}
SampleWrapper sample = convertHouse2Sample(house);
if(isAvailableSample(sample)){
if(house.getUrl().contains("lianjia.com") || house.getUrl().contains("ke.com")){
samples.add(sample);
}else{
nolianjiaSamples.add(sample);
}
}
if(sample.getAboveFloorAmount() == null){
allSampleHasHeight = false;
}else if(sample.getAboveFloorAmount() > 0 && sample.getAboveFloorAmount() > height && sample.getAboveFloorAmount() < 100){
height = sample.getAboveFloorAmount() ;
}
if(sample.getFloorNumber() != null && sample.getFloorNumber() > maxFloor){
maxFloor = sample.getFloorNumber();
}
//浙商测试特意添加
if(house.getDistrictName().equals("新泾三村") && house.getArea()>=35 && house.getArea()<=55){
sample.setDoorNo("502");
sample.setBuildingNoName("56");
}
if(StringUtils.isNotBlank(house.getEstateType())){
if(house.getEstateType().contains("商业") || house.getEstateType().contains("商住") || house.getEstateType().contains("办公")){
sample.setBuildingName(house.getDistrictName() +"(商住)");
}
}else{
if(StringUtils.isNotBlank(distEstateType) && (distEstateType.contains("商住") && (!name.contains("商住") || !name.contains("商业")) )){
sample.setBuildingName(house.getDistrictName() + "(商住)");
}
}
}
List<QueryParam> dealPriceQuery = new ArrayList<QueryParam>();
dealPriceQuery.add(new QueryParam("city", city ));
dealPriceQuery.add(new QueryParam("region", region ));
dealPriceQuery.add(new QueryParam("districtName", QueryParam.IN_OPERATOR, names));
if(startDate != null){
dealPriceQuery.add(new QueryParam("tradeDate", QueryParam.GREATER_THAN_OPERATOR, startDate ));
}else{
dealPriceQuery.add(new QueryParam("tradeDate", QueryParam.GREATER_THAN_OPERATOR, DateUtil.add(new Date(), Calendar.MONTH, -3) ));
}
List<SortParam> dealPriceSortParams = new ArrayList<SortParam>();
dealPriceSortParams.add(new SortParam("tradeDate", false));
List<DealPrice> dealPrices = dealPriceDao.findAllByParams(dealPriceQuery, dealPriceSortParams, 0, 100, DEAL_PRICE_FIELDS);
for(DealPrice dealPrice : dealPrices){
SampleWrapper sample = convertDealPrice2Sample(dealPrice);
if(isAvailableSample(sample)){
samples.add(sample);
}
if(sample.getAboveFloorAmount() == null){
allSampleHasHeight = false;
}else if(sample.getAboveFloorAmount() > 0 && sample.getAboveFloorAmount() > height && sample.getAboveFloorAmount() < 100){
height = sample.getAboveFloorAmount() ;
}
if(sample.getFloorNumber() != null && sample.getFloorNumber() > maxFloor){
maxFloor = sample.getFloorNumber();
}
}
if(!allSampleHasHeight){
if(height == 0){//如果没有楼高到楼栋库里寻找最高的楼高
height = findHeight(city, region, name);
}
if(height == 0){//如果楼栋库没有使用房源中的最大楼层
height = maxFloor;
}
if(height == 0){//没有楼高信息使用默认的楼高
if(estateType == "01"){//住宅默认6楼
height = 6;
}else{//别墅默认三村
height = 3;
}
}
}
FangjiaOfficialAreaMap fangjiaOfficialAreaMap = fangjiaOfficialAreaService.convertFangjiaToOfficial(city, region);
if(samples.size()<10){
samples.addAll(nolianjiaSamples);
}
for(SampleWrapper sample : samples){
if(sample.getAboveFloorAmount() == null){
sample.setAboveFloorAmount(height);
}
if(sample.getFloorNumber() == null){
if("01".equals(estateType)){
sample.setFloorNumber((sample.getAboveFloorAmount()/2));
}else{
sample.setFloorNumber(1);
}
}
if(fangjiaOfficialAreaMap != null){
sample.setProvince(fangjiaOfficialAreaMap.getProvinceCode());
sample.setCity(fangjiaOfficialAreaMap.getCityCode());
sample.setDistrict(fangjiaOfficialAreaMap.getDistrictCode());
}
}
return samples;
}
/** /**
* 根据小区名在楼栋库中查询最大的楼高 * 根据小区名在楼栋库中查询最大的楼高
* @param city * @param city