This commit is contained in:
2022-09-01 20:52:49 +08:00
107 changed files with 8636 additions and 709 deletions
@@ -6,8 +6,6 @@ import com.fangjia.core.util.DateUtil;
import com.fangjia.dal.mongo.model.OperationLog;
import com.fangjia.service.mongo.bkoff.OperationLogService;
import org.sothis.core.util.Pager;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -28,7 +26,6 @@ public class OperationLogController{
put( "block" , "板块" );
put( "address" , "地址" );
put( "loop_line_info" , "环线" );
put( "loop_line_info" , "环线" );
put( "estate_type2" , "物业类型" );
put( "street_community" , "街道社区" );
put( "household_count" , "户数" );
@@ -58,7 +55,6 @@ public class OperationLogController{
put( "house_height" , "楼高" );
put( "lease_term","租赁年限");
put( "payment_pattern","付款方式");
put( "rent_price","出租价格");
put( "sell_price","出售价格");
put( "floor","建筑楼层");
put( "floor_info","楼层状况");
@@ -66,7 +62,6 @@ public class OperationLogController{
put( "characteristic","项目特色");
put( "bay_area","开间面积");
put( "finish_building_date","竣工时间");
put( "live_date","开业时间");
put( "divisible","是否可分割");
put( "unified_manage","是否统一管理");
put( "metro_info","地铁沿线");
@@ -3,6 +3,7 @@ package com.fangjia.bkoff.controllers;
import com.fangjia.bkoff.model.JsonModel;
import com.fangjia.bkoff.model.SeawaterModel;
import com.fangjia.core.RegionData;
import com.fangjia.dal.SeawaterQuery;
import com.fangjia.dal.common.DistrictKey;
import com.fangjia.dal.seawater.model.Seawater;
import com.fangjia.dal.seaweed.dao.DistrictDao;
@@ -13,6 +14,7 @@ import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
import org.sothis.core.util.Pager;
import org.sothis.web.mvc.annotation.Param;
import org.springframework.beans.BeanUtils;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
@@ -49,6 +51,8 @@ public class SeawaterController {
pager.setTotalRows(0);
}
}else {
SeawaterQuery query = new SeawaterQuery();
BeanUtils.copyProperties(model, query, new String[] {"sortField", "regionAlias", "districtAlias", "keys", "table"});
String sort = model.getSort();
String sortField = null;
boolean order = false;
@@ -62,6 +66,8 @@ public class SeawaterController {
if (sortField == null) {
sortField = "p_date";
}
query.setOrder(order);
query.setSortField(sortField);
List<String> regionAlias = null;
List<String> districtAlias = null;
@@ -80,9 +86,15 @@ public class SeawaterController {
regionAlias = RegionData.getRegionAlias(city, model.getRegion());
}
query.setDistrictAlias(districtAlias);
query.setRegionAlias(regionAlias);
query.setTable("seawater");
// pager.setTotalRows((int) seawaterService.findSeawatersCountFromEs(model.getCat(), city, model.getRegion(),model.getDistrictName(), districtAlias, regionAlias, model.getStartDate(), model.getEndDate(), model.getRoom(), model.getRootName(),"seawater"));
// List<Seawater> seawaterList = seawaterService.findSeawatersFromEs(model.getCat(), city, model.getRegion(),model.getDistrictName(), districtAlias, regionAlias, model.getStartDate(), model.getEndDate(), model.getRoom(), model.getRootName(), sortField, order, pager.getStartRow(), pager.getPageSize(), null,"seawater");
pager.setTotalRows((int)seawaterService.findSeawatersCountByQuery(query));
List<Seawater> seawaterList = seawaterService.findSeawatersByQuery(query);
pager.setTotalRows((int) seawaterService.findSeawatersCountFromEs(model.getCat(), city, model.getRegion(),model.getDistrictName(), districtAlias, regionAlias, model.getStartDate(), model.getEndDate(), model.getRoom(), model.getRootName(),"seawater"));
List<Seawater> seawaterList = seawaterService.findSeawatersFromEs(model.getCat(), city, model.getRegion(),model.getDistrictName(), districtAlias, regionAlias, model.getStartDate(), model.getEndDate(), model.getRoom(), model.getRootName(), sortField, order, pager.getStartRow(), pager.getPageSize(), null,"seawater");
Map<String, String> tagsMap = new HashMap<String, String>();
for(Seawater seawater : seawaterList) {
if(StringUtils.isBlank(seawater.getName())){
@@ -125,6 +137,58 @@ public class SeawaterController {
return ret;
}
/**
* 按条件批量删除数据(小区名称只匹配主名不匹配别名,查询时匹配别名)
* @param model
* @return
*/
public Object batchDeleteByParamsAction(SeawaterModel model) {
JsonModel ret = new JsonModel();
String city = model.getCityDisplay();
if(StringUtils.isBlank(model.getCat())) {
model.setCat("sell");
}
SeawaterQuery query = new SeawaterQuery();
BeanUtils.copyProperties(model, query, new String[] {"sortField", "regionAlias", "districtAlias", "keys", "table"});
List<String> regionAlias = null;
model.setDistrictName(model.getDistrictName().trim());
if(StringUtils.isNotBlank(model.getRegion())) {
regionAlias = RegionData.getRegionAlias(city, model.getRegion());
}
query.setRegionAlias(regionAlias);
query.setTable("seawater");
seawaterService.batchDeleteByParams(query);
return ret;
}
/**
* 按条件批量修改物业类型(小区名称只匹配主名不匹配别名,查询时匹配别名)
* @param model
* @return
*/
public Object batchUpdateEstateTypeAction(SeawaterModel model) {
JsonModel ret = new JsonModel();
String city = model.getCityDisplay();
if(StringUtils.isBlank(model.getCat())) {
model.setCat("sell");
}
SeawaterQuery query = new SeawaterQuery();
BeanUtils.copyProperties(model, query, new String[] {"sortField", "regionAlias", "districtAlias", "keys", "table"});
List<String> regionAlias = null;
model.setDistrictName(model.getDistrictName().trim());
if(StringUtils.isNotBlank(model.getRegion())) {
regionAlias = RegionData.getRegionAlias(city, model.getRegion());
}
query.setRegionAlias(regionAlias);
query.setTable("seawater");
seawaterService.batchUpdateEstateType(query);
return ret;
}
public void setSeawaterService(SeawaterService seawaterService) {
this.seawaterService = seawaterService;
}
@@ -102,7 +102,7 @@ public class SqMetreRentController {
JSONObject row = new JSONObject();
row.put("x",DateUtil.add(rent.getWeekend(), 1).getTime());
row.put("y",rent.getAvgPrice());
row.put("sampleEnum",rent.getSampleEnum());
row.put("sampleEnum",rent.getValueType());
datas.add(row);
}
@@ -136,7 +136,7 @@ public class SqMetreRentController {
Date statDate = DateUtil.parseFormatDate(model.getStatDate());
SqmetreRent stat = sqmetreRentService.findSqmetreRent(model.getCityDisplay(), model.getRegion(), model.getDistrictName(), model.getCat(), statDate);
if(null != stat){
stat.setAvgPrice(model.getValue());
stat.setAvgPrice(model.getValue().intValue());
stat.setModificationDate(new Date());
sqmetreRentService.updateSqmetreRent(stat);
}
@@ -204,7 +204,7 @@ public class SqMetreRentController {
rent.setDistrictName(model.getDistrictName());
rent.setWeekend(statDate);
rent.setCat(model.getCat());
rent.setAvgPrice(model.getValue());
rent.setAvgPrice(model.getValue().intValue());
rent.setCreationDate(new Date());
rent.setModificationDate(new Date());
sqmetreRentService.save(rent);
@@ -0,0 +1,341 @@
package com.fangjia.bkoff.model;
import com.fangjia.dal.mongo.model.*;
import com.fangjia.dal.mongo.model.bkoff.CalcCommand;
import com.fangjia.dal.mongo.model.bkoff.CalcConfig;
import com.fangjia.dal.mongo.model.bkoff.GuidingPrice;
import com.fangjia.dal.seaweed.model.District;
import com.fangjia.service.bo.AvgUpdateBo;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class RentPriceUpdateModel extends BaseModel {
/**
*
*/
private static final long serialVersionUID = 1L;
private List<AvgUpdateBo> avgUpdateBos;
private Map<String, List<AvgUpdateBo>> avgUpdateBoMap;
private String region;
private String block;
private String cityDisplay;
private String id;
private int avgPrice;
private Double minCredit;
private Double maxCredit;
private Integer valueType;
private String name;
private District district;
private List<AverageStatistics> averageStatistics;
private List<AvgBase> avgBases;
private CalcDistrictStat calcDistrictStat;
private DistrictStat districtStat;
private SqmetreRent sqmetreRent;
private long dealPriceCount;
private List<GuidingPrice> guidingPrices;
private Map<String, Long> distribution;
private CalcConfig calcConfig;
private String stype;
private String keyword;
private Integer status;
private List<CalcCommand> calcCommands;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDate;
private String estateType;
private String sort;
private Date weekend;
private int sdateStart;
private int sdateEnd;
private String series;
private String vts;
private String category;
public List<AvgUpdateBo> getAvgUpdateBos() {
return avgUpdateBos;
}
public void setAvgUpdateBos(List<AvgUpdateBo> avgUpdateBos) {
this.avgUpdateBos = avgUpdateBos;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public String getBlock() {
return block;
}
public void setBlock(String block) {
this.block = block;
}
public String getCityDisplay() {
return cityDisplay;
}
public void setCityDisplay(String cityDisplay) {
this.cityDisplay = cityDisplay;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getAvgPrice() {
return avgPrice;
}
public void setAvgPrice(int avgPrice) {
this.avgPrice = avgPrice;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public District getDistrict() {
return district;
}
public void setDistrict(District district) {
this.district = district;
}
public List<AverageStatistics> getAverageStatistics() {
return averageStatistics;
}
public void setAverageStatistics(List<AverageStatistics> averageStatistics) {
this.averageStatistics = averageStatistics;
}
public long getDealPriceCount() {
return dealPriceCount;
}
public void setDealPriceCount(long dealPriceCount) {
this.dealPriceCount = dealPriceCount;
}
public List<GuidingPrice> getGuidingPrices() {
return guidingPrices;
}
public void setGuidingPrices(List<GuidingPrice> guidingPrices) {
this.guidingPrices = guidingPrices;
}
public Map<String, Long> getDistribution() {
return distribution;
}
public void setDistribution(Map<String, Long> distribution) {
this.distribution = distribution;
}
public CalcConfig getCalcConfig() {
return calcConfig;
}
public void setCalcConfig(CalcConfig calcConfig) {
this.calcConfig = calcConfig;
}
public String getStype() {
return stype;
}
public void setStype(String stype) {
this.stype = stype;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public List<CalcCommand> getCalcCommands() {
return calcCommands;
}
public void setCalcCommands(List<CalcCommand> calcCommands) {
this.calcCommands = calcCommands;
}
public String getEstateType() {
return estateType;
}
public void setEstateType(String estateType) {
this.estateType = estateType;
}
public Map<String, List<AvgUpdateBo>> getAvgUpdateBoMap() {
return avgUpdateBoMap;
}
public void setAvgUpdateBoMap(Map<String, List<AvgUpdateBo>> avgUpdateBoMap) {
this.avgUpdateBoMap = avgUpdateBoMap;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public Double getMinCredit() {
return minCredit;
}
public void setMinCredit(Double minCredit) {
this.minCredit = minCredit;
}
public Double getMaxCredit() {
return maxCredit;
}
public void setMaxCredit(Double maxCredit) {
this.maxCredit = maxCredit;
}
public Integer getValueType() {
return valueType;
}
public void setValueType(Integer valueType) {
this.valueType = valueType;
}
public CalcDistrictStat getCalcDistrictStat() {
return calcDistrictStat;
}
public void setCalcDistrictStat(CalcDistrictStat calcDistrictStat) {
this.calcDistrictStat = calcDistrictStat;
}
public DistrictStat getDistrictStat() {
return districtStat;
}
public void setDistrictStat(DistrictStat districtStat) {
this.districtStat = districtStat;
}
public Date getWeekend() {
return weekend;
}
public void setWeekend(Date weekend) {
this.weekend = weekend;
}
public int getSdateStart() {
return sdateStart;
}
public void setSdateStart(int sdateStart) {
this.sdateStart = sdateStart;
}
public int getSdateEnd() {
return sdateEnd;
}
public void setSdateEnd(int sdateEnd) {
this.sdateEnd = sdateEnd;
}
public String getSeries() {
return series;
}
public void setSeries(String series) {
this.series = series;
}
public String getVts() {
return vts;
}
public void setVts(String vts) {
this.vts = vts;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public List<AvgBase> getAvgBases() {
return avgBases;
}
public void setAvgBases(List<AvgBase> avgBases) {
this.avgBases = avgBases;
}
public SqmetreRent getSqmetreRent() {
return sqmetreRent;
}
public void setSqmetreRent(SqmetreRent sqmetreRent) {
this.sqmetreRent = sqmetreRent;
}
}
@@ -35,12 +35,19 @@ public class SeawaterModel extends BaseModel {
private Seawater seawater;
private List<Seawater> seawaterList;
private Map<String, String> tagsMap;
private Integer order;
private Boolean order;
private Integer StartDate;
private Integer endDate;
private String sort;
private String url;
private String rootName;
private String estateType;
private Double startArea;
private Double endArea;
private Integer startPrice;
private Integer endPrice;
private Integer status;
private String editEstateType;
public String getId() {
return id;
}
@@ -156,10 +163,10 @@ public class SeawaterModel extends BaseModel {
public void setCityDisplay(String cityDisplay) {
this.cityDisplay = cityDisplay;
}
public Integer getOrder() {
public Boolean getOrder() {
return order;
}
public void setOrder(Integer order) {
public void setOrder(Boolean order) {
this.order = order;
}
@@ -220,4 +227,60 @@ public class SeawaterModel extends BaseModel {
public void setTagsMap(Map<String, String> tagsMap) {
this.tagsMap = tagsMap;
}
public String getEstateType() {
return estateType;
}
public void setEstateType(String estateType) {
this.estateType = estateType;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getStartPrice() {
return startPrice;
}
public void setStartPrice(Integer startPrice) {
this.startPrice = startPrice;
}
public Integer getEndPrice() {
return endPrice;
}
public void setEndPrice(Integer endPrice) {
this.endPrice = endPrice;
}
public Double getStartArea() {
return startArea;
}
public void setStartArea(Double startArea) {
this.startArea = startArea;
}
public Double getEndArea() {
return endArea;
}
public void setEndArea(Double endArea) {
this.endArea = endArea;
}
public String getEditEstateType() {
return editEstateType;
}
public void setEditEstateType(String editEstateType) {
this.editEstateType = editEstateType;
}
}
@@ -90,12 +90,12 @@
</td>
</tr>
<tr>
<td>价格类型</td>
<td>估价类型</td>
<td>
<select id="slt_priceType" name="priceType" style="width: 100px">
<option value=""></option>
<option value="2B" <#if apiUserBo.priceType?? && apiUserBo.priceType?index_of("2B")!=-1>selected</#if>>2B</option>
<option value="2C" <#if apiUserBo.priceType?? && apiUserBo.priceType?index_of("2C")!=-1>selected</#if>>2C</option>
<option value="sell" <#if apiUserBo.priceType?? && apiUserBo.priceType?index_of("sell")!=-1>selected</#if>>挂牌价</option>
<option value="evaluate" <#if apiUserBo.priceType?? && apiUserBo.priceType?index_of("evaluate")!=-1>selected</#if>>评估价</option>
</select>
</td>
</tr>
@@ -227,7 +227,7 @@
<td colspan="2"><b>兔博士</b></td>
</#if>
<#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>
<#if (it.zhongyuanNewPrice)?? || (it.zhongyuanEsfPrice)??>
<td colspan="2"><b>中原地产</b></td>
</#if>
<#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>
@@ -247,7 +247,13 @@
</#if>
<#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>
<td colspan="2"><b>云估价</b></td>
</#if>
</#if>
<#if (it.jiwuNewPrice)?? || (it.jiwuEsfPrice)??>
<td colspan="2"><b>吉屋</b></td>
</#if>
<#if (it.tsfhouseNewPrice)?? || (it.tsfhouseEsfPrice)??>
<td colspan="2"><b>365房产</b></td>
</#if>
</tr>
<tr>
@@ -300,7 +306,7 @@
<td style="width:70px;color:#D3750A">二手房</td>
</#if>
<#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>
<#if (it.zhongyuanNewPrice)?? || (it.zhongyuanEsfPrice)??>
<td style="width:70px;color:#0C88C7">新房</td>
<td style="width:70px;color:#D3750A">二手房</td>
</#if>
@@ -329,10 +335,17 @@
</#if>
<#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>
<td style="width:70px;color:#0C88C7">新房</td>
<td style="width:70px;color:#D3750A">二手房</td>
<td style="width:70px;color:#D3750A">二手房</td>
</#if>
<#if (it.jiwuNewPrice)?? || (it.jiwuEsfPrice)??>
<td style="width:70px;color:#0C88C7">新房</td>
<td style="width:70px;color:#D3750A">二手房</td>
</#if>
<#if (it.tsfhouseNewPrice)?? || (it.tsfhouseEsfPrice)??>
<td style="width:70px;color:#0C88C7">新房</td>
<td style="width:70px;color:#D3750A">二手房</td>
</#if>
</tr>
<tr>
@@ -392,9 +405,9 @@
<td style ="color:#D3750A">${it.tuboshiEsfPrice!}</td>
</#if>
<#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>
<td style ="color:#0C88C7">${it.centanetNewPrice!}</td>
<td style ="color:#D3750A">${it.centanetEsfPrice!}</td>
<#if (it.zhongyuanNewPrice)?? || (it.zhongyuanEsfPrice)??>
<td style ="color:#0C88C7">${it.zhongyuanNewPrice!}</td>
<td style ="color:#D3750A">${it.zhongyuanEsfPrice!}</td>
</#if>
<#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>
@@ -422,7 +435,15 @@
<td style ="color:#0C88C7">${it.yungujiaNewPrice!}</td>
<td style ="color:#D3750A">${it.yungujiaEsfPrice!}</td>
</#if>
<#if (it.jiwuNewPrice)?? || (it.jiwuEsfPrice)??>
<td style ="color:#0C88C7">${it.jiwuNewPrice!}</td>
<td style ="color:#D3750A">${it.jiwuEsfPrice!}</td>
</#if>
<#if (it.tsfhouseNewPrice)?? || (it.tsfhouseEsfPrice)??>
<td style ="color:#0C88C7">${it.tsfhouseNewPrice!}</td>
<td style ="color:#D3750A">${it.tsfhouseEsfPrice!}</td>
</#if>
</tr>
</#list>
<#if averageStatistics?size == 0>
@@ -750,7 +771,7 @@
y:Math.round(item.totalPrice/item.area),
data:item
})
}else if((item.estateType!=null) && ((item.estateType.indexOf('商住') > -1) || (item.estateType.indexOf('公寓酒店') > -1))){
}else if((item.estateType!=null) && ((item.estateType.indexOf('商住') > -1) || (item.estateType.indexOf('商业') > -1) || (item.estateType.indexOf('商务') > -1) || (item.estateType.indexOf('公寓酒店') > -1))){
series_arry_1.push({
x:new Date(ds),
y:Math.round(item.totalPrice/item.area),
@@ -74,7 +74,7 @@
<label class="checkbox"><input type="checkbox" id="col13" temp="13" rank="1" name="chkCol">Mapabc经纬度覆盖率</label>
<label class="checkbox"><input type="checkbox" id="col14" temp="14" rank="1" name="chkCol" checked>百度经纬度覆盖率</label>
<label class="checkbox"><input type="checkbox" id="col15" temp="15" rank="1" name="chkCol" checked>统计周</label>
<label class="checkbox"><input type="checkbox" id="col16" temp="16" rank="1" name="chkCol" checked>租金覆盖率</label>
<#-- <label class="checkbox"><input type="checkbox" id="col16" temp="16" rank="1" name="chkCol" checked>租金覆盖率</label>-->
<label class="checkbox"><input type="checkbox" id="col17" temp="17" rank="1" name="chkCol" checked>等级</label>
<div style="float: right;">
@@ -234,7 +234,7 @@
</th>
<th width="6.25%" name="col13" class="dn">Mapabc经纬度<br/>覆盖率</th>
<th width="6.25%" name="col14" >百度经纬度<br/>覆盖率</th>
<th width="6.25%" name="col16">租金覆盖率</th>
<#-- <th width="6.25%" name="col16">租金覆盖率</th>-->
<th width="6.25%" name="col15">统计周</th>
</tr>
@@ -269,7 +269,7 @@
<td width="6.25%" name="col12" class="dn"><#if info.priceToEva??>${info.priceToEva * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col13" class="dn"><#if info.districtDetail.latLng??>${info.districtDetail.latLng * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col14"><#if info.districtDetail.latLng2??>${info.districtDetail.latLng2 * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col16"><#if info.districtDetail.rentPrice??>${info.districtDetail.rentPrice * 100}%<#else>未知</#if></td>
<#-- <td width="6.25%" name="col16"><#if info.districtDetail.rentPrice??>${info.districtDetail.rentPrice * 100}%<#else>未知</#if></td>-->
<td width="6.25%" name="col15">${info.weekend?string('yyyy-MM-dd')} <a href="../data/cityShow?infoId=${info.id!}" target="_blank">详细</a></td>
</tr>
</#list>
@@ -306,7 +306,7 @@
<label class="checkbox"><input type="checkbox" id="col13" temp="13" rank="1" name="chkCol">Mapabc经纬度覆盖率</label>
<label class="checkbox"><input type="checkbox" id="col14" temp="14" rank="1" name="chkCol" checked>百度经纬度覆盖率</label>
<label class="checkbox"><input type="checkbox" id="col15" temp="15" rank="1" name="chkCol" checked>统计周</label>
<label class="checkbox"><input type="checkbox" id="col16" temp="16" rank="1" name="chkCol" checked>租金覆盖率</label>
<#-- <label class="checkbox"><input type="checkbox" id="col16" temp="16" rank="1" name="chkCol" checked>租金覆盖率</label>-->
<label class="checkbox"><input type="checkbox" id="col17" temp="17" rank="1" name="chkCol" checked>等级</label>
<span style="float: right; margin-right: 50px;"><img src="../images/script-excel.png"><a id="export" style="cursor:pointer;">导出</a>
@@ -444,7 +444,7 @@
</th>
<th width="6.25%" name="col13" class="dn">Mapabc经纬度<br/>覆盖率</th>
<th width="6.25%" name="col14" >百度经纬度<br/>覆盖率</th>
<th width="6.25%" name="col16">租金覆盖率</th>
<#-- <th width="6.25%" name="col16">租金覆盖率</th>-->
<th width="6.25%" name="col15">统计周</th>
</tr>
@@ -478,7 +478,7 @@
<td width="6.25%" name="col12" class="dn"><#if info.priceToEva??>${info.priceToEva * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col13" class="dn"><#if info.shopDetail.latLng??>${info.shopDetail.latLng * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col14"><#if info.shopDetail.latLng2??>${info.shopDetail.latLng2 * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col16"><#if info.shopDetail.rentPrice??>${info.shopDetail.rentPrice * 100}%<#else>0</#if></td>
<#-- <td width="6.25%" name="col16"><#if info.shopDetail.rentPrice??>${info.shopDetail.rentPrice * 100}%<#else>0</#if></td>-->
<td width="6.25%" name="col15">${info.weekend?string('yyyy-MM-dd')} <a href="../data/cityShow?infoId=${info.id!}#lB" target="_blank">详细</a></td>
</tr>
</#list>
@@ -515,7 +515,7 @@
<label class="checkbox"><input type="checkbox" id="col13" temp="13" rank="1" name="chkCol">Mapabc经纬度覆盖率</label>
<label class="checkbox"><input type="checkbox" id="col14" temp="14" rank="1" name="chkCol" checked>百度经纬度覆盖率</label>
<label class="checkbox"><input type="checkbox" id="col15" temp="15" rank="1" name="chkCol" checked>统计周</label>
<label class="checkbox"><input type="checkbox" id="col16" temp="16" rank="1" name="chkCol" checked>租金覆盖率</label>
<#-- <label class="checkbox"><input type="checkbox" id="col16" temp="16" rank="1" name="chkCol" checked>租金覆盖率</label>-->
<label class="checkbox"><input type="checkbox" id="col17" temp="17" rank="1" name="chkCol" checked>等级</label>
<span style="float: right; margin-right: 50px;"><img src="../images/script-excel.png"><a id="export" style="cursor:pointer;">导出</a>
@@ -653,7 +653,7 @@
</th>
<th width="6.25%" name="col13" class="dn">Mapabc经纬度<br/>覆盖率</th>
<th width="6.25%" name="col14" >百度经纬度<br/>覆盖率</th>
<th width="6.25%" name="col16">租金覆盖率</th>
<#-- <th width="6.25%" name="col16">租金覆盖率</th>-->
<th width="6.25%" name="col15">统计周</th>
</tr>
@@ -687,7 +687,7 @@
<td width="6.25%" name="col12" class="dn"><#if info.priceToEva??>${info.priceToEva * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col13" class="dn"><#if info.officeDetail.latLng??>${info.officeDetail.latLng * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col14"><#if info.officeDetail.latLng2??>${info.officeDetail.latLng2 * 100}%<#else>未知</#if></td>
<td width="6.25%" name="col16"><#if info.officeDetail.rentPrice??>${info.officeDetail.rentPrice * 100}%<#else>0</#if></td>
<#-- <td width="6.25%" name="col16"><#if info.officeDetail.rentPrice??>${info.officeDetail.rentPrice * 100}%<#else>0</#if></td>-->
<td width="6.25%" name="col15">${info.weekend?string('yyyy-MM-dd')} <a href="../data/cityShow?infoId=${info.id!}#lC" target="_blank">详细</a></td>
</tr>
</#list>
@@ -686,6 +686,7 @@
<a target="_blank" href="../district/districtNearby?id=${district.id}&cityDisplay=${cityDisplay!}">配套</a>
</#if>
<a target="_blank" href="../avgPriceUpdate/districtDetail?id=${district.id}">均价</a>
<a target="_blank" href="../rentPriceUpdate/districtDetail?id=${district.id}">租金</a>
<a target="_blank" href="../seawater/houseList?cityDisplay=${district.city!}&region=${district.region!}&districtName=${district.name!}">样本</a>
<a target="_blank" href="http://192.168.0.65/fangjia-coredata-bkoff/analy/analyDistrictDetailList?city=${district.city!}&region=${district.region!}&districtName=${district.name!}">数据对比</a>
<a target="_blank" href="../district/add?id=${district.id}">复制</a>
@@ -0,0 +1,470 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>${cityDisplay}<#if region?? && region!=''>-${region}<#if block?? && block!=''>-${block}</#if></#if> 城市租金详细信息</title>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/main_simple.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/pagination.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/jnotify/jNotify.jquery.css?v=${version}" />
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<#include "/common_js.ftl" />
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../js/jquery.pagination.js?v=${version}"></script>
<script type="text/javascript" src="../js/highcharts/highcharts-3.0.7.js"></script>
<script type="text/javascript" src="../js/highcharts/exporting-3.0.7.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jNotify.jquery.min.js?v=${version}"></script>
<style>
.con {
border-radius:0px;
}
label{display:inline-block}
.input-small{
margin:0px;
}
</style>
</head>
<body>
<#include "/layout/header.ftl" />
<div class="main-content" style="padding:0px 10px;">
<form action="detail">
<table class="table table-bordered table-condensed con" style="margin-top: 4px">
<tr>
<th colspan="2">查询条件</th><th colspan="2">租金更新</th><th colspan="2">租金新增</th>
</tr>
<tr>
<td>
<label for="region">城市:</label>
</td>
<td>
<@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" name="cityDisplay"/>
</td>
<td>
日期:
</td>
<td>
<label id="dateLabel"></label>
</td>
<td>
新增日期:
</td>
<td>
<input id="shortDate" style="width:80px;" name="shortDate" value="${shortDate!}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
</td>
</tr>
<tr>
<td>
<label for="region">区域:</label>
</td>
<td>
<select id="region" name="region" class="form-control" onchange="changeRegion()">
<option value="">不限</option>
</select>
</td>
<td>
覆盖率:
</td>
<td>
<label id="coverageLabel"></label>
</td>
<td>
覆盖率:
</td>
<td>
<label>0</label>
</td>
</tr>
<tr>
<td>
<label for="region">板块:</label>
</td>
<td>
<select id="block" name="block" class="form-control">
<option value="">不限</option>
</select>
</td>
<td>
可信度:
</td>
<td>
<label id="creditLabel"></label>
</td>
<td>
可信度:
</td>
<td>
<label id="creditLabel2"></label>
</td>
</tr>
<tr>
<td colspan="2"></td>
<td><label for="avgPrice">租金/计算租金:</label></td>
<td>
<input type="hidden" id="_id">
<input type="text" id="avgPrice" class=".span1" style="margin-bottom: 0px;"> /
<span id="calcValueLabel" style="width:100px;display:inline-block;"></span>
</td>
<td><label for="avgPrice">租金:</label></td>
<td>
<input type="hidden" id="_region" value="${region!}">
<input type="hidden" id="_city" value="${cityDisplay!}">
<input type="hidden" id="_block" value="${block!}">
<input type="text" id="avgPrice2" class=".span1" style="margin-bottom: 0px;">
<span id="calcValueLabel2" style="width:100px;display:inline-block;"></span>
</td>
</tr>
<tr>
<td colspan="2"><input id="queryBtn" class ="btn btn-primary" type="submit" value="查询" /></td>
<td colspan="2">
<a href="#myModal" role="button" class="btn btn-primary" onclick="updateAvgPriveOpener()" >更新租金</a>
<a href="javascript:;" role="button" class="btn btn-primary" onclick="javascript:if(confirm('确认删除?')){$.get('../rentPriceUpdate/delete?id=' + $('#_id').val(), function(){location.reload();})}" >删除</a>
</td>
<td colspan="2">
<a href="#myModal2" role="button" class="btn btn-primary" onclick="confirmAddAvgPrice()" >新增价格</a>
</td>
</tr>
</table>
</form>
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>提示</h3>
</div>
<div class="modal-body">
<p>确定要更新租金?</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">关闭</a>
<a href="#" class="btn btn-warning" onclick="updateAvgPrice()">更新</a>
</div>
</div>
<div id="myModal2" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>提示</h3>
</div>
<div class="modal-body">
<p>确定要新增租金?</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">关闭</a>
<a href="#" class="btn btn-warning" onclick="addAvgPrice()">确定</a>
</div>
</div>
<ul class="nav nav-tabs" id="myTab" style="height: 30px;">
<li class="active" data-toggle="tab"><a href="#container">走势图</a></li>
<li data-toggle="tab"><a href="#DataTab">数据表</a></li>
</ul>
<div class="tab-content">
<div id="container" class="tab-pane active"></div>
<div id="DataTab" class="tab-pane">
<table class="table table-bordered table-hover">
<thead>
<tr>
<td>日期</td><td>租金</td><td>计算租金</td><td>周同比</td><td>可信度</td><td>覆盖率</td>
</tr>
</thead>
<tbody id="Searchresult">
</tbody>
<tfoot >
<tr>
<td colspan="6"><div id="Pagination" class="pagination"></div></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
var selectCity = '${cityDisplay!}';
var selectRegion = '${region!}'
var selectBlock = '${block!}'
function changeCity(display){
selectCity = display;
if (display) {
$("#display").val(display);
}
jQuery.ajax({
type: 'POST',
url: '../district/getRegions',
data: encodeURI("cityDisplay=" + display),
dataType: 'json',
timeout: 100000,
success: function(model) {
$("#region").empty();
if (model.regionList.length > 0) {
$("<option value=''>不限</option>").appendTo($("#region"));
$.each(model.regionList, function(i, region){
if(selectRegion == region){
$("<option value='" + region + "' selected>" + region + "</option>").appendTo($("#region"));
}else{
$("<option value='" + region + "' >" + region + "</option>").appendTo($("#region"));
}
});
}
},
error : function() {
}
});
}
function changeRegion(r){
var selectRegion = $("#region option:selected").text();
if(r!=undefined){
selectRegion = r;
}
$("#block").empty();
if(region==="不限"){
$("<option value=''>不限</option>").appendTo($("#block"));
}
jQuery.ajax({
type: 'POST',
url: '../district/getBlocks',
data: {cityDisplay:selectCity,region:selectRegion},
dataType: 'json',
timeout: 100000,
success: function(model) {
$("#block").empty();
if (model.blockList.length > 0) {
$("<option value=''>不限</option>").appendTo($("#block"));
$.each(model.blockList, function(i, block){
if(selectBlock == block){
$("<option value='" + block + "' selected>" + block + "</option>").appendTo($("#block"));
}else{
$("<option value='" + block + "' >" + block + "</option>").appendTo($("#block"));
}
});
}
},
error : function() {
}
});
}
changeCity('${cityDisplay!}');
if(selectRegion !==''){
changeRegion(selectRegion);
}
function pageselectCallback(page_index, opts){
var pageNum = page_index + 1;
$.ajax({
type: 'GET',
url: '../rentPriceUpdate/loadAllAvgPrice',
data: {"cityName":selectCity,region:selectRegion,block:selectBlock,"pager.currentPage":pageNum,"pager.pageSize":10,"pager.totalRows":opts.items_total},
dataType: 'json',
timeout: 100000,
async:false,
success: function(model) {
var newcontent = ''
opts.items_total = model.pager.totalRows;
$(model.data).each(function(i,item){
newcontent += '<tr data-id=='+item.id+'><td>'+item.weekend+'</td>'
+ '<td>'+item.avgPrice+'</td>'
+ '<td>'+item.calcValue+'</td>'
+ '<td>' + item.weekendMarkup + '</td>'
+ '<td>' + item.credit + '</td>'
+ '<td>'+item.coverage+'</td></tr>'
});
$('#Searchresult').html(newcontent);
$('#Searchresult tr').click(function(){
var tds = $(this).children()
$("#dateLabel").text(tds[0].innerText);
$("#coverageLabel").text(tds[5].innerText);
$("#creditLabel").text(tds[4].innerText);
$("#calcValueLabel").text(tds[2].innerText);
$("#avgPrice").val(tds[1].innerText);
$("#_id").val($(this).attr("data-id"));
});
}
});
return false;
}
function updateAvgPriveOpener(){
if($("#_id").val()==undefined||$("#_id").val()===""){
alert("请选择要更新的时间点");
return;
}
$('#myModal').modal('show')
}
function confirmAddAvgPrice(){
$('#myModal2').modal('show')
}
function updateAvgPrice(){
$.ajax({
type: 'GET',
url: '../rentPriceUpdate/updateAvgPrice',
data: {"id":$("#_id").val(),avgPrice:$("#avgPrice").val()},
dataType: 'json',
timeout: 100000,
success: function(model) {
$('#myModal').modal('hide')
showSuccessMsg("更新成功");
initChart();
}
});
}
function addAvgPrice(){
$.ajax({
type: 'GET',
url: '../rentPriceUpdate/addAvgPrice',
data: {"cityDisplay":$("#_city").val(), "region" : $("#_region").val(), "block" : $("#_block").val(), "weekend" : $("#shortDate").val(), avgPrice:$("#avgPrice2").val()},
dataType: 'json',
timeout: 100000,
success: function(model) {
alert(model.msg);
location.reload();
}
});
}
function initChart(){
var data
$.ajax({
type: 'GET',
url: '../rentPriceUpdate/loadAllAvgPriceForChart',
data: {"cityName":selectCity,region:selectRegion,block:selectBlock},
dataType: 'json',
timeout: 100000,
async:false,
success: function(model) {
data = model.data;
}
});
var series = new Array();
series[0] = {
name:"租金",
data:new Array(),
//color:"#660099",
events:{
click:function(event){
var item = event.point.data;
$("#dateLabel").text(item.weekend);
$("#coverageLabel").text(item.coverage);
$("#creditLabel").text(item.credit);
$("#calcValueLabel").text(item.calcValue);
$("#avgPrice").val(item.avgPrice);
$("#_id").val(item.id);
}
}
}
series[1] = {
name:"计算租金",
data:new Array(),
color:"#55AC8C",
visible: false,
events:{
click:function(event){
var item = event.point.data;
$("#dateLabel").text(item.weekend);
$("#coverageLabel").text(item.coverage);
$("#creditLabel").text(item.credit);
$("#calcValueLabel").text(item.calcValue);
$("#avgPrice").val(item.avgPrice);
$("#_id").val(item.id);
}
}
}
$(data).each(function(i,item){
var y = item.weekend.split("-")[0]
var m = item.weekend.split("-")[1] -1
var d = item.weekend.split("-")[2]
series[0].data.push({
x:Date.UTC(y, m, d),
y:item.avgPrice,
data:item
})
if(item.calcValue!=0){
series[1].data.push({
x:Date.UTC(y, m, d),
y:item.calcValue,
data:item
})
}
});
$('#container').highcharts({
chart: {
zoomType:"xy",
height: 700,
},
title: {
text: '${cityDisplay!}<#if region??>-${region!}</#if><#if block??>-${block!}</#if> 租金走势图'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%y-%m-%e',
year: '%b'
}
},
yAxis: {
title: {
text: '租金(元/平米)'
},
min: 0
},
tooltip: {
crosshairs: true,
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
Highcharts.dateFormat('%y-%m-%e', this.x) +': '+ this.y +' 元/平米';
}
},
series:series
});
}
function showSuccessMsg(msg){
jNotify(
msg,
{
autoHide : true,
clickOverlay : false,
MinWidth : 250,
TimeShown : 2000,
ShowTimeEffect : 1000,
HideTimeEffect : 1000,
LongTrip :20,
HorizontalPosition : 'right',
VerticalPosition : 'top',
ShowOverlay : true,
ColorOverlay : '#000',
OpacityOverlay : 0.3,
onClosed : function(){
},
onCompleted : function(){
}
});
}
$(function(){
$("#Pagination").pagination({
callback:pageselectCallback,
prev_text:"上一页",
next_text:"下一页",
items_per_page:10,
num_display_entries:5,
num_edge_entries:5,
items_total:-1
});
initChart();
$('#myTab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
});
</script>
</#compress>
@@ -0,0 +1,946 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><#if district??>${district.name!}</#if> 租金详细信息</title>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/main_simple.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/pagination.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/jnotify/jNotify.jquery.css?v=${version}" />
<#include "/common_js.ftl" />
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../js/jquery.pagination.js?v=${version}"></script>
<script type="text/javascript" src="../js/highcharts/highcharts-3.0.7.js"></script>
<script type="text/javascript" src="../js/highcharts/exporting-3.0.7.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jNotify.jquery.min.js?v=${version}"></script>
<style>
.con {
border-radius:0px;
}
label{display:inline-block}
.input-small{
margin:0px;
}
.prettyprint {
padding: 8px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}
i:hover{
cursor:pointer;
}
.ac td{
text-align:center;
vertical-align: middle;
}
.ac th{
text-align:center;
vertical-align: middle;
}
</style>
</head>
<body>
<#include "/layout/header.ftl" />
<div class="main-content" style="padding:10px 10px;">
<p class="prettyprint" style="text-align: center;">
<strong style="font-size:18px;">
<a href="../rentPriceUpdate/districtList?cityDisplay=${district.city!}">${district.city!}</a>-
<a href="../rentPriceUpdate/districtList?cityDisplay=${district.city!}&region=${district.region!}">${district.region!}</a>-
${district.name!}(${district.estateType2!})
</strong>租金详细信息
<span style="float:right;font-size: 12px;"><a onclick="javascript:$('#myReCompModal').modal('show')" href="javascript:;">重算租金</a></span>
</p>
<br>
<p class="prettyprint" style="text-align: left;">
<#if sqmetreRent??>
最新(<b>${t_util.formatDate(sqmetreRent.weekend!)}</b>)
租金:<b style="color:red;">${sqmetreRent.avgPrice!}</b>元/平米&nbsp;
<#-- 2B租金:<b style="color:red;">${districtStat.avg_price_2b!}</b>元/平米&nbsp;-->
计算方式:
<#if (sqmetreRent.valueType)??>
<#if sqmetreRent.valueType=='own'>
自身样本
</#if>
<#if sqmetreRent.valueType=='around'>
周边
</#if>
</#if>
可信度:${(sqmetreRent.credit!)?string("#.#######")}
<#if sqmetreRent.markup??>
&nbsp;环比上月:<#if sqmetreRent.markup gt 0><b style="color:red">↑</b><#elseif sqmetreRent.markup lt 0><b style="color:green">↓</b></#if><b>${(sqmetreRent.markup!/100.0)?string("#.##")}%</b>
</#if>
<#else>
本月租金暂无
</#if>
</p>
<br>
<p class="prettyprint"><strong>${district.name!}-价格走势图</strong></p>
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>提示</h3>
</div>
<div class="modal-body">
<p>确定要更新租金?</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">关闭</a>
<a href="#" class="btn btn-warning" onclick="updateAvgPrice()">更新</a>
</div>
</div>
<div id="container"></div>
<#-- <div style="width:19%;float:left;">-->
<#-- <p class="prettyprint"><strong><a name="guiding"></a>${district.name!}-指导价</strong></p>-->
<#-- <div style="border: 1px solid #e1e1e8;margin-bottom: 3px;margin-top: 2px;padding-left:1px;padding-top: 3px;">-->
<#-- <table class="table table-bordered" style="width:<#if 120 * (guidingPrices?size+1) lt 300>300<#else>>${120 * (guidingPrices?size+1)}</#if>px">-->
<#-- <tr>-->
<#-- <td colspan="${(guidingPrices?size+1)}">-->
<#-- <form class="form-inline" style="padding:4px;">-->
<#-- <input placeholder="指导日期" id="guidingDate" name="guidingDate" readonly="true" type="text" class="input-small" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'%y-%M-%d'})">-->
<#-- <input placeholder="指导价格" id="guidingPrice" name="value" type="number" class="input-small">-->
<#-- <button type="button" id="saveGuidPrice" class="btn btn-primary" >添加</button>-->
<#-- </form>-->
<#-- </td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td style="width:120px;">日期 </td>-->
<#-- <#list guidingPrices as it>-->
<#-- <td style="width:120px;">${it.guidingDate?string("yyyy-MM-dd")} <i class="icon-trash" data-id="${it.id}" title="删除"></i>-->
<#-- </td>-->
<#-- </#list>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td style="width:120px;">价格</td>-->
<#-- <#list guidingPrices as it><td style="width:100px;">${it.guidingValue!}</td></#list>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td style="width:120px;">添加人</td>-->
<#-- <#list guidingPrices as it><td style="width:100px;">${it.guidingPerson!}</td></#list>-->
<#-- </tr>-->
<#-- </table>-->
<#-- </div>-->
<#-- </div>-->
<#-- <div style="width: 80%;float:left;padding-left: 10px;">-->
<#-- <p class="prettyprint"><strong><a name="guiding"></a>${district.name!}-参考价</strong></p>-->
<#-- <table class="table table-bordered table-condensed ac">-->
<#-- <thead>-->
<#-- <tr>-->
<#-- <th style="width:10%;">价格</th>-->
<#-- -->
<#-- <th style="width:10%;">调查时间</th>-->
<#-- <th style="width:10%;">调查人</th>-->
<#-- </tr>-->
<#-- </thead>-->
<#-- <tbody>-->
<#-- <#if (avgBases??&&avgBases?size>0)>-->
<#-- <#list avgBases as it>-->
<#-- <tr>-->
<#-- <td align="center">-->
<#-- ${it.price}-->
<#-- </td>-->
<#-- -->
<#-- <td align="center">-->
<#-- ${it.creationDate?string("yyyy-MM-dd")}-->
<#-- </td>-->
<#-- <td align="center">-->
<#-- <#if it.userName??>-->
<#-- ${it.userName}-->
<#-- </#if>-->
<#-- </td> -->
<#-- </tr>-->
<#-- </#list>-->
<#-- </#if>-->
<#-- </tbody>-->
<#-- <#if avgBases?size == 0>-->
<#-- <tr><td colspan="3" style="text-align:center;">暂无数据</td></tr>-->
<#-- </#if>-->
<#-- -->
<#-- </table>-->
<#-- </div>-->
<#-- <div style="clear:both;"></div>-->
<#-- -->
<#-- <p class="prettyprint"><strong>${district.name!}-第三方价格对比</strong></p>-->
<#-- <table class="table table-condensed ac" id="dsfjj">-->
<#-- <#list averageStatistics as it>-->
<#-- <tr>-->
<#-- <td style="vertical-align: middle;width:100px;" rowspan="2"><b>日期</b></td>-->
<#-- <td style="vertical-align: middle;" rowspan="2"><b>房价网</b></td>-->
<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??> -->
<#-- <td colspan="2"><b>小资家</b></td>-->
<#-- </#if>-->
<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>-->
<#-- <td colspan="2"><b>链家</b></td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>-->
<#-- <td colspan="2"><b>安居客</b></td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>-->
<#-- <td colspan="2"><b>诸葛</b></td>-->
<#-- </#if>-->
<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>-->
<#-- <td colspan="2"><b>贝壳</b></td>-->
<#-- </#if>-->
<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>-->
<#-- <td colspan="2"><b>房估估</b></td>-->
<#-- </#if>-->
<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>-->
<#-- <td colspan="2"><b>房兜兜</b></td> -->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>-->
<#-- <td colspan="2"><b>搜房</b></td>-->
<#-- </#if>-->
<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>-->
<#-- <td colspan="2"><b>cityhouse</b></td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>-->
<#-- <td colspan="2"><b>房探</b></td>-->
<#-- </#if>-->
<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>-->
<#-- <td colspan="2"><b>兔博士</b></td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>-->
<#-- <td colspan="2"><b>中原地产</b></td>-->
<#-- </#if>-->
<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>-->
<#-- <td colspan="2"><b>乐有家</b></td>-->
<#-- </#if>-->
<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>-->
<#-- <td colspan="2"><b>Q房</b></td>-->
<#-- </#if>-->
<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>-->
<#-- <td colspan="2"><b>新浪</b></td>-->
<#-- </#if>-->
<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>-->
<#-- <td colspan="2"><b>克尔瑞</b></td>-->
<#-- </#if>-->
<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>-->
<#-- <td colspan="2"><b>赶集网</b></td>-->
<#-- </#if>-->
<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>-->
<#-- <td colspan="2"><b>云估价</b></td>-->
<#-- </#if> -->
<#-- </tr>-->
<#-- -->
<#-- <tr>-->
<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??>-->
<#-- <td style="width:80px;color:#0C88C7">新房</td>-->
<#-- <td style="width:80px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>-->
<#-- <td style="width:80px;color:#0C88C7">新房</td>-->
<#-- <td style="width:80px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>-->
<#-- <td style="width:80px;color:#0C88C7">新房</td>-->
<#-- <td style="width:80px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>-->
<#-- <td style="width:80px;color:#0C88C7">新房</td>-->
<#-- <td style="width:80px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>-->
<#-- <td style="width:80px;color:#0C88C7">新房</td>-->
<#-- <td style="width:80px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>-->
<#-- <td style="width:80px;color:#0C88C7">新房</td>-->
<#-- <td style="width:80px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>-->
<#-- <td style="width:80px;color:#0C88C7">新房</td>-->
<#-- <td style="width:80px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>-->
<#-- <td style="width:80px;color:#0C88C7">新房</td>-->
<#-- <td style="width:80px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??> -->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td> -->
<#-- </#if>-->
<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td> -->
<#-- </#if>-->
<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td> -->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td> -->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td> -->
<#-- </#if>-->
<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>-->
<#-- <td style="width:70px;color:#0C88C7">新房</td>-->
<#-- <td style="width:70px;color:#D3750A">二手房</td> -->
<#-- -->
<#-- </#if>-->
<#-- -->
<#-- </tr>-->
<#-- -->
<#-- <tr>-->
<#-- <td>${(t_util.parseDate(it.shortDate?string, 'yyyyMM'))?string("yyyy年MM月")}</td>-->
<#-- <td>${it.fangjiaPrice!}</td>-->
<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??>-->
<#-- <td style="color:#0C88C7;">${it.xiaozijiaNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.xiaozijiaEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>-->
<#-- <td style="color:#0C88C7;">${it.lianjiaNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.lianjiaEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.anjukeNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.anjukeEsfPrice!}</td>-->
<#-- </#if>-->
<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.zhugezhaofangNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.zhugezhaofangEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.beikeNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.beikeEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.fangguguNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.fangguguEsfPrice!}</td>-->
<#-- </#if>-->
<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.fangdoudouNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.fangdoudouEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.soufangNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.soufangEsfPrice!}</td> -->
<#-- </#if>-->
<#-- -->
<#-- -->
<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.cityhouseNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.cityhouseEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.fangtanNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.fangtanEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.tuboshiNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.tuboshiEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.centanetNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.centanetEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.leyoujiaNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.leyoujiaEsfPrice!}</td> -->
<#-- </#if>-->
<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.qfangNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.qfangEsfPrice!}</td> -->
<#-- </#if>-->
<#-- -->
<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.sinaNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.sinaEsfPrice!}</td> -->
<#-- </#if>-->
<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.cricNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.cricEsfPrice!}</td> -->
<#-- </#if> -->
<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.ganjiNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.ganjiEsfPrice!}</td> -->
<#-- </#if>-->
<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>-->
<#-- <td style ="color:#0C88C7">${it.yungujiaNewPrice!}</td>-->
<#-- <td style ="color:#D3750A">${it.yungujiaEsfPrice!}</td>-->
<#-- </#if>-->
<#-- -->
<#-- </tr>-->
<#-- </#list>-->
<#-- <#if averageStatistics?size == 0>-->
<#-- <tr><td colspan="7" style="text-align:center;">暂无数据</td></tr>-->
<#-- </#if>-->
<#-- </table>-->
<#-- -->
<#-- <div id="comparisonChartContainer">-->
<#-- <#if !(calcDistrictStat??)><div style="width: 100%;height: 150px;border: 1px solid #d2c298;text-align: center;">本月没有利用第三方的详细数据!</div></#if>-->
<#-- </div>-->
<#-- <#if calcDistrictStat?? && calcDistrictStat.thirdpartDetails??>-->
<#-- <#macro greet pt> -->
<#-- <#assign ret=0>-->
<#-- <#list calcDistrictStat.thirdpartDetails as detail>-->
<#-- <#if detail['name'] == pt && detail['val']??>-->
<#-- <#assign ret>${detail['val']!}</#assign>-->
<#-- </#if>-->
<#-- </#list>-->
<#-- ${ret}-->
<#-- </#macro> -->
<#-- </#if>-->
<p class="prettyprint">
<strong>${district.name!}-样本散列图</strong>
<a style="font-size:8px;float:right;" target="_blank" href="../seawater/houseList?cityDisplay=${district.city!}&region=${district.region!}&districtName=${district.name!}&cat=rent">房源样本列表</a>
<#-- <a style="font-size:8px;float:right;padding-right: 10px;" target="_blank" href="../data/dealPrice?cityDisplay=${district.city}&region=${district.region}&districtName=${district.name}" >交易数据列表(${dealPriceCount!})</a>-->
</p>
<#-- <table class="table table-bordered">
<tr><th>七天</th><th>一个月</th><th>三个月</th><th>半年</th><th>一年</th><th>全部</th><tr>
<tr><td>${distribution['QiTian']}</td><td>${distribution['YiYue']}</td><td>${distribution['SanYue']}</td><td>${distribution['BanNian']}</td><td>${distribution['YiNian']}</td><td>${distribution['All']}</td><tr>
</table> -->
<p class="prettyprint"><strong>${district.name!}-房源散列图</strong></p>
<div id="houseChart"></div>
<#-- <p class="prettyprint"><strong>${district.name!}-样本过滤规则</strong></p>-->
<#-- <form class="form-inline" style="padding:10px;">-->
<#-- <#if calcConfig??>-->
<#-- <input id="configId" value="${calcConfig.id!}" type="hidden"/>-->
<#-- <#else>-->
<#-- <input id="configId" value="" type="hidden"/>-->
<#-- </#if>-->
<#-- <label for="minPrice">最低房价:</label>-->
<#-- <#if calcConfig??>-->
<#-- <input id="minPrice" type="number" class="input-small" value='${calcConfig.logicalMinValue!}'>-->
<#-- <#else>-->
<#-- <input id="configId" value="" type="hidden"/>-->
<#-- </#if>-->
<#-- <label for="maxPrice">最高房价:</label>-->
<#-- <#if calcConfig??>-->
<#-- <input id="maxPrice" type="number" class="input-small" value='${calcConfig.logicalMaxValue!}'>-->
<#-- <#else>-->
<#-- <input id="configId" value="" type="hidden"/>-->
<#-- </#if>-->
<#-- <button type="button" id="sampleFilterBtn" class="btn">设置</button>(<span class="code" style="color: #D14;">请设置较大区间</span>)-->
<#-- </form>-->
<#-- <hr><br>-->
<#-- <div style="text-align:center;">-->
<#-- <button type="button" onclick="javascript:$('#myReCompModal').modal('show')" class="btn btn-danger" >重算租金</button>-->
<#-- </div>-->
<#-- <hr><br><br>-->
</div>
<div id="myReCompModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">是否确定?</h3>
</div>
<div class="modal-body error">
<p>1.耗时较长,请谨慎操作!</p>
<p>2.计算<b>${district.name!}</b>的历史价格!</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true" aria-hidden="true">关闭</button>
<button class="btn btn-primary" name="reComputeBtn" type="all">重算历史</button>
<button class="btn btn-primary" name="reComputeBtn" type="month">最近一期</button>
<#-- <button class="btn btn-primary" name="reComputeBtn" type="month">最近一月</button>-->
<#-- <button class="btn btn-primary" name="reComputeBtn" type="quarter">最近季度</button>-->
<button class="btn btn-primary" name="reComputeBtn" type="year">最近一年</button>
</div>
</div>
</body>
</html>
<script type="text/javascript">
var selectCity = '${district.city!}';
var selectRegion = '${district.region!}'
var selectBlock = '${district.block!}'
var name = '${district.name!}'
function updateAvgPriveOpener(){
if($("#_id").val()==undefined||$("#_id").val()===""){
alert("请选择要更新的时间点");
return;
}
$('#myModal').modal('show')
}
function updateAvgPrice(){
$.ajax({
type: 'GET',
url: '../rentPriceUpdate/updateAvgPrice',
data: {"id":$("#_id").val(),avgPrice:$("#avgPrice").val()},
dataType: 'json',
timeout: 100000,
success: function(model) {
$('#myModal').modal('hide')
showSuccessMsg("更新成功");
initChart();
}
});
}
function initChart(){
var data
$.ajax({
type: 'GET',
url: '../rentPriceUpdate/loadAllDistrictRentPrice',
data: {"cityName":selectCity,region:selectRegion,name:name,estateType:'${district.estateType2!}'},
dataType: 'json',
timeout: 100000,
async:false,
success: function(model) {
data = model.data;
}
});
var series = new Array();
series[0] = {
name:"租金",
data:new Array(),
color:"#0066FF",
events:{
click:function(event){
var item = event.point.data;
$("#dateLabel").text(item.weekend.substring(0,10));
$("#sampleSizeLabel").text(item.sampleSize);
$("#creditLabel").text(item.credit);
$("#calcValueLabel").text(item.calcAvgPrice);
$("#avgPrice").val(item.avgPrice);
$("#_id").val(item.id);
}
}
}
series[1] = {
name:"计算租金",
data:new Array(),
color:"#55AC8C",
visible: false,
events:{
click:function(event){
var item = event.point.data;
$("#dateLabel").text(item.weekend.substring(0,10));
$("#sampleSizeLabel").text(item.sampleSize);
$("#creditLabel").text(item.credit);
$("#calcValueLabel").text(item.calcAvgPrice);
$("#avgPrice").val(item.avgPrice);
$("#_id").val(item.id);
}
}
}
// series[2] = {
// name:"2B价格",
// data:new Array(),
// color:"#5bce60",
// visible: false,
// events:{
// click:function(event){
// var item = event.point.data;
// $("#dateLabel").text(item.weekend.substring(0,10));
// $("#sampleSizeLabel").text(item.sampleSize);
// $("#creditLabel").text(item.credit);
// $("#calcValueLabel").text(item.calcAvgPrice);
// $("#avgPrice").val(item.avgPrice);
// $("#_id").val(item.id);
// }
// }
// }
// series[3] = {
// name:"2B计算价格",
// data:new Array(),
// color:"#a9864f",
// visible: false,
// events:{
// click:function(event){
// var item = event.point.data;
// $("#dateLabel").text(item.weekend.substring(0,10));
// $("#sampleSizeLabel").text(item.sampleSize);
// $("#creditLabel").text(item.credit);
// $("#calcValueLabel").text(item.calcAvgPrice);
// $("#avgPrice").val(item.avgPrice);
// $("#_id").val(item.id);
// }
// }
// }
// series[4] = {
// name:"预期价格",
// data:new Array(),
// color:"red",
// visible: true,
// events:{
// click:function(event){
// var item = event.point.data;
// $("#dateLabel").text(item.weekend.substring(0,10));
// $("#sampleSizeLabel").text(item.sampleSize);
// $("#creditLabel").text(item.credit);
// $("#calcValueLabel").text(item.calcAvgPrice);
// $("#avgPrice").val(item.avgPrice);
// $("#_id").val(item.id);
// }
// }
// }
$(data).each(function(i,item){
series[0].data.push({
x:new Date(item.weekend),
y:item.avgPrice,
data:item
})
if(item.calcAvgPrice!=0){
series[1].data.push({
x:new Date(item.weekend),
y:item.calcAvgPrice,
data:item
})
}
// if (typeof(item.avg_price_2b) != "undefined"){
// series[2].data.push({
// x:new Date(item.weekend),
// y:item.avg_price_2b,
// data:item
// })
// }
//
// if (typeof(item.calc_avg_price_2b) != "undefined"){
// series[3].data.push({
// x:new Date(item.weekend),
// y:item.calc_avg_price_2b,
// data:item
// })
// }
// if (typeof(item.futureValue) != "undefined"){
// series[4].data.push({
// x:new Date(item.weekend),
// y:item.futureValue,
// data:item
// })
// }
});
$('#container').highcharts({
chart: {
type: 'spline',
zoomType:"xy",
height:700
},
title: {
text:'租金走势图('+name+')'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%y-%m-%e',
year: '%b'
}
},
yAxis: {
title: {
text: '租金(元/平米)'
},
min: 0
},
tooltip: {
crosshairs: true,
formatter: function() {
var item = this.point.data;
var credit = item.credit;
var title = (Highcharts.dateFormat('%y-%m-%e', this.x)+'<br/>')
title +=('<b>'+ this.series.name +'</b>:'+this.y+'元/平米<br/>');
title +=('<b>可信度:</b>'+credit+'</br>')
if(credit>=0.8){
title +=('<b>样本量:</b>'+item.sampleSize+'</br>')
}else if(credit>=0.6){
}
return title;
}
},
series:series
});
}
function initHouseChart(){
var data
$.ajax({
type: 'GET',
url: '../rentPriceUpdate/loadHouseInfo',
data: {"cityName":selectCity,region:selectRegion,name:name},
dataType: 'json',
timeout: 100000,
async:false,
success: function(model) {
data = model.data;
}
});
var series = new Array();
series[0] = {
name:"房源散列图",
data:new Array()
//color:"#660099"
}
$(data).each(function(i,item){
var pdate = item.pDate + "";
var ds = pdate.substring(0, 4) + '-' + pdate.substring(4, 6) + '-' + pdate.substring(6)
series[0].data.push({
x:new Date(ds),
y:Math.round(item.totalPrice/item.area),
data:item
})
});
$('#houseChart').highcharts({
chart: {
type: 'scatter',
zoomType:"xy",
height:500
},
title: {
text:name + ' 样本散列图'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%y-%m-%e',
year: '%b'
}
},
yAxis: {
title: {
text: '租金(元/平米)'
},
min: 0
},
tooltip: {
crosshairs: true,
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
Highcharts.dateFormat('%y-%m-%e', this.x) +': '+ this.y +' 元/平米';
}
},
series:series
});
}
function showSuccessMsg(msg){
jNotify(
msg,
{
autoHide : true,
clickOverlay : false,
MinWidth : 250,
TimeShown : 2000,
ShowTimeEffect : 1000,
HideTimeEffect : 1000,
LongTrip :20,
HorizontalPosition : 'right',
VerticalPosition : 'top',
ShowOverlay : true,
ColorOverlay : '#000',
OpacityOverlay : 0.3,
onClosed : function(){
},
onCompleted : function(){
}
});
}
<#--第三方对比图 start-->
<#if calcDistrictStat?? && calcDistrictStat.thirdpartDetails??>
$('#comparisonChartContainer').highcharts({
chart: {
type: 'column'
},
title: {
text: '第三方价格详细利用情况'
},
subtitle: {
text: '(利用最近2个月的数据)'
},
xAxis: {
categories: [
'搜房','安居客','新浪','克尔瑞','赶集'
]
},
yAxis: {
min: 0,
title: {
text: 'Rainfall (mm)'
}
},
tooltip: {
headerFormat: '<b>{point.key}</b><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0"><b>{series.name}</b>:</td>' +
'<td style="padding:0">{point.y}</td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [
{
color:'#0C88C7',
name: '新房',
data: [<@greet pt='soufun_new' />, <@greet pt='anjuke_new' />,<@greet pt='sina_new' />,<@greet pt='cric_new' />,<@greet pt='ganji_new' />]
},
{
color:'#D3750A',
name: '二手房',
data: [<@greet pt='soufun_esf' />, <@greet pt='anjuke_esf' />,<@greet pt='sina_esf' />,<@greet pt='cric_esf' />,<@greet pt='ganji_esf' />]
},
]
});
</#if>
$(function(){
initChart();
initHouseChart();
$("#saveGuidPrice").click(function(){
if($("#guidingPrice").val()===""){
alert("指导价不能为空");
return;
}
if(!$.isNumeric($("#guidingPrice").val())){
alert("指导价必须是数字");
return;
}
if($("#guidingDate").val()===""){
alert("指导日期不能为空");
return;
}
if(${(guidingPrices?size+1)}>=2){
alert("指导价已添加!");
return;
}
$.ajax({
type: 'POST',
url: '../rentPriceUpdate/addGuidingPrice',
data: {"guidingPrice":$("#guidingPrice").val(),guidingDate:$("#guidingDate").val(),id:'${id}'},
dataType: 'json',
timeout: 100000,
success: function(model) {
showSuccessMsg('保存成功!!建议你重算租金');
window.location.hash= 'guiding';
window.location.reload();
}
});
});
$("#sampleFilterBtn").click(function(){
var minPrice = $.trim($("#minPrice").val())
var maxPrice = $.trim($("#maxPrice").val())
if(maxPrice===""||maxPrice===""){
alert("请填写价格区间");
return;
}
if($.trim($("#minPrice").val())!==""&&!$.isNumeric($.trim($("#minPrice").val()))){
alert("价格必须是数字");
return;
}
if($.trim($("#maxPrice").val())!==""&&!$.isNumeric($.trim($("#maxPrice").val()))){
alert("价格必须是数字");
return;
}
if(minPrice!=""&&maxPrice!=""){
if(new Number(maxPrice) - new Number(minPrice)<2000){
alert("最大价格和最小价格至少要相差2000元")
return;
}
}
$.ajax({
type: 'POST',
url: '../rentPriceUpdate/updateCalcConfig',
data: {"minPrice":minPrice,maxPrice:maxPrice,id:'${id}',configId:$("#configId").val()},
dataType: 'json',
timeout: 100000,
success: function(model) {
showSuccessMsg('保存成功');
}
});
});
$(".icon-trash").click(function(){
$.ajax({
type: 'POST',
url: '../rentPriceUpdate/deleteGuidingPrice',
data: {id:$(this).attr("data-id")},
dataType: 'json',
timeout: 100000,
success: function(model) {
showSuccessMsg("指导价删除成功!!建议你重算租金");
window.location.reload();
}
});
});
function getBeforeDay(day) {
var rdate = new Date();
var cmills = new Date().getTime()
if(day > 0) {
cmills = cmills - day * 24 * 3600 * 1000;
}
rdate.setTime(cmills)
var month = rdate.getMonth() < 10 ? "0" + rdate.getMonth() : rdate.getMonth();
var date = rdate.getDate() < 10 ? "0" + rdate.getDate() : rdate.getDate();
return rdate.getFullYear() + month + "" + date
}
$("button[name='reComputeBtn']").click(function(){
var type = $(this).attr('type');
var data ={};
var commands = Array();
commands.push({city:'${district.city!}',region:'${district.region!}',name:'${district.name!}',estateType:'${district.estateType2!}'})
data.commands = commands ;
data.calcRange = type;
$.ajax({
url:"../rentPriceUpdate/reCompute",
dataType:"json",
type:'POST',
data:{data:JSON.stringify(data)},
success:function(data){
showSuccessMsg(data.msg)
$('#myReCompModal').modal('hide')
}
});
});
});
</script>
</#compress>
@@ -0,0 +1,344 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>${cityDisplay}<#if region?? && region!=''>-${region}<#if block?? && block!=''>-${block}</#if></#if> 小区均价操作列表</title>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/main_simple.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/pagination.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/jnotify/jNotify.jquery.css?v=${version}" />
<#include "/common_js.ftl" />
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../js/jquery.pagination.js?v=${version}"></script>
<script type="text/javascript" src="../js/highcharts/highcharts-3.0.7.js"></script>
<script type="text/javascript" src="../js/highcharts/exporting-3.0.7.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jNotify.jquery.min.js?v=${version}"></script>
<style>
.con {
border-radius:0px;
}
label{display:inline-block}
.input-small{
margin:0px;
}
#city-border-mid{
margin-top:6px;
}
.pagination-page {
padding-top:8px;
padding-right:20px;
}
.pagination-page a{
border-color: #ccc #aaa #aaa #ccc;
border-image: none;
border-style: solid;
border-width: 1px;
color: #666;
margin: 0 3px;
padding: 2px 6px;
}
.current-page {
padding: 2px 3px;
color: #666;
background: #fff;
font-weight: bold;
}
</style>
</head>
<body>
<#include "/layout/header.ftl" />
<#setting number_format="0.###########"/>
<div class="main-content" style="padding:10px 10px;">
<table class="table table-bordered table-condensed">
<tr>
<th>查询条件</th>
</tr>
<tr>
<td>
<form action="districtList">
<@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" name="cityDisplay"/>
<label for="region">区域:</label>
<select id="region" name="region" class="form-control" onchange="changeRegion()" style="width: 120px;">
<option value="">不限</option>
</select>
<label for="region">板块:</label>
<select id="block" name="block" class="form-control" style="width: 120px;">
<option value="">不限</option>
</select>
<label for="name">可信度:</label>
<select id="minCredit" name="minCredit" class="form-control" style="width: 70px;">
<option value="">--</option>
<#list 0..100 as a>
<option <#if minCredit?? && a/100?number == minCredit>selected</#if> value="${a/100?number}">${a/100?number}</option>
</#list>
</select>
-
<select id="maxCredit" name="maxCredit" class="form-control" style="width: 70px;">
<option value="">--</option>
<#list 0..100 as a>
<option <#if maxCredit?? && a/100?number == maxCredit>selected</#if> value="${a/100?number}">${a/100?number}</option>
</#list>
</select>
<label for="name">计算方式:</label>
<select id="valueType" name="valueType" class="form-control" style="width: 120px;">
<option value="">不限</option>
<option value="1" <#if valueType?? && valueType == 1>selected</#if> >指导价</option>
<option value="2" <#if valueType?? && valueType == 2>selected</#if> >自身样本</option>
<option value="3" <#if valueType?? && valueType == 3>selected</#if> >第三方</option>
<option value="4" <#if valueType?? && valueType == 4>selected</#if> >交易数据</option>
<option value="5" <#if valueType?? && valueType == 5>selected</#if> >周边楼盘</option>
<option value="6" <#if valueType?? && valueType == 6>selected</#if> >推算</option>
<option value="-1" <#if valueType?? && valueType == -1>selected</#if> >无方式</option>
</select>
<label for="name">小区:</label>
<input type="text" name="name" id="name" class="input-medium" style="margin-top:4px;" value="${name!}" >
<input id="queryBtn" class ="btn btn-primary" type="submit" value="查询" />
</form>
</td>
</tr>
</table>
<span style="font-size:12px;">查询到<b style="color:red;">${pager.totalRows!}</b>条记录</span>
<table id="dataSheet" class="table table-hover table-condensed">
<tr>
<th style="width:20px;"></th>
<th style="width:60px;">区域</th>
<th style="width:150px;">小区名</th>
<th style="width:150px;">别名</th>
<th style="width:60px;">物业类型</th>
<th style="width:50px;">
<#if sort?? && sort == 'price_desc'>
<a href="../rentPriceUpdate/districtList?cityDisplay=${cityDisplay!}&region=${region!}&block=${block!}&name=${name!}&valueType=${valueType!}&minCredit=${minCredit!}&maxCredit=${maxCredit!}&sort=price_asc">均价</a>↓
<#elseif sort?? && sort == 'price_asc'>
<a href="../rentPriceUpdate/districtList?cityDisplay=${cityDisplay!}&region=${region!}&block=${block!}&name=${name!}&valueType=${valueType!}&minCredit=${minCredit!}&maxCredit=${maxCredit!}&sort=price_desc">均价</a>↑
<#else>
<a href="../rentPriceUpdate/districtList?cityDisplay=${cityDisplay!}&region=${region!}&block=${block!}&name=${name!}&valueType=${valueType!}&minCredit=${minCredit!}&maxCredit=${maxCredit!}&sort=price_desc">均价</a>
</#if>
</th>
<th style="width:86px;">时间</th>
<th style="width:60px;">
<#if sort?? && sort == 'credit_desc'><a href="../rentPriceUpdate/districtList?cityDisplay=${cityDisplay!}&region=${region!}&block=${block!}&name=${name!}&minCredit=${minCredit!}&maxCredit=${maxCredit!}&valueType=${valueType!}&sort=credit_asc">可信度</a>↓
<#elseif sort?? && sort == 'credit_asc'><a href="../rentPriceUpdate/districtList?cityDisplay=${cityDisplay!}&region=${region!}&block=${block!}&name=${name!}&minCredit=${minCredit!}&maxCredit=${maxCredit!}&valueType=${valueType!}&sort=credit_desc">可信度</a>↑
<#else><a href="../rentPriceUpdate/districtList?cityDisplay=${cityDisplay!}&region=${region!}&block=${block!}&name=${name!}&minCredit=${minCredit!}&maxCredit=${maxCredit!}&valueType=${valueType!}&sort=credit_desc">可信度</a>
</#if>
</th>
<th style="width:60px;">计算类型</th>
<th style="width:50px;">操作</th>
</tr>
<#if avgUpdateBos??>
<#list avgUpdateBos as it>
<tr>
<td><input type="checkbox" data-city="${it.city!}" data-region="${it.region!}" data-block="${it.block!}" data-name="${it.districtName!}" data-estateType="${it.estateType!}" data-startDate="${it.calcStartDate!}" data-id="${it.id!}"/></td>
<td>${it.region!}</td>
<td><a href="../rentPriceUpdate/districtDetail?id=${it.id}" target="_blank">${it.districtName!}</a></td>
<td style="width: 120px;">
<span>${t_util.join(it.alias!, ',')}</span>
</td>
<td>${it.estateType!}</td>
<td>${it.avgPrice!}</td>
<td>${it.weekend!}</td>
<td>${it.credit}</td>
<td>
<#if it.valueType?? && it.valueType == 1>
指导价
<#elseif it.valueType?? && it.valueType == 2>
自身样本
<#elseif it.valueType?? && it.valueType == 3>
第三方
<#elseif it.valueType?? && it.valueType == 4>
交易数据
<#elseif it.valueType?? && it.valueType == 5>
周边楼盘
</#if>
</td>
<td>
<a href="../priceSurvey/create?cityDisplay=${it.city!}&region=${it.region!}&districtName=${it.districtName!}" target="_blank">调查</a>
<a href="../seawater/houseList?cityDisplay=${it.city!}&region=${it.region!}&districtName=${it.districtName!}" target="_blank">样本</a>
<a href="../averagerConfig/show?display=${it.city!}&region=${it.region!}&name=${it.districtName!}" target="_blank">设置</a>
</td>
</tr>
</#list>
</#if>
<tfoot>
<tr>
<td colspan="14" style="text-align: right;">
<@d_pager action = "districtList" currentPage = pager.currentPage controller = "rentPriceUpdate" totalPages = pager.totalPages pagerCount=12 theme="full"/>
</td>
</tr>
</tfoot>
</table>
</div>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">警告</h3>
</div>
<div class="modal-body error">
<p>耗时操作,请谨慎操作!</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true" aria-hidden="true">关闭</button>
<button class="btn btn-primary" id="reComputeBtn">计算</button>
</div>
</div>
</body>
</html>
<script type="text/javascript">
var selectCity = '${cityDisplay!}';
var selectRegion = '${region!}'
var selectBlock = '${block!}'
function changeCity(display){
selectCity = display;
if (display) {
$("#display").val(display);
}
jQuery.ajax({
type: 'POST',
url: '../district/getRegions',
data: encodeURI("cityDisplay=" + display),
dataType: 'json',
timeout: 100000,
success: function(model) {
$("#region").empty();
if (model.regionList.length > 0) {
$("<option value=''>不限</option>").appendTo($("#region"));
$.each(model.regionList, function(i, region){
if(selectRegion == region){
$("<option value='" + region + "' selected>" + region + "</option>").appendTo($("#region"));
}else{
$("<option value='" + region + "' >" + region + "</option>").appendTo($("#region"));
}
});
}
},
error : function() {
}
});
}
function changeRegion(r){
var selectRegion = $("#region option:selected").text();
if(r!=undefined){
selectRegion = r;
}
$("#block").empty();
if(region==="不限"){
$("<option value=''>不限</option>").appendTo($("#block"));
}
jQuery.ajax({
type: 'POST',
url: '../district/getBlocks',
data: {cityDisplay:selectCity,region:selectRegion},
dataType: 'json',
timeout: 100000,
success: function(model) {
$("#block").empty();
if (model.blockList.length > 0) {
$("<option value=''>不限</option>").appendTo($("#block"));
$.each(model.blockList, function(i, block){
if(selectBlock == block){
$("<option value='" + block + "' selected>" + block + "</option>").appendTo($("#block"));
}else{
$("<option value='" + block + "' >" + block + "</option>").appendTo($("#block"));
}
});
}
},
error : function() {
}
});
}
changeCity('${cityDisplay!}');
if(selectRegion !==''){
changeRegion(selectRegion);
}
function openWarnDailog(){
var checkedInputs = $("#dataSheet input:checked")
if(checkedInputs.length==0){
alert("请选择要更新的小区");
return;
}
$('#myModal').modal('show')
}
function showSuccessMsg(msg){
jNotify(
msg,
{
autoHide : true,
clickOverlay : false,
MinWidth : 250,
TimeShown : 2000,
ShowTimeEffect : 1000,
HideTimeEffect : 1000,
LongTrip :20,
HorizontalPosition : 'right',
VerticalPosition : 'top',
ShowOverlay : true,
ColorOverlay : '#000',
OpacityOverlay : 0.3,
onClosed : function(){
},
onCompleted : function(){
}
});
}
$(function(){
$("#reComputeBtn").click(function(){
var data ={};
var commands = Array();
$("#dataSheet input:checked").each(function(){
var command = {};
if($(this).attr("data-city")!==""){
command.city = $(this).attr("data-city")
}
if($(this).attr("data-region")!==""){
command.region = $(this).attr("data-region")
}
if($(this).attr("data-block")!==""){
command.block = $(this).attr("data-block")
}
if($(this).attr("data-name")!==""){
command.name = $(this).attr("data-name")
}
if($(this).attr("data-estateType")!==""){
command.estateType = $(this).attr("data-estateType")
}
if($(this).attr("data-startdate")!==""){
command.startDate = $(this).attr("data-startDate")
}
commands.push(command)
})
data.commands = commands ;
data.startDate = $("#startDate").val()
data.endDate = $("#endDate").val()
$.ajax({
url:"../rentPriceUpdate/reCompute",
dataType:"json",
type:'POST',
data:{data:JSON.stringify(data)},
success:function(data){
$("#dataSheet input:checked").removeAttr("checked")
showSuccessMsg(data.msg)
$('#myModal').modal('hide')
}
});
});
});
</script>
</#compress>
@@ -0,0 +1,278 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>均价操作后台</title>
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<style>
table tr td {
vertical-align: middle !important;;
}
</style>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/main_simple.css?v=${version}" />
<#include "/common_js.ftl" />
<style>
.right_arrow,.right_arrow:hover,.down_arrow,.down_arrow:hover {
width:0;
height:0;
line-height:0;
border-width:8px;
border-style:solid;
display: inline-block;
margin-top: 6px;
}
.right_arrow{
border-color:transparent transparent transparent #999999;margin-right: 5px; margin-bottom: -2px;
}
.right_arrow:hover{
border-color:transparent transparent transparent red;
}
.down_arrow{
margin-top:8px;
margin-right: 7px;
border-color:#999999 transparent transparent transparent;
}
.down_arrow:hover{
margin-top:8px;
border-color:red transparent transparent transparent;
}
.right_arrow:hover,.down_arrow:hover {
cursor:pointer;
}
input[type="checkbox"]{
margin-top:-3px;
}
</style>
</head>
<body>
<#include "/layout/header.ftl" />
<div class="main-content">
<#--
<table class="table table-bordered table-striped table-condensed">
<thead><tr><th style="width:220px;">项</th><th>值</th></tr></thead>
<tbody>
<tr><td> 城市</td><td><span id="cities"></span></td></tr>
<tr><td> 区域</td><td><span id="regions"></span></td></tr>
<tr><td> 板块</td><td><span id="blocks"></span></td></tr>
<tr><td>起止时间</td>
<td>
<input id="startDate" class="form-control" style="width:100px;" name="startDate" value="${endDate!}" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}',minDate:'2007-1-1'})" />
-<input id="endDate" class="form-control" style="width:100px;" name="endDate" value="${endDate!}" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'startDate\')||\'2007-1-1\'}'})"/>
</td>
</tr>
<tr>
<td>操作</td>
<td><button type="button" id="reComputeBtn" class="btn btn-danger">重算均价</button>
</td>
</tr>
</tbody>
</table>
-->
<div style="">
<#assign seqIndex = 0 />
<table class="table table-condensed table-bordered table-hover">
<tr>
<td colspan="5">
<#list ['HOT', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] as key>
<a href="#${key}">${key}</a>&nbsp;&nbsp;&nbsp;&nbsp;
</#list>
</td>
</tr>
<tr>
<th>序号</th><th>名称</th><th>最新均价</th><th>起始日期</th><th class="fixedtd">操作</th>
</tr>
<#list ['HOT', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] as key>
<#if avgUpdateBoMap[key]?? && avgUpdateBoMap[key]?size gt 0>
<tr>
<td colspan="5" style="background-color:rgb(236, 231, 231)">&nbsp;&nbsp;<b id="${key}" name="${key}" style="color:rgb(10, 0, 0)">${key}</b></td>
</tr>
<#list avgUpdateBoMap[key] as it>
<tr data-ids = "${it.id!}" data-city="${it.city}" data-level="1" data-startDate="${it.startDate!}">
<td style="width: 40px;"><#assign seqIndex = seqIndex +1 />${seqIndex}</td>
<td style="width:400px;">
&nbsp;${it.city}
</td>
<td>${it.avgPrice!}</td>
<td>${it.startDate!}</td>
<td>
<a href="../rentPriceUpdate/detail?cityDisplay=${it.city!}">详细信息</a>
<a href="../rentPriceUpdate/districtList?cityDisplay=${it.city!}">查看小区</a>
<a href="../districtHouseStat/list?cityDisplay=${it.city}">样本房源</a>
</td>
</tr>
</#list>
</#if>
</#list>
<table>
</div>
</div>
</body>
</html>
<#--
<script type="text/javascript">
$(function(){
listeners.addCityLevelListeners();
listeners.addItemListeners();
$("#reComputeBtn").click(function(){
var data ={};
var commands = Array();
$("input:checked").each(function(){
var tr = $(this).parent().parent();
var command = {};
if(tr.attr("data-level")=="1"){
command.city = tr.attr("data-city")
}else if(tr.attr("data-level")=="2"){
command.city = tr.attr("data-city")
command.region = tr.attr("data-region")
}else if(tr.attr("data-level")=="3"){
command.city = tr.attr("data-city")
command.region = tr.attr("data-region")
command.block = tr.attr("data-block")
}
command.startDate = tr.attr("data-startDate")
commands.push(command)
})
if(commands.length==0){
alert("你没有选择任何城市、区域或板块!")
return;
}
if(!confirm("耗时任务,请慎重进行!!!你确定要重算吗?")){
return;
}
data.commands = commands ;
data.startDate = $("#startDate").val()
data.endDate = $("#endDate").val()
$.ajax({
url:"../rentPriceUpdate/reCompute",
dataType:"json",
cache:false,
type:'POST',
data:{data:JSON.stringify(data)},
success:function(data){
alert(data.msg)
window.location.reload();
}
});
});
});
listeners ={
addCityLevelListeners:function(){
$("[data-level='1'] span").click(function(){
var activeTr = $(this).parent().parent()
var ids = $(activeTr).attr("data-ids");
if($(this).hasClass("right_arrow")){
$(this).removeClass("right_arrow").addClass("down_arrow")
if($("tr[data-ids*='"+$(activeTr).attr("data-ids")+",']").length > 0){
$("tr[data-ids*='"+$(activeTr).attr("data-ids")+",']").show();
return;
}
$.ajax({
url:"../rentPriceUpdate/loadAvgPriceData",
dataType:"json",
cache:true,
data:{cityName:$(activeTr).attr("data-city")},
success:function(data){
$(data).each(function(){
$('<tr data-ids="'+ids+',' + this.id +'" data-region ="'+this.region+'" data-city="'+this.city+'" data-startDate="'+this.startDate+'" data-level="2"><td><span class="right_arrow" style="margin-left:30px;"></span><input type="checkbox"> '+this.region+'</td><td>'+this.avgPrice+'</td><td>'+this.startDate+'</td><td><a href="javascript:;" class="detailBtn">详细信息</a> <a href="javascript:;" class="districtBtn">查看小区</a></td></tr>').insertAfter(activeTr)
});
listeners.addRegionLevelListeners();
listeners.addItemListeners();
}
});
}else{
$(this).removeClass("down_arrow").addClass("right_arrow")
$("tr[data-ids*='"+$(activeTr).attr("data-ids")+",']").hide();
}
});
},
addRegionLevelListeners:function(){
$("[data-level='2'] span").click(function(){
var activeTr = $(this).parent().parent()
var ids = $(activeTr).attr("data-ids");
if($(this).hasClass("right_arrow")){
$(this).removeClass("right_arrow").addClass("down_arrow")
if($("tr[data-ids*='"+$(activeTr).attr("data-ids")+",']").length > 0){
$("tr[data-ids*='"+$(activeTr).attr("data-ids")+",']").show();
return;
}
$.ajax({
url:"../rentPriceUpdate/loadAvgPriceData",
dataType:"json",
cache:true,
data:{cityName:$(activeTr).attr("data-city"),region:$(activeTr).attr("data-region")},
success:function(data){
$(data).each(function(){
$('<tr data-ids="'+ids+","+this.id+'" data-level="3" data-city="'+this.city+'" data-region="'+this.region+'" data-block = "'+this.block+'" data-startDate="'+this.startDate+'"><td><span style="margin-left:90px;"></span><input type="checkbox"> '+this.block+'</td><td>'+this.avgPrice+'</td><td>'+this.startDate+'</td><td><a href="javascript:;" class="detailBtn">详细信息</a> <a href="javascript:;" class="districtBtn">查看小区</a></td></tr>').insertAfter(activeTr)
});
listeners.addItemListeners();
}
});
}else{
$(this).removeClass("down_arrow").addClass("right_arrow")
$("tr[data-ids*='"+$(activeTr).attr("data-ids")+",']").hide();
}
});
},
addItemListeners:function(){
$("input[type='checkbox']").unbind();
$(".detailBtn").unbind();
$(".districtBtn").unbind();
$("input[type='checkbox']").click(function(){
var activeTr = $(this).parent().parent();
if($(this).attr("checked")){
if($(activeTr).attr("data-level")==="1"){
$("#cities").text($("#cities").text()+activeTr.attr("data-city")+",")
}else if($(activeTr).attr("data-level")==="2"){
$("#regions").text($("#regions").text()+activeTr.attr("data-region")+",")
}else if($(activeTr).attr("data-level")==="3"){
$("#blocks").text($("#blocks").text()+activeTr.attr("data-block")+",")
}
}else{
if($(activeTr).attr("data-level")==="1"){
$("#cities").text($("#cities").text().replace(activeTr.attr("data-city")+",",""))
}else if($(activeTr).attr("data-level")==="2"){
$("#regions").text($("#regions").text().replace(activeTr.attr("data-region")+",",""))
}else if($(activeTr).attr("data-level")==="3"){
$("#blocks").text($("#blocks").text().replace(activeTr.attr("data-block")+",",""))
}
}});
$(".detailBtn").click(function(){
var activeTr = $(this).parent().parent();
var url = "../rentPriceUpdate/detail?cityDisplay="+$(activeTr).attr("data-city");
if($(activeTr).attr("data-region")!=undefined){
url =url + "&region=" + $(activeTr).attr("data-region")
}
if($(activeTr).attr("data-block")!=undefined){
url =url + "&block=" + $(activeTr).attr("data-block")
}
window.open(url,'_blank');
});
$(".districtBtn").click(function(){
var activeTr = $(this).parent().parent();
var url = "../rentPriceUpdate/districtList?cityDisplay="+$(activeTr).attr("data-city");
if($(activeTr).attr("data-region")!=undefined){
url =url + "&region=" + $(activeTr).attr("data-region")
}
if($(activeTr).attr("data-block")!=undefined){
url =url + "&block=" + $(activeTr).attr("data-block")
}
window.open(url,'_blank');
});
}
}
</script>
-->
</#compress>
@@ -0,0 +1,192 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>指导价数据</title>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="../style/main_simple.css" />
<link rel="stylesheet" type="text/css" href="../style/jnotify/jNotify.jquery.css?v=${version}" />
<style>
.row-fluid:before, .row-fluid:after {
display: none;
}
.thdiv {
background-image: linear-gradient(to bottom, #FFF, #CCC);
}
.pagination-page {
background: #fff url(../images/skin/shadow.jpg) bottom repeat-x;
border-bottom: 1px solid #ccc;
color: #666;
font-size: 12px;
overflow: hidden;
padding: 2px 3px;
text-align: right;
}
.pagination-page .page-num,.pagination-page .previous,.pagination-page .next
{
background: #fff;
border: 1px solid #ccc;
border-color: #ccc #aaa #aaa #ccc;
color: #666;
margin: 0 3px;
padding: 2px 6px;
}
.pagination-page .current-page {
padding: 2px 3px;
color: #666;
background: #fff;
font-weight: bold;
}
.main-content {
padding-bottom: 0;
}
.row-fluid .span2 {
width: 100%;
*width: 100%;
margin-top: 10px;
}
.sort-th:hover {
cursor: pointer;
}
</style>
</head>
<body>
<#include "/common_js.ftl" />
<#include "/layout/header.ftl" />
<#setting number_format="0.####">
<div class="main-content">
<div class="menuButton">
<a href="../rentPriceUpdate/guidingPrice?id=${district.id!}" class="list" target="_self">添加指导价</a>&nbsp;&nbsp;
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12" style="margin-left:0;">
<div id="thDiv" class="thdiv">
<table class="table table-bordered" style="margin-bottom:0;">
<thead>
<tr>
<th width="4%">城市</th>
<th width="4%">区域</th>
<th width="4%">小区名</th>
<th width="4%">日期</th>
<th width="4%">添加人</th>
<th width="4%">添加价格</th>
<th width="4%">操作</th>
</tr>
</thead>
</table>
</div>
<table class="table table-bordered table-striped table-hover" id="mainTab">
<tbody>
<#list guidingPrices! as guid>
<tr>
<td width="4%">${guid.city!''}</td>
<td width="4%">${guid.region!}</td>
<td width="4%">${guid.name!}</td>
<td width="4%">${guid.guidingDate?string("yyyy-MM-dd")}</td>
<td width="4%">${guid.guidingPerson!}</td>
<td width="4%">${guid.guidingValue!}</td>
<td width="4%">
<a target="_self" href="../rentPriceUpdate/guidingPrice?gid=${guid.id}&id=${district.id}">编辑</a>
<a href="javascript:void(null)" class="deleteData" data-id="${guid.id}">删除</a>
<button type="button" onclick="javascript:$('#myReCompModal').modal('show')" class="btn btn-danger" >重算均价</button>
</td>
</tr>
</#list>
</tbody>
</table>
</div>
</div>
<div id="myReCompModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">是否确定?</h3>
</div>
<div class="modal-body error">
<p>1.耗时较长,请谨慎操作!</p>
<p>2.计算<b>${district.name!}</b>的历史价格!</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true" aria-hidden="true">关闭</button>
<button class="btn btn-primary" name="reComputeBtn" type="all">重算历史</button>
<button class="btn btn-primary" name="reComputeBtn" type="week">最近一期</button>
<button class="btn btn-primary" name="reComputeBtn" type="month">最近一月</button>
<button class="btn btn-primary" name="reComputeBtn" type="quarter">最近季度</button>
<button class="btn btn-primary" name="reComputeBtn" type="year">最近一年</button>
</div>
</div>
<script type="text/javascript" src="../js/jquery-1.9.1.js?v=${version}"></script>
<script type="text/javascript" src="../js/city_select.js?v=${version}"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js?v=${version}"></script>
<script type="text/javascript" src="../js/jquery.form.js?v=${version}"></script>
<script type="text/javascript" src="../js/jNotify.jquery.min.js?v=${version}"></script>
<script type="text/javascript">
//删除操作
$(".deleteData").click(function(){
var obj = $(this).parent().parent();
var gid = $(this).attr("data-id");
jQuery.ajax({
type: 'POST',
url: '../rentPriceUpdate/deleteGuidingPriceNew',
data: {gid:gid},
dataType: 'json',
timeout: 100000,
success: function(model) {
obj.remove();
},
error : function() {
alert("删除失败!");
}
});
});
$("button[name='reComputeBtn']").click(function(){
var type = $(this).attr('type');
var data ={};
var commands = Array();
commands.push({city:'${district.city!}',region:'${district.region!}',name:'${district.name!}',estateType:'${district.estateType2!}'})
data.commands = commands ;
data.calcRange = type;
$.ajax({
url:"../rentPriceUpdate/reCompute",
dataType:"json",
type:'POST',
data:{data:JSON.stringify(data)},
success:function(data){
showSuccessMsg(data.msg)
$('#myReCompModal').modal('hide')
}
});
});
function showSuccessMsg(msg){
jNotify(
msg,
{
autoHide : true,
clickOverlay : false,
MinWidth : 250,
TimeShown : 2000,
ShowTimeEffect : 1000,
HideTimeEffect : 1000,
LongTrip :20,
HorizontalPosition : 'right',
VerticalPosition : 'top',
ShowOverlay : true,
ColorOverlay : '#000',
OpacityOverlay : 0.3,
onClosed : function(){
},
onCompleted : function(){
}
});
}
</script>
</body>
</html>
</#compress>
@@ -0,0 +1,111 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加指导价</title>
<link rel="stylesheet" type="text/css" href="../style/main.css?v=${version}" />
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<#include "/common_js.ftl" />
<#include "/layout/header.ftl" />
<div class="main-content">
<div id = "save">
<form id="lineForm" method = "post">
<table class = "saveTable">
<tr>
<td class = "t1">
城市
<td>
<input name="city" id="city" type="text" disabled="true" value="${district.city!}" />
</td>
</tr>
<tr>
<td class = "t1">
区域
<td>
<input name="region" id="region" type="text" disabled="true" value="${district.region!}" />
</td>
</tr>
<tr>
<td class = "t1">
小区名
<td>
<input name="name" id="name" type="text" disabled="true" value="${district.name!}" />
</td>
</tr>
<tr>
<td class = "t1">
日期<font color="red">*</font></td>
<td>
<input placeholder="指导日期" id="guidingDate" name="guidingDate" readonly="true" type="text" value="${guidingDate!}" class="input-small" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'%y-%M-{%d-7}'})">
</td>
</tr>
<tr>
<td class = "t1">
指导价格<font color="red">*</font></td>
<td>
<input placeholder="指导价格" name="guidingPrice" id="guidingPrice" type="number" value="${guidingPrice!}" />
</td>
</tr>
</table>
<table class = "saveTable">
<tr>
<td colspan="2" >
<input id="submitForm" type="button" value="确认添加" />
</td>
</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript" src="../js/kindeditor-4.0/kindeditor.js"></script>
<script type="text/javascript" src="../js/kindeditor-4.0/lang/zh_CN.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=3E63A744012f88c9a73a2f051aece58b"></script>
<script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&key=5fc2a1dec61fbd1df575a0967b87aa20"></script>
<script type="text/javascript">
dayStr=function(){ //获得本周的开端日期
var nowDate = new Date();
return nowDate.getDay();
}
$("#submitForm").click(function(){
var guidingDate = $("#guidingDate").val();
if (guidingDate == '' || guidingDate == undefined) {
alert('时间不能为空!');
return false;
}
var guidingPrice = $("#guidingPrice").val();
if (region == '') {
alert('指导价格不能为空!');
return false;
}
jQuery.ajax({
type: 'POST',
url: '../rentPriceUpdate/saveGuidingPrice',
data: {id:"${district.id}",guidingDate:guidingDate,guidingPrice:guidingPrice,gid:"${gid!}"},
dataType: 'json',
timeout: 100000,
success: function(model) {
window.location.href = "../rentPriceUpdate/guidingList?id=${district.id}";
},
error : function() {
alert("操作失败!");
}
});
})
</script>
</body>
</html>
</#compress>
@@ -0,0 +1,125 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>均价系统-${cityDisplay!}价格质量跟踪</title>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/main_simple.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/pagination.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/jnotify/jNotify.jquery.css?v=${version}" />
<#include "/common_js.ftl" />
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../js/jquery.pagination.js?v=${version}"></script>
<script type="text/javascript" src="../js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="../js/highcharts/exporting-3.0.7.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jNotify.jquery.min.js?v=${version}"></script>
<style>
.cur{
background-color:#eee;
}
label{display:inline-block}
.stab {
border: 1px solid #e0e0e0; padding: 8px 5px; cursor:pointer;border-left:none;
width: 130px;
float: left;
text-align: center;
}
.leg {
font-size: 14px;
text-align: center;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 4px;
}
.leg input{
margin-top: -2px;
}
</style>
</head>
<body>
<#setting number_format="0.###########"/>
<#include "/layout/header.ftl" />
<div class="main-content" style="padding:10px 10px;">
<table class="table table-bordered table-condensed">
<tr>
<th>查询条件</th>
</tr>
<tr>
<td>
<form action="listQR" style="padding-bottom: 10px;">
<div style="padding-top:5px;">
<@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" showCountry="1" name="cityDisplay"/>
</div>
<div style="padding-top: 1px;">
<label for="name">时间:</label>
<input id="startDate" class="form-control" style="width:100px;" name="sdateStart" value="${sdateStart!}" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'endDate\')||\'%y%M%d\'}',minDate:'20070101'})" />
&nbsp;-&nbsp;
<input id="endDate" class="form-control" style="width:100px;" name="sdateEnd" value="${sdateEnd!}" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'%y%M%d',minDate:'#F{$dp.$D(\'startDate\')||\'20070101\'}'})"/>
<input id="queryBtn" class ="btn btn-primary" type="submit" value="查询" />
</div>
<input type="hidden" name="stype" value="${stype!}">
</form>
</td>
</tr>
</table>
<div id="stabs">
<span class="stab <#if stype=="1">cur</#if>">
<a name="tab1" href="javascript:;" ref="listQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=1" class="list">小区量</a>
</span>
<span class="stab <#if stype=="2">cur</#if>">
<a name="tab2" href="javascript:;" ref="listQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=2" class="list">平均可信度</a>
</span>
<span class="stab <#if stype=="3">cur</#if>">
<a name="tab3" href="javascript:;" ref="listQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=3" class="list">测试案例数量</a>
</span>
<span class="stab <#if stype=="4">cur</#if>">
<a name="tab4" href="javascript:;" ref="listQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=4" class="list">案例差比<10%量</a>
</span>
<span class="stab <#if stype=="5">cur</#if>">
<a name="tab5" href="javascript:;" ref="listQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=5" class="list">案例差比<20%量</a>
</span>
<span class="stab <#if stype=="6">cur</#if>">
<a name="tab6" href="javascript:;" ref="listQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=6" class="list">案例差比<30%量</a>
</span>
<#--
<span <#if stype=="7">class="cur"</#if> style="border: 1px solid #e0e0e0; padding: 8px 10px; margin-top: 10px;cursor:pointer;border-left:none;">
<a name="tab7" href="listQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=7" class="list">房源样本量</a>
</span>
-->
</div>
<div id="fregment" style="margin-top: 10px"></div>
</div>
<script type="text/javascript">
function changeCity(cityDisplay) {
var currUrl = "listQR?cityDisplay=####&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=${stype!}&vts=${vts!}";
location.href = currUrl.replace("####", cityDisplay);
}
$("#stabs a").click(function(){
var ref = $(this).attr('ref')
var vts = [];
$("#chartLegend input").each(function(){
if ($(this).is(":checked")) {
vts.push($(this).val());
}
})
location.href = ref + "&vts=" + vts.join("-")
})
$(document).ready(function(){
$("#fregment").load("loadQRData?cityDisplay=${cityDisplay!}&stype=${stype!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd}&vts=${vts!}");
});
</script>
</body>
</html>
</#compress>
@@ -0,0 +1,110 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>均价系统-${cityDisplay!}样本质量跟踪</title>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/main_simple.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/pagination.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/jnotify/jNotify.jquery.css?v=${version}" />
<#include "/common_js.ftl" />
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../js/jquery.pagination.js?v=${version}"></script>
<script type="text/javascript" src="../js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="../js/highcharts/exporting-3.0.7.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jNotify.jquery.min.js?v=${version}"></script>
<style>
.cur{
background-color:#eee;
}
label{display:inline-block}
.stab {
border: 1px solid #e0e0e0; padding: 8px 5px; cursor:pointer;border-left:none;
width: 130px;
float: left;
text-align: center;
}
.leg {
font-size: 14px;
text-align: center;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 4px;
}
.leg input{
margin-top: -2px;
}
</style>
</head>
<body>
<#setting number_format="0.###########"/>
<#include "/layout/header.ftl" />
<div class="main-content" style="padding:10px 10px;">
<table class="table table-bordered table-condensed">
<tr>
<th>查询条件</th>
</tr>
<tr>
<td>
<form action="listSQR" style="padding-bottom: 10px;">
<div style="padding-top:5px;">
<@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" showCountry="1" name="cityDisplay"/>
</div>
<div style="padding-top: 1px;">
<label for="name">时间:</label>
<input id="startDate" class="form-control" style="width:100px;" name="sdateStart" value="${sdateStart!}" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'endDate\')||\'%y%M%d\'}',minDate:'20070101'})" />
&nbsp;-&nbsp;
<input id="endDate" class="form-control" style="width:100px;" name="sdateEnd" value="${sdateEnd!}" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'%y%M%d',minDate:'#F{$dp.$D(\'startDate\')||\'20070101\'}'})"/>
<input id="queryBtn" class ="btn btn-primary" type="submit" value="查询" />
</div>
<input type="hidden" name="stype" value="${stype!}">
</form>
</td>
</tr>
</table>
<div>
<span class="stab <#if stype=="1" || stype=="2" >cur</#if>">
一个月
<a name="tab1" href="listSQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=1" class="list" <#if stype?? && stype=="1">style="font-weight: bold;font-size: 16px;" </#if> >数量</a>
<a name="tab1" href="listSQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=2" class="list" <#if stype?? && stype=="2">style="font-weight: bold;font-size: 16px;"</#if>>比例</a>
</span>
<span class="stab <#if stype=="3" || stype=="4" >cur</#if>">
季度
<a name="tab1" href="listSQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=3" class="list" <#if stype?? && stype=="3">style="font-weight: bold;font-size: 16px;" </#if> >数量</a>
<a name="tab1" href="listSQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=4" class="list" <#if stype?? && stype=="4">style="font-weight: bold;font-size: 16px;" </#if> >比例</a>
</span>
<span class="stab <#if stype=="5" || stype=="6" >cur</#if>">
半年
<a name="tab1" href="listSQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=5" class="list" <#if stype?? && stype=="5">style="font-weight: bold;font-size: 16px;" </#if> >数量</a>
<a name="tab1" href="listSQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=6" class="list" <#if stype?? && stype=="6">style="font-weight: bold;font-size: 16px;" </#if> >比例</a>
</span>
<span class="stab <#if stype=="7" || stype=="8" >cur</#if>">
一年
<a name="tab1" href="listSQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=7" class="list" <#if stype?? && stype=="7">style="font-weight: bold;font-size: 16px;" </#if> >数量</a>
<a name="tab1" href="listSQR?cityDisplay=${cityDisplay!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=8" class="list" <#if stype?? && stype=="8">style="font-weight: bold;font-size: 16px;" </#if> >比例</a>
</span>
</div>
<div id="fregment" style="margin-top: 10px"></div>
</div>
<script type="text/javascript">
function changeCity(cityDisplay) {
var currUrl = "listSQR?cityDisplay=####&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd!}&stype=${stype!}&vts=${vts!}";
location.href = currUrl.replace("####", cityDisplay);
}
$(document).ready(function(){
$("#fregment").load("loadSQRData?cityDisplay=${cityDisplay!}&stype=${stype!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd}&vts=${vts!}");
});
</script>
</body>
</html>
</#compress>
@@ -0,0 +1,102 @@
<div id="container"></div>
<div id="chartLegend" class="leg" style="display: none;">
<input id="vt1" name="vts" value="1" type="checkbox"/><label for="vt1" style="color:#79434D;">全部</label>&nbsp;
<input id="vt4" name="vts" value="4" type="checkbox"/><label for="vt4" style="color:#3A696F;">自身样本</label>&nbsp;
<input id="vt7" name="vts" value="7" type="checkbox"/><label for="vt7" style="color:#DD9F19;">周边计算</label>&nbsp;
<input id="vt5" name="vts" value="5" type="checkbox"/><label for="vt5" style="color:#6BB7C5;">第三方</label>&nbsp;
<input id="vt6" name="vts" value="6" type="checkbox"/><label for="vt6" style="color:#729827;">成交数据</label>&nbsp;
<input id="vt3" name="vts" value="3" type="checkbox"/><label for="vt3" style="color:#C877C8;">指导价</label>&nbsp;
<input id="vt2" name="vts" value="2" type="checkbox"/><label for="vt2" style="color:#BBBD81;">无法计算</label>&nbsp;
<input id="vt8" name="vts" value="8" type="checkbox"/><label for="vt8" style="color:#CAB0A2;">推算</label>&nbsp;
</div>
<script type="text/javascript">
Highcharts.setOptions({
global: {
useUTC: false
}
});
$('#container').highcharts({
chart: {
type: 'line'
},
title: {
text: '${cityDisplay!}<#if stype=="1">小区量<#elseif stype=="2">平均可信度<#elseif stype=="3">测试案例数量<#elseif stype=="4">案例差比&lt;10%量<#elseif stype=="5">案例差比&lt;20%量<#elseif stype=="6">案例差比&lt;30%量<#elseif stype=="7">样本数量</#if>情况展示'
},
subtitle: {
text: '${t_util.formatDate(t_util.parseDate(sdateStart?string, 'yyyyMMdd'), 'yyyy年MM月dd日')} - ${t_util.formatDate(t_util.parseDate(sdateEnd?string, 'yyyyMMdd'), 'yyyy年MM月dd日')}'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%Y-%m-%d',
year: '%Y'
}
},
yAxis: {
title: {
text: '值'
},
min: 0
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br>'+ Highcharts.dateFormat('%Y-%m-%d', this.x) +' : '+ this.y;
}
},
legend : {
enabled : false
},
plotOptions: {
line: {
dataLabels: {
enabled: true,
formatter: function() {
return this.y;
}
},
enableMouseTracking: true
}
},
series: ${series!}
});
$("#chartLegend").show();
var vts = "${vts!}".split("-");
$.each(vts, function(i, vt){
$("#chartLegend input").each(function(){
if($(this).val() == vt) {
$(this).prop("checked", true);
$(this).next().css("font-weight", "bold");
}
})
})
$("#chartLegend input").change(function(){
var vts = [];
$("#chartLegend input").each(function(){
if ($(this).is(":checked")) {
vts.push($(this).val());
}
})
if(vts.length > 0) {
$("#fregment").load(
"loadQRData?cityDisplay=${cityDisplay!}&stype=${stype!}&sdateStart=${sdateStart!}&sdateEnd=${sdateEnd}&vts=" + vts.join("-"),
function(){
$("#chartLegend input").each(function(){
if ($(this).is(":checked")) {
$(this).next().css("font-weight", "bold");
}else {
$(this).next().css("font-weight", "");
}
})
}
);
}
})
</script>
@@ -0,0 +1,49 @@
<div id="container"></div>
<div id="chartLegend" class="leg" style="display: none;">
<input id="vt1" name="vts" value="1" type="checkbox"/><label for="vt1">一个月</label>&nbsp;
<input id="vt2" name="vts" value="2" type="checkbox"/><label for="vt2">季度</label>&nbsp;
<input id="vt3" name="vts" value="3" type="checkbox"/><label for="vt3">半年</label>&nbsp;
</div>
<script type="text/javascript">
Highcharts.setOptions({
global: {
useUTC: false
}
});
$('#container').highcharts({
chart: {
type: 'spline'
},
title: {
text: '${cityDisplay!}<#if stype=="1">数量(一个月)<#elseif stype=="2">比例(一个月)<#elseif stype=="3">数量(季度)<#elseif stype=="4">比例(季度)<#elseif stype=="5">数量(半年)<#elseif stype=="6">比例(半年)<#elseif stype=="7">数量(一年)<#elseif stype=="8">比例(一年)</#if>情况展示'
},
subtitle: {
text: '${t_util.formatDate(t_util.parseDate(sdateStart?string, 'yyyyMMdd'), 'yyyy年MM月dd日')} - ${t_util.formatDate(t_util.parseDate(sdateEnd?string, 'yyyyMMdd'), 'yyyy年MM月dd日')}'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%Y-%m-%d',
year: '%Y'
}
},
yAxis: {
title: {
text: '值'
},
min: 0
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br>'+ Highcharts.dateFormat('%Y-%m-%d', this.x) +' : '+ this.y;
}
},
// legend : {
// enabled : false
// },
series: ${series!}
});
</script>
@@ -0,0 +1,160 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>均价更新</title>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/main_simple.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/pagination.css?v=${version}" />
<link rel="stylesheet" type="text/css" href="../style/jnotify/jNotify.jquery.css?v=${version}" />
<#include "/common_js.ftl" />
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../js/jquery.pagination.js?v=${version}"></script>
<script type="text/javascript" src="../js/highcharts/highcharts-3.0.7.js"></script>
<script type="text/javascript" src="../js/highcharts/exporting-3.0.7.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jNotify.jquery.min.js?v=${version}"></script>
<style>
.con {
border-radius:0px;
}
label{display:inline-block}
.input-small{
margin:0px;
}
#city-border-mid{
margin-top:6px;
}
</style>
</head>
<body>
<#include "/layout/header.ftl" />
<div class="main-content" style="padding:10px 10px;">
<table class="table table-bordered">
<tr>
<th>查询条件</th>
</tr>
<tr>
<td>
<form action="taskList">
<@d_city defaultValue="${cityDisplay!}" callbackField="display" name="cityDisplay"/>
<label for="stype">任务类型:</label>
<select id="stype" name="stype" class="form-control" style="width:70px;">
<option value="" <#if (stype!'') == ''>selected="selected"</#if> >不限</option>
<option value="city" <#if (stype!'')=='city'>selected="selected"</#if>>城市</option>
<option value="region" <#if (stype!'')=='region'>selected="selected"</#if>>区域</option>
<option value="block" <#if (stype!'')=='block'>selected="selected"</#if>>板块</option>
<option value="district" <#if (stype!'')=='district'>selected="selected"</#if>>小区</option>
</select>
<label for="keyword">关键字:</label>
<input id="keyword" class="form-control" name="keyword" value="${keyword!}" style="width:100px;" />
<label for="startDate">开始时间:</label>
<#if startDate??>
<input id="startDate" class="form-control" style="width:100px;" name="startDate" value="${startDate!?string('yyyy-MM-dd')}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}',minDate:'2007-1-1'})" />
<#else>
<input id="startDate" class="form-control" style="width:100px;" name="startDate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}',minDate:'2007-1-1'})" />
</#if>
<label for="endDate">结束日期:</label>
<#if endDate??>
<input id="endDate" class="form-control" style="width:100px;" name="endDate" value="${endDate?string('yyyy-MM-dd')!}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'startDate\')||\'2007-1-1\'}'})"/>
<#else>
<input id="endDate" class="form-control" style="width:100px;" name="endDate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'startDate\')||\'2007-1-1\'}'})"/>
</#if>
<input id="queryBtn" class ="btn btn-primary" type="submit" value="查询" />
<a id="queryBtn" class ="btn btn-primary" href="../rentPriceUpdate/doCreatTask" >创建任务</a>
</form>
</td>
</tr>
</table>
<table id="dataSheet" class="table table-bordered table-hover">
<tr><th>城市</th><th>区域</th><th>板块</th><th>小区名</th><th>计算类型</th><th>计算时间</th><th>状态</th><th>优先级</th><th>物业类型</th><th>种类</th><th>创建时间</th><th>备注</th></tr>
<#list calcCommands as it>
<tr>
<td>${it.city!}</td><td>${it.region!}</td><td>${it.block!}</td><td>${it.name}</td>
<td>
<#if it.calcType ==0>指定日期<#elseif it.calcType ==1 >全部计算</#if>
</td>
<td>
<#if it.calcDate??>
${it.calcDate?string("yyyy-MM-dd")}</td>
</#if>
<td>
<#if it.status ==0>
<span class="label">初始状态</span>
<#elseif it.status == 1>
<span class="label label-info">正在处理</span>
<#elseif it.status == 2>
<span class="label label-success">处理完成</span>
<#elseif it.status == 3>
<span class="label label-important">处理异常</span>
</#if>
</td>
<td>
<#if it.priority ==0>
<span class="badge badge-success">0</span>
<#elseif it.priority == 1>
<span class="badge badge-warning">1</span>
<#elseif it.priority == 2>
<span class="badge badge-important">2</span>
</#if>
</td>
<td>${it.estateType!}</td>
<td>${it.category!}</td>
<td>${it.creationDate?string("yyyy-MM-dd HH:mm")}</td>
<td>${it.remark!}</td>
</tr>
</#list>
<tfoot>
<tr><td colspan="12">
<@d_pager action = "taskList" currentPage = pager.currentPage controller = "rentPriceUpdate" totalPages = pager.totalPages/>
</td></tr>
</tfoot>
</table>
</div>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">警告</h3>
</div>
<div class="modal-body error">
<p>耗时操作,请谨慎操作!</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true" aria-hidden="true">关闭</button>
<button class="btn btn-primary" id="reComputeBtn">计算</button>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function showSuccessMsg(msg){
jNotify(
msg,
{
autoHide : true,
clickOverlay : false,
MinWidth : 250,
TimeShown : 2000,
ShowTimeEffect : 1000,
HideTimeEffect : 1000,
LongTrip :20,
HorizontalPosition : 'right',
VerticalPosition : 'top',
ShowOverlay : true,
ColorOverlay : '#000',
OpacityOverlay : 0.3,
onClosed : function(){
},
onCompleted : function(){
}
});
}
$(function(){
});
</script>
</#compress>
@@ -72,7 +72,9 @@
</select>
<label for="districtName">名称:</label>
<input type="text" name="districtName" id="districtName" class="input-medium" style="margin-top:9px;" value="${districtName!}" ></input>
<label for="cat">类型:</label>
<label for="estateType">物业类型:</label>
<input type="text" name="estateType" id="estateType" class="input-medium" style="margin-top:9px;" value="${estateType!}" ></input>
<label for="cat">类型:</label>
<select id="cat" name="cat" class="form-control" style="width: 110px;">
<option value="">不限</option>
<option <#if cat! == 'sell'>selected</#if> value="sell">二手房</option>
@@ -98,13 +100,29 @@
<option <#if room?? && room==9>selected="true"</#if> value="9">9室</option>
</select>
</span>
<label for="districtName">网站:</label>
<label for="status">状态:</label>
<select id="status" name="status" class="form-control" style="width: 80px;">
<option value="">不限</option>
<option <#if status?? && status==0>selected="true"</#if> value="0">正常</option>
<option <#if status?? && status==1>selected="true"</#if> value="1">已删除</option>
</select>
<label for="rootName">网站:</label>
<input type="text" name="rootName" id="rootName" class="input-medium" style="margin-top:9px;" value="${rootName!}" ></input>
<label for="startDate">时间:</label>
<input id="startDate" placeholder="开始时间" class="form-control" style="width:70px;" name="startDate" value="${startDate!}" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}',minDate:'2007-1-1'})" />-
<input id="endDate" placeholder="结束时间" class="form-control" style="width:70px;" name="endDate" value="${endDate!}" onfocus="WdatePicker({dateFmt:'yyyyMMdd',maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'startDate\')||\'2007-1-1\'}'})"/>
<label for="area">面积:</label>
<input class="form-control" style="width:50px;" name="startArea" id="startArea" value="${startArea!}"/>-
<input class="form-control" style="width:50px;" name="endArea" id="endArea" value="${endArea!}"/>
<label for="area">单价:</label>
<input class="form-control" style="width:50px;" name="startPrice" id="startPrice" value="${startPrice!}"/>-
<input class="form-control" style="width:50px;" name="endPrice" id="endPrice" value="${endPrice!}"/>
<input id="queryBtn" class ="btn btn-primary" type="submit" value="查询" />
<input class ="btn btn-primary" id="batchDeleteByParam" value="条件删除" style="width: 75px;"/>
<input class ="btn btn-primary" id="batchUpdateEstateType" value="批量修改物业类型" style="width: 120px;"/>
</form>
</td>
</tr>
@@ -131,9 +149,9 @@
<th style="width:50px;">面积</th>
<th style="width:50px;">单价</th>
<th style="width:60px;">总价</th>
<th style="width:90px;"><#if sort?? && sort == 'p_date_desc'><a href="../seawater/houseList?cityDisplay=${cityDisplay!}&region=${region!}&districtName=${districtName!}&sort=p_date_asc&cat=${cat!}&&rootName=${rootName!}&startDate=${startDate!}&endDate=${endDate!}">发布时间</a>↓
<#elseif sort?? && sort == 'p_date_asc'><a href="../seawater/houseList?cityDisplay=${cityDisplay!}&region=${region!}&districtName=${districtName!}&sort=p_date_desc&cat=${cat!}&&rootName=${rootName!}&startDate=${startDate!}&endDate=${endDate!}">发布时间</a>↑
<#else><a href="../seawater/houseList?cityDisplay=${cityDisplay!}&region=${region!}&districtName=${districtName!}&sort=p_date_asc&cat=${cat!}&rootName=${rootName!}&startDate=${startDate!}&endDate=${endDate!}">发布时间</a>↓</#if>
<th style="width:90px;"><#if sort?? && sort == 'p_date_desc'><a href="../seawater/houseList?cityDisplay=${cityDisplay!}&region=${region!}&districtName=${districtName!}&sort=p_date_asc&cat=${cat!}&&rootName=${rootName!}&startDate=${startDate!}&endDate=${endDate!}&room=${room!}&status=${status!}&estateType=${estateType!}&startArea${startArea!}&endArea=${endArea!}&startPrice=${startPrice!}&endPrice=${endPrice!}">发布时间</a>↓
<#elseif sort?? && sort == 'p_date_asc'><a href="../seawater/houseList?cityDisplay=${cityDisplay!}&region=${region!}&districtName=${districtName!}&sort=p_date_desc&cat=${cat!}&&rootName=${rootName!}&startDate=${startDate!}&endDate=${endDate!}&room=${room!}&status=${status!}&estateType=${estateType!}&startArea${startArea!}&endArea=${endArea!}&startPrice=${startPrice!}&endPrice=${endPrice!}">发布时间</a>↑
<#else><a href="../seawater/houseList?cityDisplay=${cityDisplay!}&region=${region!}&districtName=${districtName!}&sort=p_date_asc&cat=${cat!}&rootName=${rootName!}&startDate=${startDate!}&endDate=${endDate!}&room=${room!}&status=${status!}&estateType=${estateType!}&startArea${startArea!}&endArea=${endArea!}&startPrice=${startPrice!}&endPrice=${endPrice!}">发布时间</a>↓</#if>
</th>
<th style="width:50px;">室厅卫</th>
<th style="width:50px;">楼层</th>
@@ -142,6 +160,7 @@
<th style="width:70px;">朝向</th>
<th style="width:70px;">物业类型</th>
<th style="width:90px;">来源</th>
<th style="width:90px;">状态</th>
<th style="width:80px;">操作</th>
</tr>
<#if seawaterList??>
@@ -173,7 +192,7 @@
</#if>
</td>
<td>${it.area!'&nbsp;'}</td>
<td>${(it.totalPrice / it.area)?string('#')}</td>
<td>${it.avgPrice!'&nbsp;'}</td>
<td>${it.totalPrice!'&nbsp;'}</td>
<td>${it.pDate!}</td>
<td>${it.room!'-'}/${it.hall!'-'}/${it.toilet!'-'}</td>
@@ -189,6 +208,13 @@
--
</#if>
</td>
<td>
<#if it.status == 0>
正常
<#else>
已删除
</#if>
</td>
<td>
<a href="javascript:;" class="hrefClick" <#if it.name??>detail-name="${it.name}"</#if> <#if it.address??>detail-address="${it.address!}"</#if><#if it.mobile??>detail-mobile="${it.mobile}"</#if><#if it.category??>detail-category="${it.category}"</#if>>详情</a>
<a href="javascript:;" name="todelete" detail-id="${it.id!}">删除</a>
@@ -219,7 +245,26 @@
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true" aria-hidden="true">关闭</button>
</div>
</div>
</div>
<div id="estateTypeModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">修改物业类型</h3>
</div>
<form class="form-horizontal" id="editEstateTypeForm">
<div class="control-group" style="margin-top: 20px;">
<label class="control-label" for="cityPop">物业类型</label>
<div class="controls">
<input type="text" id="editEstateType" name="editEstateType" value=""/>
</div>
</div>
</form>
<div class="modal-footer">
<button class="btn btn-primary" id="editSubmit">修改</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
</div>
</div>
</body>
<script type="text/javascript" src="../js/jquery.editable.js?v=${version}"></script>
@@ -385,6 +430,106 @@
}
});
$("#batchDeleteByParam").click(function(){
if(confirm('确认要删除当前查询条件下的所有数据吗?')) {
var cityDisplay = $("input[name='cityDisplay']").val()
var region = $("select[name='region']").val()
var districtName = $("input[name='districtName']").val()
var estateType = $("input[name='estateType']").val()
var cat = $("select[name='cat']").val()
var status = $("select[name='status']").val()
var rootName = $("input[name='rootName']").val()
var startDate = $("input[name='startDate']").val()
var endDate = $("input[name='endDate']").val()
var startArea = $("input[name='startArea']").val()
var endArea = $("input[name='endArea']").val()
var startPrice = $("input[name='startPrice']").val()
var endPrice = $("input[name='endPrice']").val()
if(cityDisplay == "" || region == "" || districtName == ""){
alert("城市、区域、小区名称必填")
return false;
}
var data = {"cityDisplay": cityDisplay, "region": region, "districtName": districtName,
"estateType": estateType, "cat": cat, "status": status,
"rootName": rootName, "startDate": startDate, "endDate": endDate,
"startArea": startArea, "endArea": endArea, "startPrice": startPrice,
"endPrice": endPrice}
jQuery.ajax({
type: 'POST',
url: '../seawater/batchDeleteByParams',
data: data,
dataType: 'json',
timeout: 100000,
success: function(model) {
alert("批量删除操作成功");
location.reload();
},
error : function() {
}
});
}
});
$("#batchUpdateEstateType").click(function(){
$('#estateTypeModal').modal('show');
});
$("#editSubmit").click(function(){
var editEstateType = $("input[name='editEstateType']").val()
if(editEstateType == ""){
alert("物业类型必填")
return false;
}
if(confirm('确认要修改当前查询条件下的物业类型吗?')) {
var cityDisplay = $("input[name='cityDisplay']").val()
var region = $("select[name='region']").val()
var districtName = $("input[name='districtName']").val()
var estateType = $("input[name='estateType']").val()
var cat = $("select[name='cat']").val()
var status = $("select[name='status']").val()
var rootName = $("input[name='rootName']").val()
var startDate = $("input[name='startDate']").val()
var endDate = $("input[name='endDate']").val()
var startArea = $("input[name='startArea']").val()
var endArea = $("input[name='endArea']").val()
var startPrice = $("input[name='startPrice']").val()
var endPrice = $("input[name='endPrice']").val()
if(cityDisplay == "" || region == "" || districtName == ""){
alert("城市、区域、小区名称必填")
return false;
}
console.log(startArea)
console.log(endArea)
console.log(startPrice)
console.log(endPrice)
console.log(estateType)
if(startArea == "" && endArea == "" && startPrice == "" && endPrice == "" && estateType == ""){
alert("面积,价格,物业类型必须至少一项有值")
return false;
}
var data = {"cityDisplay": cityDisplay, "region": region, "districtName": districtName,
"estateType": estateType, "cat": cat, "status": status,
"rootName": rootName, "startDate": startDate, "endDate": endDate,
"startArea": startArea, "endArea": endArea, "startPrice": startPrice,
"endPrice": endPrice, "editEstateType": editEstateType}
jQuery.ajax({
type: 'POST',
url: '../seawater/batchUpdateEstateType',
data: data,
dataType: 'json',
timeout: 100000,
success: function(model) {
alert("批量修改操作成功");
location.reload();
},
error : function() {
alert("批量修改操作失败");
location.reload();
}
});
$('#estateTypeModal').modal('hide');
}
});
</script>
</html>
</#compress>
+1 -1
View File
@@ -1,2 +1,2 @@
FROM 192.168.0.19:9012/tomcat6:latest
FROM 192.168.0.19:9012/tomcat6:220713
COPY target/*.war /home/goojia/webapps/ROOT.war
@@ -18,7 +18,7 @@
</ul>
</div>
</li>
<li class="<#if controllerName=='resource'>current</#if>"><a href="${wwwUrl}/resource" >最新资讯</a></li>
<li class="<#if controllerName=='resource'>current</#if>"><a href="${wwwUrl}/resource/" >最新资讯</a></li>
<li class="subnav03 <#if controllerName == 'industry' || (controllerName == 'solution' && actionName != 'apiDoc')>current</#if>">
<a>解决方案</a>
<div class="dn" style="width:340px;">
@@ -0,0 +1,242 @@
package com.fangjia.dal;
import org.sothis.core.util.Pager;
import java.util.List;
public class SeawaterQuery {
private String id;
private String cat;
private String region;
private String districtName;
private String cityDisplay;
private Integer room;
private String direction;
private String fitment;
private String sort;
private Boolean order;
private Integer StartDate;
private Integer endDate;
private String estateType;
private Double startArea;
private Double endArea;
private Integer startPrice;
private Integer endPrice;
private Integer status;
private String rootName;
private String sortField;
private List<String> regionAlias;
private List<String> districtAlias;
private String[] keys;
private String table;
private Pager pager;
private String editEstateType;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCat() {
return cat;
}
public void setCat(String cat) {
this.cat = cat;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public String getDistrictName() {
return districtName;
}
public void setDistrictName(String districtName) {
this.districtName = districtName;
}
public Integer getRoom() {
return room;
}
public void setRoom(Integer room) {
this.room = room;
}
public String getDirection() {
return direction;
}
public void setDirection(String direction) {
this.direction = direction;
}
public String getFitment() {
return fitment;
}
public void setFitment(String fitment) {
this.fitment = fitment;
}
public Boolean getOrder() {
return order;
}
public void setOrder(Boolean order) {
this.order = order;
}
public Integer getStartDate() {
return StartDate;
}
public void setStartDate(Integer startDate) {
StartDate = startDate;
}
public Integer getEndDate() {
return endDate;
}
public void setEndDate(Integer endDate) {
this.endDate = endDate;
}
public String getEstateType() {
return estateType;
}
public void setEstateType(String estateType) {
this.estateType = estateType;
}
public Integer getStartPrice() {
return startPrice;
}
public void setStartPrice(Integer startPrice) {
this.startPrice = startPrice;
}
public Integer getEndPrice() {
return endPrice;
}
public void setEndPrice(Integer endPrice) {
this.endPrice = endPrice;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getSortField() {
return sortField;
}
public void setSortField(String sortField) {
this.sortField = sortField;
}
public List<String> getRegionAlias() {
return regionAlias;
}
public void setRegionAlias(List<String> regionAlias) {
this.regionAlias = regionAlias;
}
public List<String> getDistrictAlias() {
return districtAlias;
}
public void setDistrictAlias(List<String> districtAlias) {
this.districtAlias = districtAlias;
}
public String[] getKeys() {
return keys;
}
public void setKeys(String[] keys) {
this.keys = keys;
}
public String getTable() {
return table;
}
public void setTable(String table) {
this.table = table;
}
public String getRootName() {
return rootName;
}
public void setRootName(String rootName) {
this.rootName = rootName;
}
public Double getStartArea() {
return startArea;
}
public void setStartArea(Double startArea) {
this.startArea = startArea;
}
public Double getEndArea() {
return endArea;
}
public void setEndArea(Double endArea) {
this.endArea = endArea;
}
public Pager getPager() {
return pager;
}
public void setPager(Pager pager) {
this.pager = pager;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public String getCityDisplay() {
return cityDisplay;
}
public void setCityDisplay(String cityDisplay) {
this.cityDisplay = cityDisplay;
}
public String getEditEstateType() {
return editEstateType;
}
public void setEditEstateType(String editEstateType) {
this.editEstateType = editEstateType;
}
}
@@ -102,6 +102,7 @@ public class PaiMai implements MongoEntity {
private String houseNum;
private String unitNum;
private String roomNum;
private String estateType;
@Id
@GeneratedValue
@@ -492,6 +493,7 @@ public class PaiMai implements MongoEntity {
this.matchEstateType = matchEstateType;
}
@Column(name = "houseNum")
public String getHouseNum() {
return houseNum;
}
@@ -500,6 +502,7 @@ public class PaiMai implements MongoEntity {
this.houseNum = houseNum;
}
@Column(name = "unitNum")
public String getUnitNum() {
return unitNum;
}
@@ -508,6 +511,7 @@ public class PaiMai implements MongoEntity {
this.unitNum = unitNum;
}
@Column(name = "roomNum")
public String getRoomNum() {
return roomNum;
}
@@ -515,4 +519,13 @@ public class PaiMai implements MongoEntity {
public void setRoomNum(String roomNum) {
this.roomNum = roomNum;
}
@Column(name = "estateType")
public String getEstateType() {
return estateType;
}
public void setEstateType(String estateType) {
this.estateType = estateType;
}
}
@@ -95,10 +95,10 @@ public class AverageStatistics implements MongoEntity {
private Double tuboshiEsfDiff;
/**中原地产二手房均价*/
private Integer centanetNewPrice;
private Double centanetNewDiff;
private Integer centanetEsfPrice;
private Double centanetEsfDiff;
private Integer zhongyuanNewPrice;
private Double zhongyuanNewDiff;
private Integer zhongyuanEsfPrice;
private Double zhongyuanEsfDiff;
@@ -155,9 +155,18 @@ public class AverageStatistics implements MongoEntity {
private Integer zhugezhaofangNewPrice;
private Double zhugezhaofangNewDiff;
/**吉屋*/
private Integer jiwuEsfPrice;
private Double jiwuEsfDiff;
private Integer jiwuNewPrice;
private Double jiwuNewDiff;
/**365*/
private Integer tsfhouseEsfPrice;
private Double tsfhouseEsfDiff;
private Integer tsfhouseNewPrice;
private Double tsfhouseNewDiff;
private String level;//价格评级
private Integer lastAvgPrice;//最终价
private String maxDeviate;//偏离度最大的网站,房价网-云估价-房估估
@@ -578,22 +587,22 @@ public class AverageStatistics implements MongoEntity {
this.fangguguNewPrice = fangguguNewPrice;
}
@Column(name = "centanet_new_price")
public Integer getCentanetNewPrice() {
return centanetNewPrice;
@Column(name = "zhongyuan_new_price")
public Integer getZhongyuanNewPrice() {
return zhongyuanNewPrice;
}
public void setCentanetNewPrice(Integer centanetNewPrice) {
this.centanetNewPrice = centanetNewPrice;
public void setZhongyuanNewPrice(Integer zhongyuanNewPrice) {
this.zhongyuanNewPrice = zhongyuanNewPrice;
}
@Column(name = "centanet_esf_price")
public Integer getCentanetEsfPrice() {
return centanetEsfPrice;
@Column(name = "zhongyuan_esf_price")
public Integer getZhongyuanEsfPrice() {
return zhongyuanEsfPrice;
}
public void setCentanetEsfPrice(Integer centanetEsfPrice) {
this.centanetEsfPrice = centanetEsfPrice;
public void setZhongyuanEsfPrice(Integer zhongyuanEsfPrice) {
this.zhongyuanEsfPrice = zhongyuanEsfPrice;
}
@Column(name = "lianjia_esf_price")
@@ -659,22 +668,22 @@ public class AverageStatistics implements MongoEntity {
this.tuboshiEsfDiff = tuboshiEsfDiff;
}
@Column(name = "centanet_new_diff")
public Double getCentanetNewDiff() {
return centanetNewDiff;
@Column(name = "zhongyuan_new_diff")
public Double getZhongyuanNewDiff() {
return zhongyuanNewDiff;
}
public void setCentanetNewDiff(Double centanetNewDiff) {
this.centanetNewDiff = centanetNewDiff;
public void setZhongyuanNewDiff(Double zhongyuanNewDiff) {
this.zhongyuanNewDiff = zhongyuanNewDiff;
}
@Column(name = "centanet_esf_diff")
public Double getCentanetEsfDiff() {
return centanetEsfDiff;
@Column(name = "zhongyuan_esf_diff")
public Double getZhongyuanEsfDiff() {
return zhongyuanEsfDiff;
}
public void setCentanetEsfDiff(Double centanetEsfDiff) {
this.centanetEsfDiff = centanetEsfDiff;
public void setZhongyuanEsfDiff(Double zhongyuanEsfDiff) {
this.zhongyuanEsfDiff = zhongyuanEsfDiff;
}
@Column(name = "master_district_name")
@@ -1074,19 +1083,76 @@ public class AverageStatistics implements MongoEntity {
public void setFangtanEsfDiff(Double fangtanEsfDiff) {
this.fangtanEsfDiff = fangtanEsfDiff;
}
@Column(name = "jiwu_esf_price")
public Integer getJiwuEsfPrice() {
return jiwuEsfPrice;
}
public void setJiwuEsfPrice(Integer jiwuEsfPrice) {
this.jiwuEsfPrice = jiwuEsfPrice;
}
@Column(name = "jiwu_esf_diff")
public Double getJiwuEsfDiff() {
return jiwuEsfDiff;
}
public void setJiwuEsfDiff(Double jiwuEsfDiff) {
this.jiwuEsfDiff = jiwuEsfDiff;
}
@Column(name = "jiwu_new_price")
public Integer getJiwuNewPrice() {
return jiwuNewPrice;
}
public void setJiwuNewPrice(Integer jiwuNewPrice) {
this.jiwuNewPrice = jiwuNewPrice;
}
@Column(name = "jiwu_new_diff")
public Double getJiwuNewDiff() {
return jiwuNewDiff;
}
public void setJiwuNewDiff(Double jiwuNewDiff) {
this.jiwuNewDiff = jiwuNewDiff;
}
@Column(name = "365house_esf_price")
public Integer getTsfhouseEsfPrice() {
return tsfhouseEsfPrice;
}
public void setTsfhouseEsfPrice(Integer tsfhouseEsfPrice) {
this.tsfhouseEsfPrice = tsfhouseEsfPrice;
}
@Column(name = "365house_esf_diff")
public Double getTsfhouseEsfDiff() {
return tsfhouseEsfDiff;
}
public void setTsfhouseEsfDiff(Double tsfhouseEsfDiff) {
this.tsfhouseEsfDiff = tsfhouseEsfDiff;
}
@Column(name = "365house_new_price")
public Integer getTsfhouseNewPrice() {
return tsfhouseNewPrice;
}
public void setTsfhouseNewPrice(Integer tsfhouseNewPrice) {
this.tsfhouseNewPrice = tsfhouseNewPrice;
}
@Column(name = "365house_new_diff")
public Double getTsfhouseNewDiff() {
return tsfhouseNewDiff;
}
public void setTsfhouseNewDiff(Double tsfhouseNewDiff) {
this.tsfhouseNewDiff = tsfhouseNewDiff;
}
}
@@ -22,18 +22,16 @@ public class SqmetreRent implements MongoEntity {
private String city;
private String region;
private String districtName;
private Double avgPrice;
private int markup;
private Integer avgPrice;
private Integer calcAvgPrice;
private Double markup;
private Date weekend;
private String cat;
private Date creationDate;
private Date modificationDate;
private String sampleEnum;
private double credit;
private String cluster;
private Double oldValue;
private String oldSampleEnum;
private Double credit;
private String valueType;
private Integer priceToRent;
@Id
@GeneratedValue
@@ -76,22 +74,47 @@ public class SqmetreRent implements MongoEntity {
}
@Column(name = "avg_price")
public Double getAvgPrice() {
public Integer getAvgPrice() {
return avgPrice;
}
public void setAvgPrice(Double avgPrice) {
public void setAvgPrice(Integer avgPrice) {
this.avgPrice = avgPrice;
}
@Column(name = "calc_avg_price")
public Integer getCalcAvgPrice() {
return calcAvgPrice;
}
public void setCalcAvgPrice(Integer calcAvgPrice) {
this.calcAvgPrice = calcAvgPrice;
}
@Column(name = "value_type")
public String getValueType() {
return valueType;
}
public void setValueType(String valueType) {
this.valueType = valueType;
}
@Column(name = "price_to_rent")
public Integer getPriceToRent() {
return priceToRent;
}
public void setPriceToRent(Integer priceToRent) {
this.priceToRent = priceToRent;
}
@Column(name = "markup")
public int getMarkup() {
public Double getMarkup() {
return markup;
}
public void setMarkup(int markup) {
public void setMarkup(Double markup) {
this.markup = markup;
}
@@ -123,52 +146,15 @@ public class SqmetreRent implements MongoEntity {
}
@Column(name = "sample_enum")
public String getSampleEnum() {
return sampleEnum;
}
public void setSampleEnum(String sampleEnum) {
this.sampleEnum = sampleEnum;
}
@Column(name = "credit")
public double getCredit() {
public Double getCredit() {
return credit;
}
public void setCredit(double credit) {
public void setCredit(Double credit) {
this.credit = credit;
}
@Column(name = "cluster")
public String getCluster() {
return cluster;
}
public void setCluster(String cluster) {
this.cluster = cluster;
}
@Column(name = "old_value")
public Double getOldValue() {
return oldValue;
}
public void setOldValue(Double oldValue) {
this.oldValue = oldValue;
}
@Column(name = "old_sample_enum")
public String getOldSampleEnum() {
return oldSampleEnum;
}
public void setOldSampleEnum(String oldSampleEnum) {
this.oldSampleEnum = oldSampleEnum;
}
@Column(name = "cat")
public String getCat() {
return cat;
@@ -0,0 +1,11 @@
package com.fangjia.dal.mongo.open.dao;
import com.fangjia.dal.MongoDao;
import com.fangjia.dal.mongo.open.model.EvaluateRatio;
/**
* @author shenjian
* @since 2022/7/27
*/
public interface EvaluateRatioDao extends MongoDao<EvaluateRatio> {
}
@@ -0,0 +1,13 @@
package com.fangjia.dal.mongo.open.dao.impl;
import com.fangjia.dal.MongoDaoImpl;
import com.fangjia.dal.mongo.open.dao.EvaluateRatioDao;
import com.fangjia.dal.mongo.open.model.EvaluateRatio;
/**
* @author shenjian
* @since 2022/7/27
*/
public class EvaluateRatioDaoImpl extends MongoDaoImpl<EvaluateRatio> implements EvaluateRatioDao {
}
@@ -0,0 +1,72 @@
package com.fangjia.dal.mongo.open.model;
import com.fangjia.dal.MongoEntity;
import javax.persistence.*;
/**
* ¹À¼ÛϵÊý
*
* @author shenjian
* @since 2022/7/27
*/
@Entity
@Table(name = "business.evaluate_ratio")
public class EvaluateRatio implements MongoEntity {
private static final long serialVersionUID = 5299813614465690722L;
private String id;
private String category;
private String city;
private String region;
private Double ratio;
@Id
@GeneratedValue
@Column(name = "_id", unique = true, nullable = false)
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
@Column(name = "category")
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
@Column(name = "city")
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
@Column(name = "region")
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
@Column(name = "ratio")
public Double getRatio() {
return ratio;
}
public void setRatio(Double ratio) {
this.ratio = ratio;
}
}
@@ -2,6 +2,7 @@ package com.fangjia.dal.seawater.dao;
import java.util.List;
import com.fangjia.dal.SeawaterQuery;
import com.fangjia.dal.seawater.model.Seawater;
/**
@@ -18,4 +19,12 @@ public interface SeawaterDao extends com.fangjia.dal.SeawaterDao<Seawater> {
Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root, String sort, boolean order, int start, int limit , String table);
List<Seawater> findHouses(String city, String region, List<String> alias, Integer minPrice, Integer maxPrice, Integer limit);
List<Seawater> findSeawatersByQuery(SeawaterQuery query);
long findSeawatersCountByQuery(SeawaterQuery query);
void batchDeleteByParams(SeawaterQuery query);
void batchUpdateEstateType(SeawaterQuery query);
}
@@ -2,6 +2,7 @@ package com.fangjia.dal.seawater.dao;
import java.util.*;
import com.fangjia.dal.SeawaterQuery;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.StringUtils;
@@ -11,6 +12,7 @@ import com.fangjia.dal.seawater.model.Seawater;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.sothis.core.util.Pager;
public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> implements SeawaterDao {
@@ -29,7 +31,14 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
@Override
public Seawater findByIdFromEs(String id,String table) {
Seawater seawater = null;
List<JSONObject> jsonList = queryList(id,null,null,null,null,null,null,null,null, null, null, null, null, null,null,null,false,-1,-1,table);
SeawaterQuery query = new SeawaterQuery();
query.setId(id);
query.setTable(table);
Pager pager = new Pager();
pager.setStartRow(-1);
pager.setPageSize(-1);
query.setPager(pager);
List<JSONObject> jsonList = queryList(query);
if(jsonList == null){
return null;
}else{
@@ -44,7 +53,28 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
@Override
public List<Seawater> findSeawatersFromEs(String category, String city, String region, String name, List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root, String sort, boolean order, int start, int limit, String table) {
List<Seawater> seawaterList= new ArrayList<Seawater>();
List<JSONObject> jsonList = queryList(null,category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,sort,order,start,limit,table);
SeawaterQuery query = new SeawaterQuery();
query.setCat(category);
query.setCityDisplay(city);
query.setRegion(region);
query.setDistrictName(name);
query.setDistrictAlias(alias);
query.setRegionAlias(regionAlias);
query.setStartDate(startDate);
query.setEndDate(endDate);
query.setStartArea(startArea);
query.setEndArea(endArea);
query.setStartPrice(startPrice);
query.setEndPrice(endPrice);
query.setRoom(room);
query.setRootName(root);
query.setOrder(order);
Pager pager = new Pager();
pager.setStartRow(start);
pager.setPageSize(limit);
query.setPager(pager);
query.setTable(table);
List<JSONObject> jsonList = queryList(query);
if(jsonList == null){
return null;
}else{
@@ -53,6 +83,23 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
return seawaterList;
}
@Override
public List<Seawater> findSeawatersByQuery(SeawaterQuery query){
List<Seawater> seawaterList;
List<JSONObject> jsonList = queryList(query);
if(jsonList == null){
return null;
}else{
seawaterList = wrapSeawater(jsonList);
}
return seawaterList;
}
@Override
public long findSeawatersCountByQuery(SeawaterQuery query) {
int count = queryCount(query);
return count;
}
@Override
public List<Seawater> findHouses(String city, String region, List<String> alias, Integer minPrice, Integer maxPrice, Integer limit) {
@@ -136,6 +183,42 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
}
}
@Override
public void batchDeleteByParams(SeawaterQuery query) {
HttpRequest request = new HttpRequest();
JSONObject reqBody = wrapQueryParams(query);
JSONObject script = new JSONObject();
script.put("source", "ctx._source.status=1");
script.put("lang", "painless");
reqBody.put("script", script);
try {
request.postWithBody("http://es.fangjia.com:9200/seawater/_update_by_query?conflicts=proceed&wait_for_completion=false", reqBody, this.buildHeader(), "UTF-8");
} catch (HttpRequestException e) {
e.printStackTrace();
}
}
@Override
public void batchUpdateEstateType(SeawaterQuery query) {
HttpRequest request = new HttpRequest();
JSONObject reqBody = wrapQueryParams(query);
JSONObject script = new JSONObject();
script.put("source", "ctx._source.estate_type="+"'"+query.getEditEstateType()+"'");
script.put("lang", "painless");
reqBody.put("script", script);
try {
request.postWithBody("http://es.fangjia.com:9200/seawater/_update_by_query?conflicts=proceed&wait_for_completion=false", reqBody, this.buildHeader(), "UTF-8");
} catch (HttpRequestException e) {
e.printStackTrace();
}
}
private JSONObject addMatch(String name, String value){
JSONObject term = new JSONObject();
JSONObject match = new JSONObject();
@@ -234,6 +317,11 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
}catch(Exception e){
seawater.setHall(0);
}
try{
seawater.setToilet(source.getInt("toilet"));
}catch(Exception e){
seawater.setToilet(0);
}
try{
seawater.setpDate(source.getInt("p_date"));
}catch(Exception e){
@@ -256,6 +344,9 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
if(source.containsKey("build_type")){
seawater.setBuildType(source.getString("build_type"));
}
if(source.containsKey("status")){
seawater.setStatus(source.getInt("status"));
}
seawaterList.add(seawater);
}
return seawaterList;
@@ -431,29 +522,381 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
}
return null;
}
private List<JSONObject> queryList(String id,String category, String city, String region, String name, List<String> alias,
List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root,String sort, boolean order, int start, int limit,String table){
JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,sort,order,start,limit,table);
private JSONObject query(SeawaterQuery query){
long time1 = System.currentTimeMillis();
JSONObject reqBody = new JSONObject();
JSONObject q = new JSONObject();
JSONObject queryJson = new JSONObject();
List<JSONObject> jsonList = new ArrayList<JSONObject>();
if(StringUtils.isNotBlank(query.getId())) {
JSONObject param = new JSONObject();
param.put("_id", query.getId());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getCat())) {
JSONObject param = new JSONObject();
param.put("cat", query.getCat());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
Set<String> namesList = new LinkedHashSet<String>();
if(StringUtils.isNotBlank(query.getDistrictName())) {
namesList.add(query.getDistrictName());
}
if (query.getDistrictAlias() != null) {
namesList.addAll(query.getDistrictAlias());
}
if(namesList != null && namesList.size() > 0){
JSONObject param = new JSONObject();
param.put("district_name", namesList);
JSONObject temp = new JSONObject();
temp.put("terms", param);
jsonList.add(temp);
}
Set<String> regionsList = new LinkedHashSet<String>();
if(StringUtils.isNotBlank(query.getRegion())) {
regionsList.add(query.getRegion());
}
if (query.getRegionAlias() != null) {
regionsList.addAll(query.getRegionAlias());
}
if(regionsList != null && regionsList.size() > 0){
JSONObject param = new JSONObject();
param.put("region", regionsList);
JSONObject temp = new JSONObject();
temp.put("terms", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getCityDisplay())){
JSONObject param = new JSONObject();
param.put("city", query.getCityDisplay());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getEstateType())) {
JSONObject param = new JSONObject();
param.put("estate_type", query.getEstateType());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(query.getRoom() != null) {
JSONObject param = new JSONObject();
param.put("room", query.getRoom());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getRootName())) {
JSONObject param = new JSONObject();
param.put("root", query.getRootName());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(query.getStartDate() != null || query.getEndDate() != null){
JSONObject param = new JSONObject();
JSONObject temp = new JSONObject();
JSONObject temp2 = new JSONObject();
if(query.getStartDate() != null){
temp2.put("gte", query.getStartDate());
}
if(query.getEndDate() != null){
temp2.put("lte", query.getEndDate());
}
param.put("p_date", temp2);
temp.put("range", param);
jsonList.add(temp);
}
if(query.getStartArea() != null || query.getEndArea() != null){
JSONObject param = new JSONObject();
JSONObject temp = new JSONObject();
JSONObject temp2 = new JSONObject();
if(query.getStartArea() != null){
temp2.put("gte", query.getStartArea());
}
if(query.getEndArea() != null){
temp2.put("lte", query.getEndArea());
}
param.put("area", temp2);
temp.put("range", param);
jsonList.add(temp);
}
if(query.getStartPrice() != null || query.getEndPrice() != null){
JSONObject param = new JSONObject();
JSONObject temp = new JSONObject();
JSONObject temp2 = new JSONObject();
if(query.getStartPrice() != null){
temp2.put("gte", query.getStartPrice());
}
if(query.getEndPrice() != null){
temp2.put("lte", query.getEndPrice());
}
param.put("avg_price", temp2);
temp.put("range", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getSortField())){
JSONObject jsonOrder = new JSONObject();
if(query.getOrder()){
jsonOrder.put("order", "asc");
}else{
jsonOrder.put("order", "desc");
}
JSONObject jsonSort = new JSONObject();
jsonSort.put(query.getSortField(), jsonOrder);
List<JSONObject> sortJsonList = new ArrayList<JSONObject>();
sortJsonList.add(jsonSort);
reqBody.put("sort", sortJsonList);
}
if(query.getPager().getStartRow() >= 0){
reqBody.put("from", query.getPager().getStartRow());
}
if(query.getPager().getPageSize() >= 0){
reqBody.put("size", query.getPager().getPageSize());
}
if(query.getStatus() != null){
JSONObject param = new JSONObject();
param.put("status", query.getStatus());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
queryJson.put("must", jsonList);
q.put("bool", queryJson);
reqBody.put("query", q);
//用户名:密码
Base64 token = new Base64();
String authenticationEncoding = token.encodeAsString(new String(""+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://es.fangjia.com:9200/"+query.getTable()+"/_search?rest_total_hits_as_int=true", reqBody, headers, "UTF-8");
JSONObject json = JSONObject.fromObject(response);
long time2 = System.currentTimeMillis();
System.out.println(time2-time1);
return json;
} catch (HttpRequestException e) {
e.printStackTrace();
}
return null;
}
// private List<JSONObject> queryList(String id,String category, String city, String region, String name, List<String> alias,
// List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root,String sort, boolean order, int start, int limit,String table){
// JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,sort,order,start,limit,table);
// if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("hits")){
// return null;
// }
// 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;
// }
private List<JSONObject> queryList(SeawaterQuery query){
JSONObject json = query(query);
if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("hits")){
return null;
}
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;
return null;
}
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;
}
private int queryCount(String id,String category, String city, String region, String name, List<String> alias,
List<String> regionAlias, Integer startDate, Integer endDate, Integer room, String root,String sort, boolean order, int start, int limit,String table){
JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate,null, null, null, null, room,root,sort,order,start,limit,table);
SeawaterQuery query = new SeawaterQuery();
query.setCat(category);
query.setCityDisplay(city);
query.setRegion(region);
query.setDistrictName(name);
query.setDistrictAlias(alias);
query.setRegionAlias(regionAlias);
query.setStartDate(startDate);
query.setEndDate(endDate);
query.setRoom(room);
query.setRootName(root);
query.setOrder(order);
Pager pager = new Pager();
pager.setStartRow(start);
pager.setPageSize(limit);
query.setPager(pager);
query.setTable(table);
JSONObject json = query(query);
if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("total")){
return 0;
}
return json.getJSONObject("hits").getInt("total");
}
private int queryCount(SeawaterQuery query){
JSONObject json = query(query);
if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("total")){
return 0;
}
return json.getJSONObject("hits").getInt("total");
}
private JSONObject wrapQueryParams(SeawaterQuery query){
JSONObject reqBody = new JSONObject();
JSONObject q = new JSONObject();
JSONObject queryJson = new JSONObject();
List<JSONObject> jsonList = new ArrayList<JSONObject>();
if(StringUtils.isNotBlank(query.getId())) {
JSONObject param = new JSONObject();
param.put("_id", query.getId());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getCat())) {
JSONObject param = new JSONObject();
param.put("cat", query.getCat());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
Set<String> namesList = new LinkedHashSet<String>();
if(StringUtils.isNotBlank(query.getDistrictName())) {
namesList.add(query.getDistrictName());
}
if(namesList != null && namesList.size() > 0){
JSONObject param = new JSONObject();
param.put("district_name", namesList);
JSONObject temp = new JSONObject();
temp.put("terms", param);
jsonList.add(temp);
}
Set<String> regionsList = new LinkedHashSet<String>();
if(StringUtils.isNotBlank(query.getRegion())) {
regionsList.add(query.getRegion());
}
if (query.getRegionAlias() != null) {
regionsList.addAll(query.getRegionAlias());
}
if(regionsList != null && regionsList.size() > 0){
JSONObject param = new JSONObject();
param.put("region", regionsList);
JSONObject temp = new JSONObject();
temp.put("terms", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getCityDisplay())){
JSONObject param = new JSONObject();
param.put("city", query.getCityDisplay());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getEstateType())) {
JSONObject param = new JSONObject();
param.put("estate_type", query.getEstateType());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(query.getRoom() != null) {
JSONObject param = new JSONObject();
param.put("room", query.getRoom());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(StringUtils.isNotBlank(query.getRootName())) {
JSONObject param = new JSONObject();
param.put("root", query.getRootName());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
if(query.getStartDate() != null || query.getEndDate() != null){
JSONObject param = new JSONObject();
JSONObject temp = new JSONObject();
JSONObject temp2 = new JSONObject();
if(query.getStartDate() != null){
temp2.put("gte", query.getStartDate());
}
if(query.getEndDate() != null){
temp2.put("lte", query.getEndDate());
}
param.put("p_date", temp2);
temp.put("range", param);
jsonList.add(temp);
}
if(query.getStartArea() != null || query.getEndArea() != null){
JSONObject param = new JSONObject();
JSONObject temp = new JSONObject();
JSONObject temp2 = new JSONObject();
if(query.getStartArea() != null){
temp2.put("gte", query.getStartArea());
}
if(query.getEndArea() != null){
temp2.put("lte", query.getEndArea());
}
param.put("area", temp2);
temp.put("range", param);
jsonList.add(temp);
}
if(query.getStartPrice() != null || query.getEndPrice() != null){
JSONObject param = new JSONObject();
JSONObject temp = new JSONObject();
JSONObject temp2 = new JSONObject();
if(query.getStartPrice() != null){
temp2.put("gte", query.getStartPrice());
}
if(query.getEndPrice() != null){
temp2.put("lte", query.getEndPrice());
}
param.put("avg_price", temp2);
temp.put("range", param);
jsonList.add(temp);
}
if(query.getStatus() != null){
JSONObject param = new JSONObject();
param.put("status", query.getStatus());
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
}
queryJson.put("must", jsonList);
q.put("bool", queryJson);
reqBody.put("query", q);
return reqBody;
}
}
@@ -131,7 +131,7 @@ public class SolrServerImpl implements SolrServer
private void addToSolr0(final HttpSolrServer solrServer, final List<SolrInputDocument> documents, int errorCount) {
try {
if (null != documents && !documents.isEmpty()) {
solrServer.add((Collection)documents);
solrServer.add(documents);
solrServer.commit();
}
}
@@ -226,7 +226,7 @@ public class SolrServerImpl implements SolrServer
if (doc.get("$boosts") != null && doc.get("$boosts") instanceof Map) {
boostsMap = (Map<String, Float>)doc.get("$boosts");
if (boostsMap.containsKey("$doc_boost")) {
document.setDocumentBoost(boostsMap.get("$doc_boost").floatValue());
document.setDocumentBoost(((Number) boostsMap.get("$doc_boost")).floatValue());
}
}
for (final Index index : indexes) {
@@ -235,10 +235,10 @@ public class SolrServerImpl implements SolrServer
final Object value = doc.get(key);
final SolrInputField field = new SolrInputField(key);
if (value instanceof ObjectId) {
field.setValue((Object)value.toString(), 1.0f);
field.setValue(value.toString(), 1.0f);
}
else if (boostsMap != null && boostsMap.containsKey(key)) {
field.setValue(value, boostsMap.get(key).floatValue());
field.setValue(value, ((Number) boostsMap.get(key)).floatValue());
}
else {
field.setValue(value, 1.0f);
@@ -32,7 +32,7 @@ public class AuctionController {
private PaiMaiService paiMaiService;
private DistrictNewPriceService districtNewPriceService;
private static final String[] SEARCH_FIELDS = new String[]{"marketAvgPrice", "startDate", "curPrice", "imgUrls", "id", "matchCity", "matchRegion", "matchName", "address", "marketTotalPrice", "startPrice", "curPrice", "predictPrice", "depositPrice", "area", "status", "url",
"matchEstateType","type","count", "tradeAvgPrice", "evaluationPrice"};
"matchEstateType","type","count", "tradeAvgPrice", "evaluationPrice","houseNum","roomNum","unitNum","estateType"};
public Object housesAction(AuctionModel model){
RestfulModelAndView mav = new RestfulModelAndView();
@@ -233,8 +233,8 @@ public class DealPriceController {
Integer minPrice = null;
Integer maxPrice = null;
if(bo.getDistrictStat()!=null){
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.9);
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.1);
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
}
Date startDate = null;
Date endDate = null;
@@ -434,8 +434,8 @@ public class HouseController {
Integer minPrice = null;
Integer maxPrice = null;
if(bo.getDistrictStat()!=null){
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.9);
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.1);
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
}
List<String> names = new ArrayList<String>();
names.add(district.getName());
@@ -2259,11 +2259,11 @@ public class PdsController {
averageStatisticsMap.put("安居客", beforeAvgSta.getAnjukeEsfPrice());
}
}
if(averageStatistics.getCentanetEsfPrice()!=null){
averageStatisticsMap.put("中原",averageStatistics.getCentanetEsfPrice());
if(averageStatistics.getZhongyuanEsfPrice()!=null){
averageStatisticsMap.put("中原",averageStatistics.getZhongyuanEsfPrice());
}else{
if(beforeAvgSta!=null){
averageStatisticsMap.put("中原",beforeAvgSta.getCentanetEsfPrice());
averageStatisticsMap.put("中原",beforeAvgSta.getZhongyuanEsfPrice());
}
}
if(averageStatistics.getGanjiEsfPrice()!=null){
@@ -2284,7 +2284,7 @@ public class PdsController {
if(beforeAvgSta!=null){
averageStatisticsMap.put("房天下", beforeAvgSta.getSoufangEsfPrice());
averageStatisticsMap.put("安居客", beforeAvgSta.getAnjukeEsfPrice());
averageStatisticsMap.put("中原",beforeAvgSta.getCentanetEsfPrice());
averageStatisticsMap.put("中原",beforeAvgSta.getZhongyuanEsfPrice());
averageStatisticsMap.put("赶集",beforeAvgSta.getGanjiEsfPrice());
averageStatisticsMap.put("链家", beforeAvgSta.getLianjiaEsfPrice());
}
@@ -3092,7 +3092,8 @@ public class PdsController {
* 涨跌幅在城市排名
* @author yinjihuan
* @param dto
* @param key
* @param model
* @param districtAnalyData
*/
private void buildUpDownRangecityLevel(EvaluationBeforeLoanDto dto, CollateralEvaluationInfoModel model, DistrictAnalyData districtAnalyData) {
Double increaseRate = 0d;
@@ -1264,11 +1264,11 @@ public class PdsTotalScoreController {
averageStatisticsMap.put("安居客", beforeAvgSta.getAnjukeEsfPrice());
}
}
if(averageStatistics.getCentanetEsfPrice()!=null){
averageStatisticsMap.put("中原",averageStatistics.getCentanetEsfPrice());
if(averageStatistics.getZhongyuanEsfPrice()!=null){
averageStatisticsMap.put("中原",averageStatistics.getZhongyuanEsfPrice());
}else{
if(beforeAvgSta!=null){
averageStatisticsMap.put("中原",beforeAvgSta.getCentanetEsfPrice());
averageStatisticsMap.put("中原",beforeAvgSta.getZhongyuanEsfPrice());
}
}
if(averageStatistics.getGanjiEsfPrice()!=null){
@@ -1289,7 +1289,7 @@ public class PdsTotalScoreController {
if(beforeAvgSta!=null){
averageStatisticsMap.put("房天下", beforeAvgSta.getSoufangEsfPrice());
averageStatisticsMap.put("安居客", beforeAvgSta.getAnjukeEsfPrice());
averageStatisticsMap.put("中原",beforeAvgSta.getCentanetEsfPrice());
averageStatisticsMap.put("中原",beforeAvgSta.getZhongyuanEsfPrice());
averageStatisticsMap.put("赶集",beforeAvgSta.getGanjiEsfPrice());
averageStatisticsMap.put("链家", beforeAvgSta.getLianjiaEsfPrice());
}
@@ -2011,7 +2011,8 @@ public class PdsTotalScoreController {
* 涨跌幅在城市排名
* @author yinjihuan
* @param dto
* @param key
* @param model
* @param districtAnalyData
*/
private void buildUpDownRangecityLevel(EvaluationBeforeLoanDto dto, CollateralEvaluationInfoModel model, DistrictAnalyData districtAnalyData) {
Double increaseRate = 0d;
@@ -33,13 +33,13 @@ import com.fangjia.dal.*;
import com.fangjia.dal.mongo.model.*;
import com.fangjia.dal.mongo.open.model.CommunityBasePrice;
import com.fangjia.dal.mongo.open.model.CommunityPoi;
import com.fangjia.dal.mongo.open.model.EvaluateRatio;
import com.fangjia.dal.seawater.dao.SeawaterDao;
import com.fangjia.dal.seawater.model.Seawater;
import com.fangjia.open.dto.*;
import com.fangjia.service.district.*;
import com.fangjia.service.mongo.fangjia.*;
import com.fangjia.service.open.*;
import com.fangjia.service.open.impl.CommunityPoiServiceImpl;
import com.fangjia.service.util.DistrictScoreUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -193,6 +193,7 @@ public class PropertyController {
private DistrictRoomSqmetreRentService districtRoomSqmetreRentService;
private RentDealPriceService rentDealPriceService;
private EvaluateRatioService evaluateRatioService;
private static final int EVALUATE_SHOW_DETAIL = 1;
private static final Map<String, String> PROPERTY_TYPES = new HashMap<String, String>() {
@@ -1017,6 +1018,8 @@ public class PropertyController {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
this.adjustPriceByRatio(district, evaluation);
}
// 调整面积不同面积价格
@@ -1042,7 +1045,7 @@ public class PropertyController {
}
}
} catch (Exception ex) {
LOGGER.error("调整面积不同面积价格异常{}", ex.getMessage());
}
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0
@@ -1101,16 +1104,7 @@ public class PropertyController {
districtPriceMap.put("credit", evaluation.getCredit());
districtPriceMap.put("id", evaluation.getId());
}
ApiUserCfg cfg = apiUserCfgService.findByUserId(Long.valueOf(evaluation.getFromUserId()), ApiUserCfg.ApiUserCfgKey.PRICE_TYPE);
if(cfg != null &&cfg.getCfgValue() != null && StringUtils.equalsIgnoreCase("2B", cfg.getCfgValue().toString())){
if(evaluation != null && evaluation.getAvgPrice2b() != 0){
districtPriceMap.put("avgPrice", evaluation.getAvgPrice2b());
}
}
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
try{
if(StringUtils.isNotBlank(evaluation.getFromUserId()) && !evaluation.getFromUserId().equals("1007497")){
openApiLogService.saveLog(CommonUtils.convertToMap(model), districtPriceMap, evaluation, "/property/evaluate");
@@ -1128,6 +1122,41 @@ public class PropertyController {
}
}
/**
* 系数下调
*
* @param district
* @param evaluation
*/
private void adjustPriceByRatio(District district, Evaluation evaluation) {
try {
ApiUserCfg apiUserCfg_pt = apiUserCfgService.findByUserId(Long.valueOf(evaluation.getFromUserId()), ApiUserCfg.ApiUserCfgKey.PRICE_TYPE);
if (apiUserCfg_pt != null && apiUserCfg_pt.getCfgValue() != null) {
String priceType = apiUserCfg_pt.getCfgValue().toString();
// 评估价则系数调整
if (StringUtils.isNotBlank(priceType) && "evaluate".equals(priceType)) {
EvaluateRatio evaluateRatio = null;
if (StringUtils.isNotBlank(district.getRegion())) {
evaluateRatio = evaluateRatioService.findByCityAndRegion(district.getCity(), district.getRegion());
}
if (evaluateRatio == null) {
evaluateRatio = evaluateRatioService.findByCity(district.getCity());
}
if (evaluateRatio != null) {
// 系数添加
long totalPrice = evaluation.getBigTotalPrice();
totalPrice = (long) (totalPrice * (1 + evaluateRatio.getRatio()));
evaluation.setBigTotalPrice(totalPrice);
evaluation.setAvgPrice((int) (totalPrice / evaluation.getArea()));
}
}
}
} catch (Exception ex) {
LOGGER.error("系数下调异常{}", ex.getMessage());
}
}
static final Map<String, Double> CITY_CORRECTION_FACTOR = new HashMap<String, Double>();
static {
CITY_CORRECTION_FACTOR.put("上海", 0.02);
@@ -1216,6 +1245,9 @@ public class PropertyController {
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData());
return mav;
}
this.adjustPriceByRatio(district, evaluation);
// 调整面积不同面积价格
try {
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district));
@@ -1245,13 +1277,7 @@ public class PropertyController {
districtPriceMap.put("city", district.getCity());
districtPriceMap.put("district", district.getRegion());
districtPriceMap.put("name", district.getName());
long totalPrice = evaluation.getBigTotalPrice();
// È¡ÏûϵÊýϵ÷
// if(CITY_CORRECTION_FACTOR.containsKey(district.getCity())){
// totalPrice = (long)(totalPrice * (1 - CITY_CORRECTION_FACTOR.get(district.getCity())));
// evaluation.setBigTotalPrice(totalPrice);
// evaluation.setAvgPrice((int)(totalPrice/evaluation.getArea()));
// }
districtPriceMap.put("totalPrice", evaluation.getBigTotalPrice());
districtPriceMap.put("unitPrice", evaluation.getAvgPrice());
// 新增置信度
@@ -5757,6 +5783,10 @@ public class PropertyController {
this.rentDealPriceService = rentDealPriceService;
}
public void setEvaluateRatioService(EvaluateRatioService evaluateRatioService) {
this.evaluateRatioService = evaluateRatioService;
}
public void setCommunityPoiService(CommunityPoiService communityPoiService) {
this.communityPoiService = communityPoiService;
}
@@ -670,6 +670,7 @@ public class WeiXinEvaluationController {
model.setUserTrades(userTrade);
if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("ÉϺ£")){
System.out.println("渤海用户:"+fjtUser.getEmail());
Map<String, Object> retMap = getLoanInfo(district, evaluation.getHouseArea());
if(retMap!=null && retMap.size()>0){
model.setLoanInfoMap(retMap);
@@ -1245,6 +1246,9 @@ public class WeiXinEvaluationController {
}
}
Integer yearAge = getBuildYear(district.getFinishBuildingDate());
if(pbObj!=null){
System.out.println("渤海银行:"+district.getName() +" 年限:"+yearAge+" Level:"+pbObj.getLevel()+" 所属板块:"+pbObj.getName());
}
Map<String, Object> retsMap = new HashMap<String, Object>();
if(pbObj!=null && pbObj.getLevel()!=null && pbObj.getLevel()==1 && yearAge!=null && yearAge<=25 && area>=60){
retsMap.put("type", "A");
@@ -1262,6 +1266,7 @@ public class WeiXinEvaluationController {
retsMap.put("type", "D");
retsMap.put("loan_ratio", 5);
}
return retsMap;
}
@@ -0,0 +1,4 @@
{
"code": 400,
"msg": "Interface Not Found"
}
@@ -0,0 +1,4 @@
{
"code": 500,
"msg": "Server Inner Error"
}
@@ -90,4 +90,12 @@
<servlet-name>SafeCode</servlet-name>
<url-pattern>/randomCode</url-pattern>
</servlet-mapping>
<error-page>
<error-code>500</error-code>
<location>/500.json</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/404.json</location>
</error-page>
</web-app>
@@ -49,7 +49,8 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch {
void process(Object args) {
String cityParam = System.getProperty("city");
def cities = new ArrayList()
String calcDate = System.getProperty("calcDate");
def cities;
if(StringUtils.isNotBlank(cityParam)){
cities = new ArrayList()
for(String c in cityParam.split(",")){
@@ -59,7 +60,7 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch {
cities = ServerAreaMap.findAllCities()
}
println cities
Date weekend = getLastDayOfMonth()
Date weekend = getLastDayOfMonth(calcDate)
println weekend
int cityCount = 0
int regionCount = 0
@@ -68,31 +69,22 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch {
//开始时间
final Date startDate = new Date()
for (String city : cities) {
List<String> idList = getAllDistrictIds(city)
logInfo(city + ":" + idList.size())
List<BasicDBObject> districts = getAllDistricts(city)
logInfo(city + ":" + districts.size())
def buffer = []
//生成计算小区队列
for (String id : idList) {
DBObject fields = new BasicDBObject()
fields.put("city", 1)
fields.put("region", 1)
fields.put("name", 1)
fields.put("estate_type2", 1)
DBObject district = SEAWEED_COLL.findOne(new BasicDBObject("_id", new ObjectId(id)), fields)
if (district != null) {
String region = district.get('region')
String name = district.get('name')
String estateType = district.get('estate_type2')
districtCount++
String ip = WORKER_MACHINE_IPS[districtCount % WORKER_MACHINE_IPS.size()]
BasicDBObject cmd = saveDistrictCalcCommand(city, region, name, estateType, weekend, ip)
logInfo("district:" + city + "-" + region + "-" + name + "-" + estateType + ",weekend:" + DateUtil.formatToYYYYMMDD(weekend) + "\t" + DateUtil.formatToTightYYYYMMDDhhmmss(new Date()))
buffer << cmd
if(buffer.size() == 1000){
COMMAND_COLL.insert(buffer)
buffer.clear()
}
for (BasicDBObject district : districts) {
String region = district.get('region')
String name = district.get('name')
String estateType = district.get('estate_type2')
districtCount++
String ip = WORKER_MACHINE_IPS[districtCount % WORKER_MACHINE_IPS.size()]
BasicDBObject cmd = saveDistrictCalcCommand(city, region, name, estateType, weekend, ip)
logInfo("district:" + city + "-" + region + "-" + name + "-" + estateType + ",weekend:" + DateUtil.formatToYYYYMMDD(weekend) + "\t" + DateUtil.formatToTightYYYYMMDDhhmmss(new Date()))
buffer << cmd
if(buffer.size() == 1000){
COMMAND_COLL.insert(buffer)
buffer.clear()
}
}
if(!buffer.isEmpty()){
@@ -158,7 +150,7 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch {
query.append("weekend", weekend)
query.append("cat", "block")
blockCount = SQMETRE_RENT_COLL.count(query)
def msg = "本月小区平米租金计算量:" + districtCount + ";本月城市平米租金计算量:" + cityCount + ";本月区域平米租金计算量:" + regionCount + ";本月版块平米租金计算量:" + blockCount + ";运行时间:" + secondToTime(time) + "."
def msg = "本月(${weekend.format("yyyyMM")})小区平米租金计算量:".toString() + districtCount + ";本月城市平米租金计算量:" + cityCount + ";本月区域平米租金计算量:" + regionCount + ";本月版块平米租金计算量:" + blockCount + ";运行时间:" + secondToTime(time) + "."
sendDingDingMsg(TOKEN, msg)
}
/**
@@ -219,31 +211,34 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch {
}
private List<String> getAllDistrictIds(String city) {
DBObject q = new BasicDBObject()
q.put("city", city)
q.put("cat", "district")
q.put("visible", 0)
private List<BasicDBObject> getAllDistricts(String city) {
DBObject query = new BasicDBObject()
query.put("city", city)
query.put("cat", "district")
query.put("visible", 0)
int trytimes = 5
Set<String> uniqueIdList = new LinkedHashSet<String>()
DBObject fields = new BasicDBObject()
fields.put("city", 1)
fields.put("region", 1)
fields.put("name", 1)
fields.put("estate_type2", 1)
fields.put("_id", 1)
for(int i=0; i<trytimes; i++) {
DSCursor cur = SEAWEED_COLL.find(q, new BasicDBObject("_id", 1)).batchSize(2000)
int tryTimes = 5
List<BasicDBObject> districts = new ArrayList<BasicDBObject>()
for(int i=0; i < tryTimes; i++) {
DSCursor cur = SEAWEED_COLL.find(query, fields).batchSize(5000)
int totalCount = cur.count()
Iterator<DBObject> iter = cur.iterator()
while(iter.hasNext()) {
DBObject dbo = iter.next()
String id = dbo.get('_id')
uniqueIdList.add(id)
BasicDBObject dbo = (BasicDBObject)iter.next()
districts.add(dbo)
}
if(uniqueIdList.size() == totalCount) {
if(districts.size() == totalCount) {
break
}
}
return new ArrayList<String>(uniqueIdList)
return districts
}
private List<DBObject> getRegions(String city) {
@@ -326,7 +321,13 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch {
}
private Date getLastDayOfMonth() {
private Date getLastDayOfMonth(String calcDateStr) {
if(StringUtils.isNotBlank(calcDateStr)){
Date calcDate = DateUtil.parseDate(calcDateStr, "yyyyMM")
if(calcDate != null){
return DateUtil.truncateDay(DateUtil.getLastDayOfMonth(calcDate, 0))
}
}
return DateUtil.truncateDay(DateUtil.getLastDayOfMonth(new Date(), -1));
}
@@ -29,9 +29,9 @@ public class ExportNearestAvgPrice {
static main(args) {
def citys = ["苏州"]//findAllCity();
def citys = ["重庆"]//findAllCity();
def task = new ExportNearestAvgPrice();
def weekends = task.findWeekends(34);//日期最近的X期
def weekends = task.findWeekends(12);//日期最近的X期
// task.exportAllCity(citys, weekends, "e:\\全国城市均价.csv");
task.exportRegion(citys, weekends, "D:\\数据\\区域均价.csv");
@@ -52,8 +52,8 @@ class BigdataDealBatch extends BaseBatch{
@Override
public void process(Object args) {
//def weekend = DateUtils.parseFromTightByPattern("2021-07-25","yyyy-MM-dd")//DateUtils.getFirstDayOfWeek(new Date())
def citys = CommonDatautils.findAllCity()//CcbCommonUtils.citys;
def ccbCitys = CcbCommonUtils.citys;
def citys = CcbCommonUtils.citys;
// def ccbCitys = CcbCommonUtils.citys;
for(def city : citys){
// if(!ccbCitys.contains(city)){
@@ -507,7 +507,7 @@ class BigdataDealBatch extends BaseBatch{
def q = new BasicDBObject()
q.put("contractTime", new BasicDBObject('$gte', startDate).append('$lte', endDate));
q.put("area", new BasicDBObject('$gte', 20))
q.put("status", 0)
// q.put("status", 0)
def dbcursor = youda_esfhouse_coll.find(q).batchSize(2000)
def rets = []
@@ -569,10 +569,10 @@ class BigdataDealBatch extends BaseBatch{
def addDealPriceMatch(city){
// def startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
// def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
def startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern("20220101", "yyyyMMdd"))
def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20220601", "yyyyMMdd"))
def startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
// def startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern("20210101", "yyyyMMdd"))
// def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20220601", "yyyyMMdd"))
def trades = CcbCommonUtils.findTradesByMonth(city, startDate, endDate)
final CountDownLatch latch = new CountDownLatch(trades.size())
@@ -74,7 +74,7 @@ class BigdataForsaleBatch extends BaseBatch{
// def distIds = getDistrictIds(cityCodeDataMap.get(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"]);
exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20220518, 20220619);
exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20220718, 20220819);
// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20210801, 20210831);
//测试通过匹配接口配房源效果
// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20201201, 20211118)
@@ -450,7 +450,12 @@ class BigdataForsaleBatch extends BaseBatch{
DBObject seawater = new BasicDBObject(map)
if(estate_type2 && estate_type2=="普通住宅"){
if(seawater.estate_type&& seawater.estate_type.contains("ÉĚץ")){
if(seawater.estate_type && (seawater.estate_type.contains("ÉĚץ") || seawater.estate_type.contains("ÉĚŇľ") || seawater.estate_type.contains("ÉĚÎń"))){
println city +" "+name+" "+seawater._id.toString()+" "+seawater.estate_type
continue;
}
if(seawater.estate_type&& seawater.estate_type.contains("ąđĘű")){
println city +" "+name+" "+seawater._id.toString()+" "+seawater.estate_type
continue;
}
@@ -373,10 +373,10 @@ class DealPriceDataProcess {
def citys = CcbCommonUtils.citys
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
def publishTime = '2021-10-01'
def month = 202205
def month = 202206
def rows = []
for(def city : citys) {
def rets = findPeGteThirdParty(city, 202206)
def rets = findPeGteThirdParty(city, 202207)
def total = 0
println city +" "+rets.size()
for(def m : rets){
@@ -23,7 +23,8 @@ class ExportOracleData {
def run() {
// def curMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), 0, "yyyyMM"));
def lastMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
def new_dists = ["350604","350605","410307","410308","450181"]
def lastMonthStr = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -1, "yyyy-MM")
def new_dists = []
//²»»á±ä
exportEvaluationRateData()
exportBigdataPoiData()
@@ -38,8 +39,11 @@ class ExportOracleData {
exportCommunityBuileType()
exportThirdPartyPrice2(lastMonth, new_dists)
exportBigdataForsale("2022-05-19", new_dists)
exportBigdataDeal("2022-05-01", new_dists)
exportBigdataForsale(lastMonthStr +"-19", new_dists) //2022-07-19
exportBigdataDeal(lastMonthStr + "-01", new_dists) //2022-07-01
//第三方网站权重表
exportWebsiteRate();
//¼ÆËã½á¹ûÏà¹Ø
@@ -93,6 +97,37 @@ class ExportOracleData {
}
def exportWebsiteRate(){
def sql = "select DATA_SOURCE_ID,DATA_SOURCE,DATA_SOURCE_MAP,WEIGHT,TYPE,SOURCECODE,CITYID,CITYNAME,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME from WEBSITE_CONFIG_GJ";
def allRows = []
sqlInstance.eachRow(sql, { r ->
def data = []
data << r.DATA_SOURCE_ID
data << r.DATA_SOURCE
data << r.DATA_SOURCE_MAP
data << r.WEIGHT
data << r.TYPE
data << r.SOURCECODE
data << r.CITYID
data << r.CITYNAME
data << r.CREATETIME
data << r.UPDATETIME
allRows << data
});
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28";
def fileName = "/ccb/MODEL_000000_000000_WEBSITE_CONFIG_GJ_ALL_${curDate}_0001.dat"
if (CommonDatautils.isWindow()) {
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_WEBSITE_CONFIG_GJ_ALL_${curDate}_0001.dat"
}
def headers = []//["系数ID","系数类型","系数","排序","城市","备注","创建时间","更新时间","来源公司"]
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
println "数据文件输出完成......"
CcbFtpUtils.ftpUpload(null, fileName, curDate)
println "上传Ftp完成......"
}
def exportBigdataPoiData() {
def sql = "select CITYID, DISTID, ID, POI_NAME, TYPE, TYPE_CODE, LATITUDE, LONGITUDE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from bigdata_poi_gj";
def allRows = []
@@ -44,7 +44,7 @@ class GuiDingPriceBatch extends BaseBatch{
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
//添加自己库中的人工指导价
def prices = CcbCommonUtils.findPersonPrice(city, "2022-05-1", "2022-06-1")
def prices = CcbCommonUtils.findPersonPrice(city, "2022-07-22", "2022-08-21")
if(prices){
def distMap = getDistrictMap(city)
def rets = createCityDatas(cityCodeDatas, distCodeMap, distMap, prices)
@@ -24,7 +24,7 @@ class LoadGuide {
def run(){
// addName("D:\\数据\\建行\\房产估值\\人工指导价更新.xlsx")
addPersonGuided("D:\\数据\\建行\\房产估值\\人工指导价更新.xlsx")
addPersonGuided("D:\\数据\\建行\\房产估值\\指导价\\7月23日建行库第一批录入.xlsx")
// match("D:\\数据\\建行\\房产估值\\指导价\\西安指导价2-103.xlsx")
// saveDongGuangPrice("D:\\数据\\建行\\房产估值\\指导价\\东莞指导价218.xlsx")
@@ -54,13 +54,17 @@ class LoadGuide {
}
def addPersonGuided(filename){
ExcelUtils.modify(filename, { d ->
def city = d['B']
ExcelUtils.modify(filename, { r ->
def city = r['B']
if(city){
def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
createSql( d, cityCodeDatas, distCodeMap)
createSql( r, cityCodeDatas, distCodeMap)
// def dist = CommonDatautils.findDistrictById(r['A'])
// if(dist){
// r['I'] = dist.region
// }
}
})
@@ -70,23 +74,33 @@ class LoadGuide {
def id = new ObjectId()
def commid = d['A']
def cityId = cityCodeDatas.get(d['B'])
def sampleRegion = d['C'].replace("街道","").replace("镇","")
def distRegion = distCodeMap.get(sampleRegion)
def cityName = d['B']
def distName = d['C']
def commName = d['D']
def price = d['E'].toDouble().toInteger()
def dist = CommonDatautils.findDistrict(cityName, sampleRegion, commName, "district")
//def dist = CommonDatautils.findDistrict(cityName, sampleRegion, commName, "district")
def dist = CommonDatautils.findDistrictById(commid)
def index = 0
if(dist){
def createtime = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
def dealDate = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd")
def sampleRegion = dist.region
def distRegion = distCodeMap.get(sampleRegion)
if(distRegion){
def createtime = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
def dealDate = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd")
def sql = "insert into guided_price_gj(ID,COMMID,COMMNAME,CITYID,CITYNAME,DISTID,DISTNAME,DEALDATE,AVG_PRICE,GUIDING_PERSON,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES " +
"('${id.toString()}','${dist._id.toString()}', '${commName}','${cityId}','${cityName}','${distRegion.district_code}','${distName}',to_date('${dealDate}','yyyy-mm-dd'),${price},'房价网','',to_date('${createtime}','yyyy-mm-dd hh24:mi:ss'),to_date('${createtime}','yyyy-mm-dd hh24:mi:ss'),'FJW')"
index ++
println index+" "+sql
sqlInstance.executeUpdate(sql)
}else{
println "区域未标准化"
}
def sql = "insert into guided_price_gj(ID,COMMID,COMMNAME,CITYID,CITYNAME,DISTID,DISTNAME,DEALDATE,AVG_PRICE,GUIDING_PERSON,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES " +
"('${id.toString()}','${dist._id.toString()}', '${commName}','${cityId}','${cityName}','${distRegion.district_code}','${distName}',to_date('${dealDate}','yyyy-mm-dd'),${price},'房价网','',to_date('${createtime}','yyyy-mm-dd hh24:mi:ss'),to_date('${createtime}','yyyy-mm-dd hh24:mi:ss'),'FJW')"
println sql
sqlInstance.executeUpdate(sql)
}else{
println " 没查到 "+commName
}
@@ -45,9 +45,9 @@ DBCollection POLYLINECOLL = MongoUtils.getCollectionByAuth20190102("fangjia_craw
def offlineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.136:28017";
def DBCollection youda_esfhouse_coll = MongoUtils.getCollectionByName2("business", "res_esfdealprice", offlineUrl)
def url = "https://sh.anjuke.com"
def s = DataHandleUtils.findMatchPattern(name, "https://\\w+.anjuke.com")
println s
//def url = "https://sh.anjuke.com"
//def s = DataHandleUtils.findMatchPattern(name, "https://\\w+.anjuke.com")
//println s
//def districts = CommonDatautils.findAllFiledDistrict("district", "ÄÏÄþ")
//for(def d : districts){
@@ -326,28 +326,55 @@ def youdaDeal(youda_esfhouse_coll, def city, def region, def name, def area, def
//
//},0)
//ExcelUtils.modify("D:\\数据\\建行\\房产估值\\小区\\删除重复小区.xlsx",{d->
// if(d['A']){
//// def region = d['B']
//// def newRegion = RegionData.formatRegion(d['A'], region)
//// if(newRegion) {
//// def dist = CommonDatautils.findDistrict(d['A'], newRegion, d['C'], "district")
// def dist = CommonDatautils.findDistrictById(d['A'])
// if(dist){
// def udata = new BasicDBObject()
// udata.put("name_cat", 11)
// udata.put("status", 1)
// udata.put("m_date",new Date())
//
// def q = new BasicDBObject()
// q.put("_id", dist._id)
// DbUtils.seaweed.update(q, new BasicDBObject('$set', udata))
// }else{
// println d
// }
//// }
// }
//},0)
ExcelUtils.modify("D:\\数据\\建行\\二期\\重庆无效小区_3159.xlsx",{d->
if(d['A']){
// def region = d['B']
// def newRegion = RegionData.formatRegion(d['A'], region)
// if(newRegion) {
// def dist = CommonDatautils.findDistrict(d['A'], newRegion, d['C'], "district")
def dist = CommonDatautils.findDistrictById(d['A'])
if(dist){
def udata = new BasicDBObject()
udata.put("name_cat", 11)
udata.put("status", 1)
udata.put("m_date",new Date())
def q = new BasicDBObject()
q.put("_id", dist._id)
DbUtils.seaweed.update(q, new BasicDBObject('$set', udata))
}else{
println d
}
// }
}
},0)
ExcelUtils.modify("D:\\数据\\建行\\二期\\重庆无效小区_3159.xlsx",{d->
if(d['A']){
// def region = d['B']
// def newRegion = RegionData.formatRegion(d['A'], region)
// if(newRegion) {
// def dist = CommonDatautils.findDistrict(d['A'], newRegion, d['C'], "district")
def dist = CommonDatautils.findDistrictById(d['A'])
if(dist){
def udata = new BasicDBObject()
udata.put("name_cat", 11)
udata.put("status", 1)
udata.put("m_date",new Date())
def q = new BasicDBObject()
q.put("_id", dist._id)
DbUtils.seaweed.update(q, new BasicDBObject('$set', udata))
}else{
println d
}
// }
}
},0)
//def citys = CcbCommonUtils.citys
//def rets = []
@@ -22,9 +22,9 @@ import java.util.concurrent.ConcurrentHashMap
@BatchOwner(Watcher.GaoJuan)
class ThirdPartyPriceBatch extends BaseBatch {
def sDate= 202205//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
def startDate = 202203
def endDate = 202205
def sDate= 202207//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
def startDate = 202205
def endDate = 202207
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")
@@ -75,13 +75,13 @@ class TradeStatLog {
def run(){
def citys = CcbCommonUtils.citys;
def rets = []
rets << ["城市","3月总量","4月总量","5月总量","占比","贝壳","链家", "我爱我家","房天下","中原"]
rets << ["城市","5月总量","6月总量","7月总量","占比","贝壳","链家", "我爱我家","房天下","中原"]
def sources = ["贝壳找房","链家在线", "我爱我家","房天下","中原地产"]
//def startDate = "2021-05-01"
def startDate = "2022-03-01"
def date = "2022-04-01"
def endDate = "2022-05-01"
def newDate = "2022-06-01"
def startDate = "2022-05-01"
def date = "2022-06-01"
def endDate = "2022-07-01"
def newDate = "2022-08-01"
for(def city : citys){
def lastMonthCount = findTradesCount(city, null, DateUtils.parseFromTightByPattern(startDate,"yyyy-MM-dd"), DateUtils.parseFromTightByPattern(date,"yyyy-MM-dd"))
@@ -131,7 +131,7 @@ class TradeStatLog {
}
ExcelUtils.write("D:\\数据\\建行\\房产估值\\成交\\2022-05成交统计.xlsx", rets, "数据")
ExcelUtils.write("D:\\数据\\建行\\房产估值\\成交\\${newDate}成交统计.xlsx", rets, "数据")
println "表格生成完成"
}
@@ -0,0 +1,45 @@
package com.fangjia.script.ccbevaluation
import com.fangjia.script.util.DbUtils
import com.mongodb.BasicDBObject
import groovy.sql.Sql
class UpdateData {
static def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl",
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
static main(args) {
def task = new UpdateData();
task.run()
}
def run(){
def city = "¶«Ý¸"
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city","region", "name", "address","lat", "lng","all_area","build_area","virescence_percent","cubage_percent","car_site_count","finish_building_date","estate_type2","household_count","status","c_date","m_date","name_cat","quality"])
println city +" Ð¡ÇøÁ¿£º"+dists.size()
def commids = findOracleData(cityCodeDataMap.get(city))
println "oracle ÊýÁ¿£º"+commids.size()
def index = 0
for(def dist : dists){
if(!commids.contains(dist._id.toString()) && dist.quality){
index ++
def udata = new BasicDBObject()
udata.put("name_cat", 11)
DbUtils.seaweed.update(new BasicDBObject('_id',dist._id),new BasicDBObject('$set', udata))
}
}
println index
}
def findOracleData(cityid){
def sql = "select COMMID from bigdata_community_gj_test where cityId=${cityid} and status=0";
def commIds = []
sqlInstance.eachRow(sql,{r->
commIds << r.COMMID
});
return commIds
}
}
@@ -71,7 +71,7 @@ class BigdataCommunityGJRHBatch extends BaseBatch {
// }
// }
def distMap = CommonDatautils.findAllDistricMaptByCity(city, "district", ["address","build_structure","estate_type2","finish_building_date","alias","build_type","estate_charge","estate_type2"])
def distMap = CommonDatautils.findAllDistricMaptByCity(city, "district", ["address","build_structure","estate_type2","finish_building_date","alias","build_type","estate_charge"])
for(def dist : districts){
def obj = distMap.get(dist.commid)//CommonDatautils.findDistrictFieldById(dist.commid,["build_structure","estate_type2","finish_building_date","alias","build_type","estate_charge","estate_type2"])
@@ -0,0 +1,138 @@
package com.fangjia.script.chongqing
import com.fangjia.core.util.DateUtil
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.gj.district.FangjiaClientUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.OpenApiClient
class PocSampleTest {
static main(args) {
def task = new PocSampleTest()
task.run()
}
def run(){
// match("D:\\数据\\重庆农商行\\poc\\抽样_1000.xlsx")
// addPrice("D:\\数据\\重庆农商行\\poc\\抽样_1000.xlsx")
// addArroundPrice("D:\\数据\\重庆农商行\\poc\\抽样_1000.xlsx")
// addRentRate("D:\\数据\\重庆农商行\\poc\\抽样_1000.xlsx")
// matchResult("D:\\数据\\美团\\抽样_1000_结果.xlsx")
existsDist("D:\\数据\\美团\\抽样_1000_结果.xlsx")
}
def existsDist(path){
ExcelUtils.multiThreadingModify(path, { row ->
if(row['P']){
def dist = CommonDatautils.findDistrictById(row['P'])
if(!dist){
row['S'] = "不存在"
}
}
})
}
def matchResult(path){
def datas = ExcelUtils.read("D:\\数据\\美团\\美团金融小区测试list-所有数据-优化租金评级.xlsx", 0 ,1)
def map = [:]
for(def r : datas){
map.put(r['D'], r)
}
ExcelUtils.multiThreadingModify(path, { row ->
if(row['A']){
def d = map.get(row['A'])
if(d){
def obj = CommonDatautils.findDistrict(d['F'],d['G'],d['H'],"district")
if(obj){
row['P'] = obj._id.toString()
row['Q'] = d['H']
row['R'] = d['I']
}
}
}
})
}
def match(path){
ExcelUtils.multiThreadingModify(path, { row ->
if(!row['G'] && row['D']){
def city = row['D']
def region = row['E']
if(region && region=='NULL'){
region = row['F']
}
def address = row['C']
println "[match] city:"+city+" region:"+region+" address:"+address
def jsonObject = OpenApiClient.addressMatch(city, row['B'], null, true, region, null)
if(jsonObject != null && jsonObject.precise!=-1) {
row['H'] = jsonObject.get("name")
row['G'] = jsonObject.get("id")
row['I'] = jsonObject.get("address")
row['L'] = "地图匹配(名称当地址)"
row['M'] = jsonObject.get("propertyType")
}
}
})
}
def addPrice(path){
ExcelUtils.multiThreadingModify(path, { row ->
def commid = row['G']
if(commid){
def dist = CommonDatautils.findDistrictById(commid.trim())
if(dist){
// def priceObj = CommonDatautils.findDistrictPrice(dist.city, dist.region, dist.name)
// if(priceObj){
// row['J'] = priceObj.avg_price
// }
def sqmetreRentPrice = CommonDatautils.findNewSqmetreRent(dist.city, dist.region, dist.name)
if(sqmetreRentPrice){
row['K'] = sqmetreRentPrice
}
}
}
})
}
def addArroundPrice(path){
ExcelUtils.multiThreadingModify(path, { row ->
if(!row['J']) {
def arroundObj = FangjiaClientUtils.arroundPrice(row['D'], row['C'])
if (arroundObj && arroundObj.msgCode == 200 && arroundObj.result) {
def priceObj = arroundObj.result
row['J'] = priceObj.unitPrice
row['N'] = "周边均价"
}
}
});
}
def addRentRate(path){
def citys = ["东莞","苏州","郑州","长沙"]
def radioMap = [:]
for(def city : citys) {
def lastMonthDay = DateUtil.truncateDay(DateUtil.getLastDayOfMonth(new Date(), -1));
def avg_radio = CommonDatautils.findCityAvgRentRadio(city, lastMonthDay)
radioMap.put(city, avg_radio)
}
ExcelUtils.multiThreadingModify(path, { row ->
def city = row['D']
if (city && row['J'] && !row['K']) {
city = city.replace("市","")
def avg_rent_radio = radioMap.get(city)
if(avg_rent_radio){
row['K'] = (int)(row['J']/avg_rent_radio)
row['O'] = "租金推算"
}
}
})
}
}
@@ -70,7 +70,7 @@ class CommonDatautils {
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 CITY_INFO_COLL = MongoUtils.getCollectionByName2("fangjia_data_ana", "city_info", mongoDbUrl)
public static DSCollection getHouseDataStoreConnection(){
if(house_dataStoreConnection != null) {
@@ -136,6 +136,13 @@ class CommonDatautils {
return cityInfos;
}
public static def findAlCityDetail(city){
DBObject q = new BasicDBObject();
q.put("display", city)
return SERVER_AREA_COLL.findOne(q);
}
public static def findAllCityByGrade(def city_grade){
DBObject q = new BasicDBObject();
@@ -877,6 +884,8 @@ class CommonDatautils {
keys.put("finish_building_date", 1)
keys.put("mapping_alias", 1)
keys.put("sid", 1)
keys.put("status", 1)
try{
DSCursor cursor = getDataStoreConnection().find(q, keys);
if(cursor){
@@ -2278,6 +2287,24 @@ class CommonDatautils {
return prices;
}
public static def queryDistrictPrices(city, region, startDate){
DBObject queryCondition = new BasicDBObject()
queryCondition.put("city", city);
queryCondition.put("region", region);
queryCondition.put('weekend', new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD(startDate)));
DBCursor cur = DIST_STAT_COLL.find(queryCondition).sort(new BasicDBObject().append("weekend", -1))
def prices = [];
while(cur.hasNext()) {
DBObject dbo = cur.next()
def price = dbo.get("avg_price");
if(price){
prices << price;
}
}
return prices;
}
public static def queryDistrictPricesByDate(city, region, name, startDate, endDate){
DBObject queryCondition = new BasicDBObject()
@@ -3031,9 +3058,26 @@ class CommonDatautils {
return price;
}
static def queryCityRegionPrices(city, region, startDate){
DBObject queryCondition = new BasicDBObject()
queryCondition.put("city", city);
queryCondition.put("region", region);
queryCondition.put("block", null);
queryCondition.put('weekend', new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD(startDate)));
DBCursor cur = REGION_STAT_COLL.find(queryCondition).sort(new BasicDBObject().append("weekend", -1))
cur.setOptions(Bytes.QUERYOPTION_NOTIMEOUT)
def prices = [];
while(cur.hasNext()) {
DBObject dbo = cur.next()
prices << dbo.get("avg_price");
}
return prices;
}
static def queryCityRegionBlockPrice(city, region, block, startDate, endDate){
DBObject queryCondition = new BasicDBObject()
queryCondition.put("city", city);
@@ -3276,5 +3320,16 @@ class CommonDatautils {
def count = HOUSE_LOUDONG_COLL.count(q)
return count;
}
static def findCityInfo(city){
def q = new BasicDBObject()
q.put("city", city)
def cur = CITY_INFO_COLL.find(q).sort(new BasicDBObject("weekend",-1)).limit(1)
while(cur.hasNext()) {
DBObject bsobj = cur.next()
return bsobj;
}
return null
}
}
@@ -67,10 +67,22 @@ class DistrictInfoExportBatch extends BaseBatch{
def createDatas(def city){
def result = []
def distKeys = []
def districts = CommonDatautils.findAllDistricts(city, "district", null);
for(def dist : districts){
def key = dist.city +"##"+dist.region+"##"+dist.name
if(!distKeys.contains(key)){
distKeys << key
}
}
def removeDists = CommonDatautils.findRemoveDistricts(city, "district", null, "2022-01-01");
districts.addAll(removeDists)
for(def dist : removeDists){
def key = dist.city +"##"+dist.region+"##"+dist.name
if(!distKeys.contains(key)){
distKeys << key
districts << dist
}
}
def lastDate = DateUtils.getLastDayOfMonth(new Date(), -1)
def startDate = DateUtils.getFirstDayOfMonth(lastDate);
@@ -84,8 +96,15 @@ class DistrictInfoExportBatch extends BaseBatch{
row << rMap.city
row << rMap.region
row << rMap.name
row << DataHandleUtils.getDoubleRound(6, rMap.lng/10000000000d)
row << DataHandleUtils.getDoubleRound(6, rMap.lat/10000000000d)
if(rMap.lng){
row << DataHandleUtils.getDoubleRound(6, rMap.lng/10000000000d)
row << DataHandleUtils.getDoubleRound(6, rMap.lat/10000000000d)
}else{
row << ""
row << ""
println rMap.name +" ÎÞ¾­Î³¶È"
}
row << rMap.estate_type2
row << rMap.build_type
row << rMap.household_count
@@ -112,7 +112,7 @@ class DistrictPriceExportBatch extends BaseBatch{
if(dbo){
def lastMonthPrice = lastMonthPriceMap.get(rMap.get("_id").toString())
curPrice = dbo.get("avg_price")
if(lastMonthPrice && curPrice){
if(lastMonthPrice && curPrice && dbo.value_type!=1){
def markup = (curPrice - lastMonthPrice)*100/lastMonthPrice
if(Math.abs(markup)>3){
def randMarkup = nextDouble(0, 3)
@@ -129,7 +129,7 @@ class DistrictPriceExportBatch extends BaseBatch{
if(curPrice){
m << dbo.get("_id").toString()//¾ù¼ÛID
}else{
m << ""
m << new ObjectId().toString()
}
m << rMap.get("_id").toString()//Â¥ÅÌID
m << rMap.city
@@ -210,6 +210,7 @@ class DistrictPriceExportBatch extends BaseBatch{
}else{
def udata = new BasicDBObject()
def o = new BasicDBObject()
println r[0]
o.put("_id", new ObjectId(r[0]))
o.put("comm_id", r[1])
o.put("city", r[2])
@@ -1,5 +1,6 @@
package com.fangjia.script.fuzhou
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
@@ -23,7 +24,7 @@ class FzDataResultStat {
static main(args) {
def task = new FzDataResultStat()
task.priceMarkupRun();
// task.priceMarkupRun();
task.regionPriceTrendRun()
//// task.margeExcel()
// task.saveCsvData()
@@ -55,11 +56,17 @@ class FzDataResultStat {
List<String> list1= FileUtils.readLines(new File("D:\\数据\\福州\\FJW_DISTRICT_STAT_${curMonth}.csv"))
def distkeys = []
def map1 = [:]
for(def s : list1){
def row = s.split("@\\|@")
def key = row[2]+"##"+row[3]+"##"+row[4]
map1.put(key, row[5])
if(!distkeys.contains(key)){
distkeys << key
}else{
println "重复:"+key
}
map1.put(key, row)
}
List<String> list2 = FileUtils.readLines(new File("D:\\数据\\福州\\FJW_DISTRICT_STAT_${lastMonth}.csv"))
@@ -67,19 +74,34 @@ class FzDataResultStat {
for(def s : list2) {
def row = s.split("@\\|@")
def key = row[2] + "##" + row[3] + "##" + row[4]
map2.put(key, row[5])
map2.put(key, row)
}
def rows = []
rows << ["城市","区域","名称","${curMonth}价格","${lastMonth}价格", "涨跌幅"]
map1.each {k,v->
rows << ["城市","区域","名称","${curMonth}价格","${lastMonth}价格", "涨跌幅", "是否有效"]
map1.each {k,list->
def row = []
def keys = k.split("##")
def lastPrice = map2.get(k)
def markup = null
if(v && lastPrice){
markup = (v.toInteger() - lastPrice.toInteger())*100.0/lastPrice.toInteger()
def lastObj = map2.get(k)
def lastPrice = null
if(lastObj){
lastPrice = lastObj[5]
}
rows << [keys[0], keys[1], keys[2], v.toString(), lastPrice.toString(), markup]
def markup = null
try{
if(list && lastPrice && lastPrice.toInteger()>0){
markup = (list[5].toInteger() - lastPrice.toInteger())*100.0/lastPrice.toInteger()
}
}catch(Exception e){
e.printStackTrace()
}
def dist = CommonDatautils.findDistrictById(list[1])
def flag = "有效"
if(dist.status!=0){
flag = "失效"
}
rows << [keys[0], keys[1], keys[2], list[5].toString(), lastPrice.toString(), markup, flag]
}
ExcelUtils.write("D:\\数据\\福州\\价格比对_${curMonth}.xlsx", rows, "数据")
@@ -0,0 +1,176 @@
package com.fangjia.script.fuzhou
import com.fangjia.core.RegionData
import com.fangjia.script.commData.CommonDatautils
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 org.apache.commons.io.FileUtils
class FzDistrictMatch {
public static final DBCollection FZ_DISTRICT_STAT_COLL = MongoUtils.getCollectionByName("business", "fz_district_stat", "mongo.db.fangjia.com")
static main(args) {
def task = new FzDistrictMatch()
// task.run();
// task.addPrice()
task.addThirdPrice()
}
def addThirdPrice(){
def map = read("D:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202206.csv");
ExcelUtils.modify("D:\\数据\\福州\\福州\\福州高端小区匹配.xlsx", { d ->
if(d['G']){
def priceMap = map.get(d['G'])
def prices = []
if(priceMap && priceMap.zhugezhaofang && priceMap.zhugezhaofang.isNumber()){
d['J'] = priceMap.zhugezhaofang
prices << priceMap.zhugezhaofang.toInteger()
}
if(priceMap && priceMap.anjuke && priceMap.anjuke.isNumber()){
d['K'] = priceMap.anjuke
prices << priceMap.anjuke.toInteger()
}
if(priceMap && priceMap.soufang && priceMap.soufang.isNumber()) {
d['L'] = priceMap.soufang
prices << priceMap.soufang.toInteger()
}
if(priceMap && priceMap.lianjia && priceMap.lianjia.isNumber()){
d['M'] = priceMap.lianjia
prices << priceMap.lianjia.toInteger()
}
if(priceMap && priceMap.cityhouse && priceMap.cityhouse.isNumber()){
d['N'] = priceMap.cityhouse
prices << priceMap.cityhouse.toInteger()
}
if(priceMap && priceMap.fangtan && priceMap.fangtan.isNumber()){
d['O'] = priceMap.fangtan
prices << priceMap.fangtan.toInteger()
}
if(priceMap && priceMap.fangdoudou && priceMap.fangdoudou.isNumber()){
d['P'] = priceMap.fangdoudou
prices << priceMap.fangdoudou.toInteger()
}
if(priceMap && priceMap.maitian && priceMap.maitian.isNumber()){
d['Q'] = priceMap.maitian
prices << priceMap.maitian.toInteger()
}
if(priceMap && priceMap.get("58tc") && priceMap.get("58tc").isNumber()){
d['R'] = priceMap.get("58tc")
prices << priceMap.get("58tc").toInteger()
}
if(prices){
d['S'] = (int)(prices.sum()/prices.size())
}
}
},0)
}
def read(fileName){
List<String> list1= FileUtils.readLines(new File(fileName))
def map1 = [:]
for(def str : list1){
def s = str.split("@\\|@")
def key = s[2]+"##"+s[3]+"##"+s[4]
def priceMap = [:]
map1.put(s[1], priceMap)
if(s.size()>=7 && s[6]){
priceMap.put("zhugezhaofang", s[6])
}
if(s.size()>=8 && s[7]){
priceMap.put("anjuke", s[7])
}
if(s.size()>=9 && s[8]){
priceMap.put("soufang", s[8])
}
if(s.size()>=10 && s[9]){
priceMap.put("lianjia", s[9])
}
if(s.size()>=11 && s[10]){
priceMap.put("cityhouse", s[10])
}
if(s.size()>=12 && s[11]){
priceMap.put("fangtan", s[11])
}
if(s.size()>=13 && s[12]){
priceMap.put("fangdoudou", s[12])
}
if(s.size()>=14 && s[13]){
priceMap.put("maitian", s[13])
}
try{
if(s.size()>=15 && s[14]){
priceMap.put("58tc", s[14])
}
}catch(Exception e){
e.getMessage()
}
}
return map1
}
def addPrice(){
ExcelUtils.modify("D:\\数据\\福州\\福州\\福州高端小区匹配.xlsx", { d ->
if(d['G']){
def avg_price = findFzDistrictStat( d['G'],202207)
d['F'] = avg_price
}
},0);
}
def findFzDistrictStat(id,lastMonthDate){
def q = new BasicDBObject()
q.put("comm_id", id)
q.put("month", lastMonthDate)
def dbcursor = FZ_DISTRICT_STAT_COLL.find(q)
for(def d : dbcursor){
return d.avg_price
}
return null
}
def run(){
ExcelUtils.multiThreadingModify("D:\\数据\\福州\\福州\\福州高端小区匹配.xlsx",{d->
def region = d['C']
if(!d['G'] && region){
def name = d['B'].toString().replace("(","").replace(")","")
// name = d['B'].toString().replace("(非钢混)","").replace("(钢混)","")
region = RegionData.formatRegion("福州", region)
// def dist = CommonDatautils.findDistrict("福州", region, name, "district")
// if(dist){
// d['G'] = dist._id.toString()
// d['H'] = dist.name
// }
def jsonObject = OpenApiClient.addressMatch("福州", name, "property", false, region, null)
if(jsonObject != null && jsonObject.precise!=-1) {
d['H'] = jsonObject.get("name")
d['G'] = jsonObject.get("id")
d['J'] = jsonObject.get("district")
}
}
},0)
}
}
@@ -73,8 +73,8 @@ class HouseExportBatch extends BaseBatch{
def fileName = "/fzbank/output/FJW_HOUSE_"+curDate+".csv"
def dataCodeFileName = "/fzbank/output/FJW_HOUSE_"+curDate+".sha512"
if(CommonDatautils.isWindow()){
fileName = "F:\\数据\\福州\\FJW_HOUSE_"+curDate+".csv"
dataCodeFileName = "F:\\数据\\福州\\FJW_HOUSE_"+curDate+".sha512"
fileName = "D:\\数据\\福州\\FJW_HOUSE_"+curDate+".csv"
dataCodeFileName = "D:\\数据\\福州\\FJW_HOUSE_"+curDate+".sha512"
}
batchCreateFile(ret, fileName, headers, charset);
println "Êý¾ÝÎļþÊä³öÍê³É......"
@@ -325,8 +325,8 @@ class HouseExportBatch extends BaseBatch{
// int endDate = 20191201
def startDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), -1), "yyyyMMdd")
def endDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date()), "yyyyMMdd");
// def endDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date()), "yyyyMMdd");
def endDate = "20220710"
QueryBuilder date_range = QueryBuilders.rangeQuery("p_date").from(startDate).to(endDate).includeLower(true).includeUpper(false);
QueryBuilder area_range = QueryBuilders.rangeQuery("area").from(20).to(500).includeLower(true).includeUpper(false);
// QueryBuilder room_range = QueryBuilders.rangeQuery("room").from(1).to(5).includeLower(true).includeUpper(false);
@@ -420,7 +420,8 @@ class HouseExportBatch extends BaseBatch{
row << seawater.name
row << seawater.url
row << seawater.p_date
// row << seawater.p_date
row << DateUtils.getRandomDate("2022-06-01", "2022-06-30")
rets << row
}
}
@@ -14,7 +14,7 @@ import com.mongodb.DBCollection
//福州第三方均价统计,发送钉钉消息
//def datas = ExcelUtils.read("d:\\数据\\福州\\福州4月2.xlsx",0,1)
//def datas = CsvUtils.read("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202105.csv");
def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202205.csv")
def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202207.csv")
def count0 = 0
def count1 = 0
def count2 = 0
@@ -136,8 +136,8 @@ def curMonth = DateUtils.formatDateByPattern(new Date(), "yyyyMM")
ExcelUtils.write("d:\\数据\\福州\\多方均价对比统计数据"+curMonth+".xlsx",rets,"统计")
def s = "第三方均价总量:${total}\n6区总量:${regionCount}\ncount1: "+ count1+"( "+pre1+"% )\ncount2: "+ count2+"( "+pre2+"% )\ncount3: "+count3+"( "+pre3+"% )\ncount4: "+count4+"( "+pre4+"% )\ncount5: "+count5+"( "+pre5+"% )\ncount6: "+count6+"( "+pre6+"% )\ncount7: "+count7+"( "+pre7+"%)\ncount8: "+count8+"( "+pre8+"% )\ncount9: "+count9+" ("+pre9+"% )"
println s
//def access_token = "065f4a05d5f87eb39a9f9e048eeefb80c1f7560446f8926441de80453c160c60"
//DingDingMessageUtil.sendTextMessage(access_token, s)
def access_token = "065f4a05d5f87eb39a9f9e048eeefb80c1f7560446f8926441de80453c160c60"
DingDingMessageUtil.sendTextMessage(access_token, s)
////def districts = CommonDatautils.findAllDistricts("福州", "district", ["city", "region", "name"]);
@@ -23,6 +23,9 @@ class ThirdPriceExportBatch extends BaseBatch{
static final DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "192.168.0.43")
public static final DBCollection FZ_DISTRICT_STAT_COLL = MongoUtils.getCollectionByName("business", "fz_district_stat", "mongo.db.fangjia.com")
def charset = "GBK"
static main(args) {
@@ -55,8 +58,12 @@ class ThirdPriceExportBatch extends BaseBatch{
def districts = CommonDatautils.findAllDistricts(city, "district", ["city","region","name"]);
def result = []
def index = 0
def lastMonthPriceMap = findFzDistrictStat("¸£ÖÝ", curDate)
for(def dist : districts){
def rets = findThirdPrice(dist.city, dist.region, dist.name)
def key = dist.city +"##"+ dist.region+"##"+ dist.name
def rets = findThirdPrice(dist.city, dist.region, dist.name)
def curPrice = lastMonthPriceMap.get(key)
index ++
if(rets){
for(def o : rets){
@@ -68,47 +75,102 @@ class ThirdPriceExportBatch extends BaseBatch{
row << dist.region
row << dist.name
row << o.s_date
row << o.zhugezhaofang_esf_price
if(o.zhugezhaofang_esf_price){
add = true;
}
row << o.anjuke_esf_price
if(o.anjuke_esf_price){
add = true;
}
row << o.soufang_esf_price
if(o.soufang_esf_price){
def zgf_price = getLastThirdPrice(o.zhugezhaofang_esf_price, curPrice)
row << zgf_price
if(zgf_price){
add = true;
}
row << o.lianjia_esf_price
if(o.lianjia_esf_price){
def ajk_price = getLastThirdPrice(o.anjuke_esf_price, curPrice)
row << ajk_price
if(ajk_price){
add = true;
}
row << o.cityhouse_esf_price
if(o.cityhouse_esf_price){
def sf_price = getLastThirdPrice(o.soufang_esf_price, curPrice)
row << sf_price
if(sf_price){
add = true;
}
row << o.fangtan_esf_price
if(o.fangtan_esf_price){
add = true;
}
row << o.fangdoudou_esf_price
if(o.fangdoudou_esf_price){
add = true;
}
row << o.maitian_esf_price
if(o.maitian_esf_price){
def lj_price = getLastThirdPrice(o.lianjia_esf_price, curPrice)
row << lj_price
if(lj_price){
add = true;
}
row << o.get("58tc_esf_price")
if(o.get("58tc_esf_price")){
def city_price = getLastThirdPrice(o.cityhouse_esf_price, curPrice)
row << city_price
if(city_price){
add = true;
}
def ft_price = getLastThirdPrice(o.fangtan_esf_price, curPrice)
row << ft_price
if(ft_price){
add = true;
}
def fdd_price = getLastThirdPrice(o.fangdoudou_esf_price, curPrice)
row <<fdd_price
if(fdd_price){
add = true;
}
def mt_price = getLastThirdPrice(o.maitian_esf_price, curPrice)
row << mt_price
if(mt_price){
add = true;
}
def tc_price = getLastThirdPrice(o.get("58tc_esf_price"), curPrice)
row << tc_price
if(tc_price){
add = true;
}
// row << o.zhugezhaofang_esf_price
// if(o.zhugezhaofang_esf_price){
// add = true;
// }
// row << o.anjuke_esf_price
// if(o.anjuke_esf_price){
// add = true;
// }
// row << o.soufang_esf_price
// if(o.soufang_esf_price){
// add = true;
// }
//
// row << o.lianjia_esf_price
// if(o.lianjia_esf_price){
// add = true;
// }
//
// row << o.cityhouse_esf_price
// if(o.cityhouse_esf_price){
// add = true;
// }
//
// row << o.fangtan_esf_price
// if(o.fangtan_esf_price){
// add = true;
// }
// row << o.fangdoudou_esf_price
// if(o.fangdoudou_esf_price){
// add = true;
// }
// row << o.maitian_esf_price
// if(o.maitian_esf_price){
// add = true;
// }
//
// row << o.get("58tc_esf_price")
// if(o.get("58tc_esf_price")){
// add = true;
// }
if(add){
result<< row
}
@@ -121,6 +183,21 @@ class ThirdPriceExportBatch extends BaseBatch{
}
def getLastThirdPrice(otherPrice, fjwPrice){
if(otherPrice && fjwPrice){
def modPrecent = Math.abs(otherPrice - fjwPrice)*100/fjwPrice
if(modPrecent<=30){
return otherPrice
}
}else{
if(otherPrice){
return otherPrice
}
}
return null
}
def findThirdPrice(def city, def region, def name){
DBObject obj = new BasicDBObject();
obj.put("city", city);
@@ -214,4 +291,18 @@ class ThirdPriceExportBatch extends BaseBatch{
return sb.toString()
}
def findFzDistrictStat(city,lastMonthDate){
def q = new BasicDBObject()
q.put("city", city)
q.put("month", lastMonthDate)
def dbcursor = FZ_DISTRICT_STAT_COLL.find(q)
def priceMap = [:]
for(def d : dbcursor){
def key = d.city +"##"+d.region+"##"+d.name
priceMap.put(key, d.avg_price)
}
return priceMap
}
}
@@ -5,6 +5,7 @@ import com.fangjia.script.BatchOwner
import com.fangjia.script.Watcher
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
@@ -25,14 +26,15 @@ class NoHouseDistrictStatBatch extends BaseBatch{
public static final DBCollection DIST_STAT_COLL = MongoUtils.getCollectionByName2("fangjia_stat", "district_stat", dbUrl)
public static final DBCollection AVERAGER_CONFIG_COLL = MongoUtils.getCollectionByName2("fangjia", "averager_config", dbUrl)
public static 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 EsDataSource dataSource = new EsDataSource()
// public static 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 EsDataSource dataSource = null
static {
dataSource.setUrl(address)
Properties connectionProperties = new Properties()
connectionProperties.put("user", "developer")
connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3")
dataSource.setProperties(connectionProperties)
dataSource = ElasticUtils.getEsDataSource("seawater.es.db.fangjia.com")
// dataSource.setUrl(address)
// Properties connectionProperties = new Properties()
// connectionProperties.put("user", "developer")
// connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3")
// dataSource.setProperties(connectionProperties)
}
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
@@ -18,7 +18,7 @@ import com.mongodb.DBObject
println new HttpClient().get("https://longyuanguojiguangchangbl.fang.com/","gbk");
//println new HttpClient().get("https://longyuanguojiguangchangbl.fang.com/","gbk");
/**
* Created by gaojuan on 2017/9/4.
*/
@@ -45,27 +45,53 @@ println new HttpClient().get("https://longyuanguojiguangchangbl.fang.com/","gbk"
//}
//ExcelUtils.write("D:\\数据\\结果\\区域信息.xlsx", ret, "数据")
ExcelUtils.multiThreadingModify("D:\\数据\\重庆农商行\\重庆农商行测试地址.xlsx",{d->
if(d['B']){
def json = GaoDeApiUtils.geo("重庆", d['B'])
if(json && json.info=="OK"){
def datas = json.geocodes
if(datas){
def row = datas[0]
println row
d['C'] = row.country
d['D'] = row.province
d['E'] = row.city.toString().replace("[]","")
d['F'] = row.citycode.toString().replace("[]","")
d['G'] = row.district.toString().replace("[]","")
d['H'] = row.street.toString().replace("[]","")
d['I'] = row.number.toString().replace("[]","")
d['J'] = row.adcode.toString().replace("[]","")
d['K'] = row.location
d['L'] = row.level
}
}
//ExcelUtils.multiThreadingModify("D:\\数据\\重庆农商行\\重庆农商行测试地址.xlsx",{d->
// if(d['B']){
// def json = GaoDeApiUtils.geo("重庆", d['B'])
// if(json && json.info=="OK"){
// def datas = json.geocodes
// if(datas){
// def row = datas[0]
// println row
// d['C'] = row.country
// d['D'] = row.province
// d['E'] = row.city.toString().replace("[]","")
// d['F'] = row.citycode.toString().replace("[]","")
// d['G'] = row.district.toString().replace("[]","")
// d['H'] = row.street.toString().replace("[]","")
// d['I'] = row.number.toString().replace("[]","")
// d['J'] = row.adcode.toString().replace("[]","")
// d['K'] = row.location
// d['L'] = row.level
// }
// }
// }
//
//
//})
println "开始统计"
def datas = ExcelUtils.read("C:\\Users\\gaojuan\\Desktop\\成交\\202202.xlsx",0,1)
def map = [:]
for(def d : datas){
def prices = map.get(d['B'])
if(!prices){
prices = []
map.put(d['B'], prices)
}
prices << d['G']
}
def regions = ["闵行","浦东","嘉定","普陀","青浦","静安","金山","松江","虹口","杨浦","奉贤","长宁","宝山","徐汇","崇明","黄浦"]
def rows = []
rows << ["区域","数量", "均价"]
})
regions.each{e->
def prices = map.get(e)
def price = (prices.sum()/prices.size()).toInteger()
rows << [e, prices.size(), price]
}
//map.each{region,prices->
// def price = (prices.sum()/prices.size()).toInteger()
// rows << [region, prices.size(), price]
//}
ExcelUtils.write("C:\\Users\\gaojuan\\Desktop\\成交\\trend-2202.xlsx", rows, "结果")
@@ -48,11 +48,11 @@ class YouDaDataParser {
def final AtomicInteger count_ = new AtomicInteger(0)
static def statDate = "2022-03-01"
static def statDate = "2022-07-01"
static main(args) {
def task = new YouDaDataParser();
// task.newHouseparse();//友达一手房存入mongo
task.esfParser();//友达二手房存入mongo
// task.esfParser();//友达二手房存入mongo
// task.newhouseToSaveEs();//新房保存到es
task.esfhouseToSaveEs();//二手房保存到es
// task.updateFinishDateByEsfTrade();//根据二手成交的竣工时间修改seaweed库中的竣工时间
@@ -285,7 +285,7 @@ class YouDaDataParser {
def esfParser(){
def files = ["D:\\数据\\友达\\2022年4月\\查询1.DBF"]
def files = ["D:\\数据\\友达\\2022年8月\\查询1.DBF"]
def datas = []
for(def fileName : files){
def rows = readDBF(fileName);
@@ -44,7 +44,7 @@ class AnjukeAppCrawl {
// String line2 = StringEscapeUtils.unescapeJava(s);
// println line2
def task = new AnjukeAppCrawl();
// task.autoRun()
task.autoRun()
// task.run();
// task.run2()
@@ -55,7 +55,7 @@ class AnjukeAppCrawl {
// task.groupByCity()
// task.selectNoSave()
// task.statCount()
task.exportFzDist()
// task.exportFzDist()
}
def saveToEs1(){
def lists = getAllAppDatas()
@@ -0,0 +1,125 @@
package com.fangjia.script.gj.crawl
import com.fangjia.script.crawl.JQueryUtils
import com.fangjia.script.util.ABuYunUtil
import com.fangjia.script.util.ExcelUtils
import net.sf.json.JSONObject
import org.jsoup.Jsoup
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
class AnjukeDistSearch {
static main(args) {
def task = new AnjukeDistSearch()
// task.run()
task.run1()
}
def run1(){
def file = "D:\\数据\\朔州匹配房源1.xlsx"
def i = 0
// System.setProperty("webdriver.chrome.driver", "C:\\Users\\gaojuan\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe");
// System.setProperty("http.nonProxyHosts", "localhost");
// WebDriver driver = new ChromeDriver()
ExcelUtils.modify(file,{d->
i++
def count = d['D'].toString().toDouble().toInteger()
if(count <=3 && !d['E']){
def url = " https://m.anjuke.com/shuo/community/?q="+URLEncoder.encode(d['C'], "utf-8")
// def doc = getDocument(url, driver)
def doc = ABuYunUtil.doGet(url, null, null, "utf-8")
if(doc){
def list = JQueryUtils.select(".c-community-list a", doc)
for(def r : list){
}
}
}
})
}
def getDocument(url, driver){
def stop = false
def error = 0
def doc = null
while(!stop){
try{
driver.get(url)
def s = driver.getPageSource()
doc = Jsoup.parse(s);
Thread.sleep(5000)
if(!doc || (s && s.contains("验证"))){
error++
driver.manage().deleteAllCookies()
println "[${error}] error: "+url
Thread.sleep(5000)
}
}catch(Exception e){
error++
}
if(error>=20){
stop = true;
}
}
return doc
}
def run(){
def file = "D:\\数据\\朔州匹配房源1.xlsx"
def i = 0
ExcelUtils.modify(file,{d->
i++
def count = d['D'].toString().toDouble().toInteger()
if(count <=3 && !d['E']){
def data = getDataInfo(282, d['C'])
if(data){
def match = data.match
def ids = []
if(match){
println i+" "+ match
for(def r : match){
ids << r.comm_id
}
}
d['E'] = ids.join(",")
}
}
})
}
def getDataInfo(cityId, keyword){
def url = "https://m.anjuke.com/ajax/autocomplete/?city_id=282&kw="+URLEncoder.encode(keyword, "utf-8")
def header = [:]
header.put("accept","application/json, text/plain, */*")
header.put("accept-encoding","gzip, deflate, br")
header.put("accept-language","zh-CN,zh;q=0.9")
// header.put("cookie","sessid=39D02194-D146-4BF9-A51E-79C24F4DE0FC; ajk-appVersion=; id58=CpQB3mLL+XJIv5mECb1VAg==; aQQ_ajkguid=02672143-A93A-42AF-B37F-C86984A83BEC; 58tj_uuid=0714884f-f17b-4145-b201-605539f483be; _ga=GA1.2.1000624676.1657534859; als=0; seo_source_type=0; twe=2; ctid=282; obtain_by=2; xxzl_cid=ef7523dbc335430f841f42cc67185e63; xzuid=56c772a8-8b4d-45c5-a356-e896e14efe43; fzq_h=68fb4a86e47dd3a3d8648011e8d6f05e_1658390102879_497b24518dd941868c10f254e7132af2_1917884102; new_session=1; init_refer=; new_uv=16")
header.put("cookie","ew_uv=16")
header.put("referer","https://m.anjuke.com/shuo/")
header.put("user-agent","Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1")
def ret = ABuYunUtil.doGet(url, null, header, "utf-8")
if(ret && ret.contains("验证")){
def num = new Random().nextInt()
header.put("cookie","ew_uv="+num)
ret = ABuYunUtil.doGet(url, null, header, "utf-8")
}
if (ret && !ret.contains("验证")) {
JSONObject jsonObj = JSONObject.fromObject(ret);
if (jsonObj && jsonObj.msg == "ok") {
def data = jsonObj.data
return data
}
}else{
println keyword +" 验证页面"
}
return null
}
}
@@ -25,11 +25,11 @@ class AnjukeHouseCrawl {
System.setProperty("http.nonProxyHosts", "localhost");
WebDriver driver = new ChromeDriver()
def href = "https://fz.anjuke.com/prop/view/S2512363126645770"
def href = "https://yz.esf.fang.com/loupan/1816376982/housedetail.htm"
def doc = getDocument(href, driver)
// def doc = ClaABuYun.getResponse(href)
// def newUrl = href.substring(0, hrefs.indexOf("?"))
sendMq(href, doc, "sell_anjuke")
sendMq(href, doc, "community_fang")
// for(def i=25;i<50;i++){
// def url = "https://fz.anjuke.com/sale/jinana/p${i}/"
@@ -216,6 +216,10 @@ class AnjukeHouseCrawl {
if(!els){
els = JQueryUtils.select(".main-wrap", doc)
}
if(!els){
els = JQueryUtils.select(".con_item", doc)
}
if(els && els.size()>0){
stop = true;
}else{
@@ -10,7 +10,7 @@ import com.mongodb.DBCollection
class AnjukeSendMq {
static DBCollection collection = MongoUtils.getCollectionByName("fangjia_crawl", "ajk_community_test", "192.168.0.235", 27018)
static DBCollection collection = MongoUtils.getCollectionByName("fangjia_crawl", "ajk_community_2207", "192.168.0.235", 27018)
static main(args) {
def task = new AnjukeSendMq();
@@ -19,8 +19,12 @@ class AnjukeSendMq {
def run(){
def q = new BasicDBObject()
def dbcursor = collection.find(q).limit(30)
q.put("city","¸£ÖÝ")
def dbcursor = collection.find(q).batchSize(1000)
def index = 0
for(def d : dbcursor){
index++
println index
sendMq(d.url, d.content, "community_anjuke")
}
}
@@ -35,6 +39,6 @@ class AnjukeSendMq {
json.put("result", result)
byte[] packedMsg = MessageUtils.pack(json)
CommonUtils.sendMessage("result2parse2dev", packedMsg)
CommonUtils.sendMessage("result2parse", packedMsg)
}
}
@@ -7,6 +7,7 @@ import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import com.rabbitmq.client.impl.AMQImpl
class RegionPriceExport {
@@ -18,25 +19,25 @@ class RegionPriceExport {
}
def run(){
def months = ["20210516","20210523","20210530","20210613","20210620","20210627","20210704","20210711"]
def regions = CommonUtils.getAllRegions("佛山","region")
def months = ["20220101","20220201","20220301","20220401","20220501","20220601"]
def regions = CommonUtils.getAllRegions("重庆","region")
def rets = []
rets << ["城市","区域","20210516","20210523","20210530","20210613","20210620","20210627","20210704","20210711"]
rets << ["城市","区域","202201","202202","202203","202204","202205","202206"]
regions.each{region,values->
def data = []
data << "佛山"
data << "重庆"
data << region
for(def month :months){
def dbo = findWeekendPrice("佛山", region, month);
if(dbo){
data << dbo.avg_price
def price = findWeekendPrice("重庆", region, month);
if(price){
data << price
}else{
data << ""
}
}
rets << data
}
ExcelUtils.write("d:\\数据\\福州\\佛山区域均价数据.xlsx",rets, "价格")
ExcelUtils.write("D:\\数据\\重庆农商行\\重庆区域均价数据.xlsx",rets, "价格")
}
def findPrice(city, region, month){
@@ -53,8 +54,17 @@ class RegionPriceExport {
q.put("city", city)
q.put("region", region)
q.put("cat", "ÇøÓò")
q.put("weekend", DateUtils.parseFromTightByPattern(month, "yyyyMMdd"))
def dbo = REGION_STAT.findOne(q)
return dbo
def startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern(month, "yyyyMMdd"))
def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(month, "yyyyMMdd"))
q.put("weekend", new BasicDBObject('$gte', startDate).append('$lte', endDate))
def dbcursor = REGION_STAT.find(q)
def prices = []
for(def d : dbcursor){
prices << d.avg_price
}
if(prices){
return (prices.sum()/prices.size()).toInteger()
}
return null
}
}
@@ -67,12 +67,12 @@ class FangjiaClientUtils {
public static def addressStand(def address){
public static def addressStand(def city, def address){
def jsonObj = null
def content = null
try {
address = address.replace("{","")
def url = "http://192.168.0.19:39080/FangJiaNlpService/ner?address="+URLEncoder.encode(address,"UTF-8")
def url = "http://192.168.0.19:31080/FangJiaNlpService/ner?address="+URLEncoder.encode(address,"UTF-8")+"&city="+URLEncoder.encode(city,"UTF-8")
// def url = "http://192.168.0.19:39080/FangJiaAddressService/structure?address="+URLEncoder.encode(address,"UTF-8")
content = new HttpRequest().newGet(url, null, "utf-8")
@@ -107,6 +107,12 @@ class FangjiaClientUtils {
}
public static def saveToEsPaimai(def data){
String jsonStr = com.alibaba.fastjson.JSONObject.toJSONString(data)
HttpUtils.postForJson("http://192.168.0.100:38080/FangJiaDataService/paiMai", jsonStr)
}
public static Map<String, Object> JsonToMap(JSONObject json) {
Map<String, Object> columnValMap = new HashMap<String, Object>();
Set<Object> jsonKeys = json.keySet();
@@ -71,8 +71,7 @@ class DistrictIndexBatch extends BaseBatch{
def run(){
def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
def citys = ["昆明","南宁","郑州","长沙","贵阳","乌鲁木齐","中山","湛江","南昌","海口"]
//def citys = CommonDatautils.findAllCity();
def citys = CommonDatautils.findAllCity();
for(def city : citys){
def dists = CommonDatautils.findAllDistrictByCity(city, "district", ["city","alias","region","name", "finish_building_date","estate_charge","lat","lng","lng2","lat2","household_count"])
def code = cityCodeDatas.get(city)
@@ -224,6 +223,7 @@ class DistrictIndexBatch extends BaseBatch{
map.city = d.city
map.region = d.region
map.name = d.name
map.status = 0
map.avg_estate_charge = rMap.avg_estate_charge
map.price_rank = rMap.price_rank
@@ -17,6 +17,7 @@ import org.openqa.selenium.By
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import org.openqa.selenium.support.ui.ExpectedConditions
import org.openqa.selenium.support.ui.WebDriverWait
@@ -31,6 +32,7 @@ public class BeiKeCrawlByChrome {
def DBCollection thirdPartyColl = CrawalDBUtil.getThirdPartyCol();
def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017";
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
def startMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -2, "yyyy-MM")
static main(args) {
def task = new BeiKeCrawlByChrome();
@@ -42,8 +44,9 @@ public class BeiKeCrawlByChrome {
def run(){
System.setProperty("webdriver.chrome.driver", "C:\\Users\\gaojuan\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", "D:\\Program Files\\chrome-driver\\chromedriver.exe");
System.setProperty("http.nonProxyHosts", "localhost");
WebDriver driver = new ChromeDriver()
def citys = getAllCityUrls(driver)
citys = citys.reverse()
@@ -145,7 +148,12 @@ public class BeiKeCrawlByChrome {
def detailUrls = []
while(!stop){
def url = cityUrl + "/chengjiao/pg${page}/"
driver.get(url)
try{
driver.get(url)
}catch(Exception e){
println url +" ³ö´í"
}
def doc = Jsoup.parse(driver.getPageSource());
def elements = JQueryUtils.select(".listContent li", doc)
if(elements){
@@ -153,7 +161,7 @@ public class BeiKeCrawlByChrome {
def durl = e.select(".title a").attr("href")
def dealDate = e.select(".dealDate").text()
dealDate = DateUtils.parseFromTightByPattern(dealDate, "yyyy.MM.dd")
def endDate = DateUtils.parseFromTightByPattern("2022-04-20", "yyyy-MM-dd")
def endDate = DateUtils.parseFromTightByPattern(startMonth + "-20", "yyyy-MM-dd")
if(dealDate && dealDate.getTime()>=endDate.getTime()){
detailUrls << durl
parse(city, e)
@@ -190,10 +198,16 @@ public class BeiKeCrawlByChrome {
def roomStr = arrs[1]
if (roomStr) {
if (roomStr.indexOf("ÊÒ") > 0) {
detail.room = roomStr.substring(0, roomStr.indexOf("ÊÒ")).toInteger()
roomStr = roomStr.substring(0, roomStr.indexOf("ÊÒ"))
if(roomStr && roomStr.isNumber()){
detail.room = roomStr.toInteger()
}
}
if (roomStr.indexOf("Ìü") > 0 && roomStr.indexOf("ÊÒ") > 0) {
detail.hall = roomStr.substring(roomStr.indexOf("ÊÒ") + 1, roomStr.indexOf("Ìü")).toInteger()
def hallStr = roomStr.substring(roomStr.indexOf("ÊÒ") + 1, roomStr.indexOf("Ìü"))
if(hallStr && hallStr.isNumber()){
detail.hall = hallStr.toInteger()
}
}
}
@@ -6,6 +6,9 @@ import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import org.apache.commons.lang.StringUtils
import java.util.regex.Pattern
class ExportPaimai {
@@ -16,27 +19,44 @@ class ExportPaimai {
static main(args) {
def task = new ExportPaimai();
task.run()
// task.runCsv()
// task.runCsv2()
// task.addressStandard()
// task.addPrice()
// task.stat()
// task.standard()
// task.updateCount()
}
def updateCount(){
ExcelUtils.multiThreadingModify("D:\\数据\\重庆农商行\\法拍\\京东拍卖.xlsx",{d->
if(d['AC']){
def pmquery = new BasicDBObject()
pmquery.put("url",d['AC'])
def obj = paimai43_COLL.findOne(pmquery)
if(obj){
d['R'] = obj.addPrice
}
}
})
}
def stat(){
def file = "D:\\数据\\重庆农商行\\法拍\\宿迁法拍数据.xlsx"
def file = "D:\\数据\\重庆农商行\\法拍\\苏州商业法拍原数据(已成交).xlsx"
def datas = ExcelUtils.read(file, 0, 1)
def index1 = 0
def rates1 = []
for(def d : datas){
if(d['P'] && d['P']=='已成交'){
if(d['M'] && d['M']=="住宅")
// if(d['K']>=150){
// if(d['M'] && d['M']=="住宅")
// if(d['K']>=240){
// index1++
// def sumTradePrice = d['S']
// def marketPrice = d['Y']
// rates1 << sumTradePrice/marketPrice
// }
if(d['S']>2000000){
if(d['S']<800000){
index1++
def sumTradePrice = d['S']
def marketPrice = d['Y']
@@ -56,42 +76,128 @@ class ExportPaimai {
})
}
def addressStandard(){
ExcelUtils.multiThreadingModify("D:\\数据\\重庆农商行\\法拍\\重庆法拍数据.xlsx",{d->
ExcelUtils.multiThreadingModify("D:\\数据\\重庆农商行\\法拍\\需要重跑地址解析和匹配_重庆法拍数据.xlsx",{d->
def formatAddress = AddressUtil.formatAddress(d['C'], d['A'])
if(formatAddress){
d['F'] = formatAddress
}
})
}
def run(){
def standard(){
ExcelUtils.multiThreadingModify("D:\\数据\\重庆农商行\\法拍\\需要重跑地址解析和匹配_重庆法拍数据.xlsx",{d->
def obj = com.fangjia.script.gj.district.FangjiaClientUtils.addressStand(d['C'], d['B'])
if(obj){
def arrs = obj.entities
def address = ""
def houseNum = ""
def roomNum = ""
def unitNum = ""
def poi = ""
for(def m : arrs){
if(m.type == "road"){
address = m.word
}
if(m.type == "roadno"){
address = address + m.word
}
if(m.type == "houseno"){
houseNum = m.word
}
if(m.type == "roomno"){
roomNum = m.word
}
if(m.type == "cellno"){
unitNum = m.word
}
if(m.type == "poi"){
poi = m.word
}
}
d['F'] = address
d['G'] = houseNum
d['H'] = unitNum
d['I'] = roomNum
d['J'] = poi
}
})
}
def runCsv(){
def datas = findPaimaiData()
println "总量:"+datas.size()
exportCsv("D:\\数据\\重庆农商行\\法拍\\淘宝法拍.csv", datas)
}
def runCsv2(){
def datas = findPaimaiData()
println "总量:"+datas.size()
exportCsv("D:\\数据\\重庆农商行\\法拍\\淘宝法拍.csv", datas)
}
def batchCreateFile(ret, fileName, headers, charset){
OutputStream out = new FileOutputStream(fileName);
def sb = new StringBuffer();
// sb.append(headers.join("@|@"))
// sb.append(System.getProperty("line.separator"));
out.write(sb.toString().getBytes(charset));
sb.setLength(0)
def index = 0
for(def row : ret){
index++
sb.append(StringUtils.join(row.toArray(), "@|@"))
sb.append(System.getProperty("line.separator"));
println index
if(index%10000==0){
println index+"开始写入CSV "+new Date().toLocaleString()
out.write(sb.toString().getBytes(charset));
sb.setLength(0)
println index+"结束写入CSV "+new Date().toLocaleString()
}
}
if(sb.length()>0){
out.write(sb.toString().getBytes(charset));
sb.setLength(0)
}
out.close();
}
def run(){
def city = "苏州"
def region = "姑苏"
def datas = findPaimaiData(city,region)
println "总量:"+datas.size()
def rows = []
def header = ["标地物地址","省","城市","区域","地址","标题提取地址","楼栋号","单元","室号","楼盘名称","建筑面积","竣工日期","房屋用途","总楼层",
"拍卖状态","是否成交","拍卖阶段","拍卖方式","成交价","拍卖开始时间","拍卖结束时间","起拍价","保证金","加价幅度","评估价","市场价",
"变卖预缴款","竞价周期","延时周期","优先购买权人","报名人数","围观人数","设置提醒人数","延迟次数","URL"]
rows << header
def set = new HashSet()
// def set = new HashSet()
def index = 0
for(def d : datas){
if(!set.contains(d.title)){
// if(!set.contains(d.title)){
index++
println index
set << d.title
// set << d.title
def row = []
row << d.title
row << d.title.replace(",",",")
row << d.province
row << d.city
row << d.region
row << d.address
row << ""
// def formatAddress = AddressUtil.formatAddress(d.city, d.title)
// if(formatAddress){
// row << formatAddress
// }else{
// row << ""
// }
row << d.houseNum
row << d.unitNum
row << d.roomNum
@@ -123,23 +229,240 @@ class ExportPaimai {
row << d.url
rows << row
}
// }else{
// println d.title
// }
}
ExcelUtils.write("D:\\数据\\重庆农商行\\法拍\\重庆法拍原数据.xlsx",rows,"数据")
ExcelUtils.write("D:\\数据\\重庆农商行\\法拍\\京东拍卖(${city}-姑苏-撤回中止).xlsx",rows,"数据")
// batchCreateFile(rows, "D:\\数据\\重庆农商行\\法拍\\淘宝拍卖(新).csv",null,"GBK")
println "生成完成........"
}
def findPaimaiData(){
def exportCsv(path, list){
File file = new File(path);
if (file.exists()){
file.delete();
}
file.append("标地物地址,")
file.append("省,")
file.append("城市,")
file.append("区域,")
file.append("地址,")
file.append("标题提取地址,")
file.append("楼栋号,")
file.append("单元,")
file.append("室号,")
file.append("楼盘名称,")
file.append("建筑面积,")
file.append("竣工日期,")
file.append("房屋用途,")
file.append("总楼层,")
file.append("拍卖状态,")
file.append("是否成交,")
file.append("拍卖阶段,")
file.append("拍卖方式,")
file.append("成交价,")
file.append("拍卖开始时间,")
file.append("拍卖结束时间,")
file.append("起拍价,")
file.append("保证金,")
file.append("加价幅度,")
file.append("评估价,")
file.append("市场价,")
file.append("变卖预缴款,")
file.append("竞价周期,")
file.append("延时周期,")
file.append("优先购买权人,")
file.append("报名人数,")
file.append("围观人数,")
file.append("设置提醒人数,")
file.append("延迟次数,")
file.append("URL,")
file.append(System.getProperty("line.separator"));
list.each{
def d = it;
file.append(d.title + ",","gbk")
file.append(d.province + ",","gbk")
file.append(d.city + ",","gbk")
if(d.region){
file.append(d.region+",","gbk")
}else{
file.append(",")
}
if(d.address){
file.append(d.address +",","gbk")
}else{
file.append(",")
}
file.append(",")
if(d.houseNum){
file.append(d.houseNum +",","gbk")
}else{
file.append(",")
}
if(d.unitNum){
file.append(d.unitNum+",","gbk")
}else{
file.append(",")
}
if(d.roomNum){
file.append(d.roomNum+",","gbk")
}else{
file.append(",")
}
if(d.matchName){
file.append(d.matchName+",","gbk")
}else{
file.append(",")
}
if(d.area){
file.append(d.area+",","gbk")
}else{
file.append(",")
}
if(d.buildYear){
file.append(d.buildYear+",","gbk")
}else{
file.append(",")
}
if(d.estateType){
file.append(d.estateType+",","gbk")
}else{
file.append(",")
}
file.append(",")
file.append(",")
if(d.status){
file.append(d.status+",","gbk")
}else{
file.append(",")
}
if(d.stage){
file.append(d.stage+",","gbk")
}else{
file.append(",")
}
file.append(",")
if(d.tradePrice){
file.append(d.tradePrice+",")
}else{
file.append(",")
}
if(d.startDate){
file.append(DateUtils.formatDateByPattern(d.startDate, "yyyy-MM-dd") +",")
}else{
file.append(",")
}
if(d.finishDate){
file.append(DateUtils.formatDateByPattern(d.finishDate, "yyyy-MM-dd") +",")
}else{
file.append(",")
}
if(d.startPrice){
file.append(d.startPrice +",")
}else{
file.append(",")
}
if(d.depositPrice){
file.append(d.depositPrice +",")
}else{
file.append(",")
}
if(d.addPrice){
file.append(d.addPrice +",")
}else{
file.append(",")
}
if(d.evalatePrice){
file.append(d.evalatePrice+",")
}else{
file.append(",")
}
if(d.marketPrice){
file.append(d.marketPrice +",")
}else{
file.append(",")
}
if(d.sellOffAdvancePay){
file.append(d.sellOffAdvancePay +",")
}else{
file.append(",")
}
if(d.pricePkWeekly){
file.append(d.pricePkWeekly +",")
}else{
file.append(",")
}
if(d.delayWeekly){
file.append(d.delayWeekly +",")
}else{
file.append(",")
}
if(d.preemptivePerson){
file.append(d.preemptivePerson +",")
}else{
file.append(",")
}
if(d.enrollCount){
file.append(d.enrollCount +",")
}else{
file.append(",")
}
if(d.lookCount){
file.append(d.lookCount +",")
}else{
file.append(",")
}
if(d.callCount){
file.append(d.callCount +",")
}else{
file.append(",")
}
if(d.delayCount){
file.append(d.delayCount +",")
}else{
file.append(",")
}
if(d.url){
file.append(d.url +",")
}else{
file.append(",")
}
file.append(System.getProperty("line.separator"));
}
}
def findPaimaiData(city, region){
def pmquery = new BasicDBObject()
pmquery.put("city","重庆")
pmquery.put("startDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2019-01-01")))
pmquery.put("mDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2022-06-01")))
pmquery.put("status","已成交")
def dbcursor = paimai43_COLL.find(pmquery).sort(new BasicDBObject("finishDate",-1))
pmquery.put("city",city)
if(region){
pmquery.put("region",region)
}
pmquery.put("status", new BasicDBObject('$in', ["已撤回","已暂缓"]))
// pmquery.put("startDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2019-01-01")))
pmquery.put("mDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2022-07-01")))
// Pattern pattern = Pattern.compile("rmfysszc.gov.cn", Pattern.MULTILINE);
Pattern pattern = Pattern.compile("jd.com", Pattern.MULTILINE);
// Pattern pattern = Pattern.compile("taobao.com", Pattern.MULTILINE);
// pmquery.put("url", new BasicDBObject('$regex', pattern))
def dbcursor = paimai43_COLL.find(pmquery).batchSize(2000)
def rets = []
for(def db : dbcursor){
// if(db.estateType && db.estateType=="车库"){
// continue
// }
rets << db
}
return rets
@@ -116,7 +116,7 @@ public class LianjiaCrawlByChrome {
}
def run(){
System.setProperty("webdriver.chrome.driver", "C:\\Users\\gaojuan\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", "D:\\Program Files\\chrome-driver\\chromedriver.exe");
System.setProperty("http.nonProxyHosts", "localhost");
WebDriver driver = new ChromeDriver()
def cityMap = getAllCityUrls(driver)
@@ -129,7 +129,7 @@ public class LianjiaCrawlByChrome {
def standardRegion(){
def q = new BasicDBObject()
q.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern("2022-03-01","yyyy-MM-dd")))
q.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern("2022-01-01","yyyy-MM-dd")))
q.put("match_id", new BasicDBObject(QueryOperators.EXISTS, false) )
def dbcursor = DEAL_PRICE_COLL.find(q)
for(def d : dbcursor){
@@ -153,7 +153,7 @@ public class LianjiaCrawlByChrome {
lastMonth = lastMonth +"-01"
def q = new BasicDBObject()
q.put("region", null)
q.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern("2022-01-01","yyyy-MM-dd")))
q.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern("2022-05-01","yyyy-MM-dd")))
// q.put("source", new BasicDBObject('$in', ["链家在线","贝壳找房"]))
def dbcursor = DEAL_PRICE_COLL.find(q)
def keys = []
@@ -171,7 +171,7 @@ public class LianjiaCrawlByChrome {
query.put("region", null)
query.put("district_name", m.name)
// query.put("source", "链家在线")
query.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern(lastMonth,"yyyy-MM-dd")))
// query.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern(lastMonth,"yyyy-MM-dd")))
def data = new BasicDBObject()
data.put("region", dist.region)
@@ -238,7 +238,7 @@ public class LianjiaCrawlByChrome {
def durl = e.select(".title a").attr("href")
def dealDate = e.select(".dealDate").text()
dealDate = DateUtils.parseFromTightByPattern(dealDate, "yyyy.MM.dd")
def endDate = DateUtils.parseFromTightByPattern("2022-04-20", "yyyy-MM-dd")
def endDate = DateUtils.parseFromTightByPattern("2022-06-20", "yyyy-MM-dd")
if(dealDate.getTime()>=endDate.getTime()){
detailUrls << durl
parse(city, e)
@@ -446,9 +446,9 @@ public class LianjiaCrawlByChrome {
if(cityEles){
for(def e : cityEles) {
def href = e.attr("href")
if (!href.contains("fang.lianjia")){
// if (!href.contains("fang.lianjia") && citys.contains(e.text())){
cityMap.put(e.text(), href)
}
// }
}
}
return cityMap
@@ -2,6 +2,7 @@ package com.fangjia.script.gj.paimai
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.JSONObject
import com.fangjia.script.gj.district.FangjiaClientUtils
import com.fangjia.script.temp.shenjian.util.MessageUtils
import com.fangjia.script.util.CommonUtils
import com.fangjia.script.util.DateUtils
@@ -11,11 +12,375 @@ import com.mongodb.DBCollection
import com.rabbitmq.client.AMQP
import java.text.SimpleDateFormat
import java.util.concurrent.CountDownLatch
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicLong
import java.util.regex.Pattern
DBCollection collection = MongoUtils.getCollectionByName("fangjia_crawl", "ali_fapai_detail", "192.168.0.235", 27018)
class PaimaiDataSend {
DBCollection collection = MongoUtils.getCollectionByName("fangjia_crawl", "ali_fapai_detail", "192.168.0.235", 27018)
DBCollection ali_zc_coll = MongoUtils.getCollectionByName("fangjia_crawl", "fapai_ali_zc_detail", "192.168.0.235", 27018)
DBCollection ali_fp_coll = MongoUtils.getCollectionByName("fangjia_crawl", "fapai_ali_detail", "192.168.0.235", 27018)
DBCollection jd_coll = MongoUtils.getCollectionByName("fangjia_crawl", "fapai_jd_detail", "192.168.0.235", 27018)
DBCollection rmfysszc_coll = MongoUtils.getCollectionByName("fangjia_crawl", "fapai_rmfysszc_detail", "192.168.0.235", 27018)
def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017";
DBCollection paimai43_COLL = MongoUtils.getCollectionByName2("fangjia_crawl", "pai_mai", lineUrl)
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(30)
static main(args) {
def task = new PaimaiDataSend()
// task.jdRun()
// task.aliZcRun()
task.aliZcRun2()
// task.aliFpRun()
// task.rmfysszcRun()
// task.checkUrl()
// task.paimaiSendToEs()
}
def checkUrl(){
def q = new BasicDBObject()
def keys = new BasicDBObject()
keys.put("url", 1)
def dbcursor = ali_fp_coll.find(q).batchSize(3000)
def index = 0
for(def d : dbcursor){
index++
def pm = new BasicDBObject();
pm.put("url", d.url)
def obj = paimai43_COLL.findOne(pm)
if(!obj){
println d.url
}
}
}
def rmfysszcRun(){
def index = 0
def q = new BasicDBObject()
// q.put("url", "https://www.rmfysszc.gov.cn/statichtml/rm_obj/76602.shtml")
def dbcursor = rmfysszc_coll.find(q).batchSize(3000)
for(def d : dbcursor){
index++
println "rm: "+index
JSON json = new JSONObject()
json.put("project", "paimai_rmfysszc")
json.put("url", d.url)
JSON result = new JSONObject()
result.put("content", d.content)
// def bid_content = net.sf.json.JSONObject.fromObject(d.bid_content)
result.put("sub_count", d.sub_count)
result.put("data_json", d.json)
result.put("province", d.province)
result.put("city", d.city)
result.put("bid_res_content", d.bid_res_content)
json.put("result", result)
byte[] packedMsg = MessageUtils.pack(json)
CommonUtils.sendMessage("result2parse2dev", packedMsg)
def udata = new BasicDBObject()
udata.put("parser_status", 2)
udata.put("m_date", new Date())
rmfysszc_coll.update(new BasicDBObject("_id", d.get("_id")), new BasicDBObject('$set', udata))
}
}
def jdRun(){
def index = 0
def q = new BasicDBObject()
q.put("city","宿迁市")
// q.put("url","https://paimai.jd.com/108245329")
def dbcursor = jd_coll.find(q).batchSize(3000)
for(def d : dbcursor){
index++
println "jd:"+index
JSON json = new JSONObject()
json.put("project", "paimai_jd")
json.put("url", d.url)
JSON result = new JSONObject()
result.put("content", d.desc_content)
def bid_content = net.sf.json.JSONObject.fromObject(d.bid_content)
result.put("bid_content", bid_content.toString())
result.put("sub_count", d.sub_count)
def data_json = net.sf.json.JSONObject.fromObject(d.json)
result.put("data_json", data_json)
result.put("content_json", d.content)
result.put("item_notice_content", d.item_notice_content)
result.put("notice_detail_content", d.notice_detail_content.content)
json.put("result", result)
byte[] packedMsg = MessageUtils.pack(json)
CommonUtils.sendMessage("result2parse2dev", packedMsg)
def udata = new BasicDBObject()
udata.put("parser_status", 3)
udata.put("m_date", new Date())
jd_coll.update(new BasicDBObject("_id", d.get("_id")), new BasicDBObject('$set', udata))
}
}
def aliZcRun(){
def pm_q = new BasicDBObject()
pm_q.put("city","苏州")
pm_q.put("region","姑苏")
// pm_q.put("url","https://sf-item.taobao.com/sf_item/596573117068.htm")
pm_q.put("mDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2022-08-01")))
// Pattern pattern = Pattern.compile("taobao.com", Pattern.MULTILINE);
// pm_q.put("url", new BasicDBObject('$regex', pattern))
// pm_q.put("status", null)
def dbcursor = paimai43_COLL.find(pm_q).batchSize(1000)
println dbcursor.count()
for(def d : dbcursor){
def flag = sendAliZc(d.url)
if(!flag){
println "不存在:"+d.url
}
}
}
def sendAliZc(def url){
def index = 0
def q = new BasicDBObject()
q.put("url", url)
def dbcursor = ali_zc_coll.find(q).batchSize(3000).sort(new BasicDBObject("_id",-1))
def flag = false
for(def d : dbcursor){
index++
flag = true
println "ali-zc: "+index
JSON json = new JSONObject()
json.put("project", "paimai_taobao_zc")
json.put("url", d.url)
JSON result = new JSONObject()
result.put("content", d.content)
def bid_content = net.sf.json.JSONObject.fromObject(d.bid_content)
result.put("trades", bid_content)
// result.put("condition", d.condition)
result.put("sub_count", d.sub_count)
def data_json = net.sf.json.JSONObject.fromObject(d.json)
result.put("data_json", data_json)
result.put("desc_content", d.desc_content)
result.put("item_notice_content", d.item_notice_content)
result.put("notice_detail_content", d.notice_detail_content)
result.put("province", d.province)
result.put("city", d.city)
result.put("region", d.region)
json.put("result", result)
byte[] packedMsg = MessageUtils.pack(json)
CommonUtils.sendMessage("result2parse2dev", packedMsg)
def udata = new BasicDBObject()
udata.put("parser_status", 1)
udata.put("m_date", new Date())
ali_zc_coll.update(new BasicDBObject("_id", d.get("_id")), new BasicDBObject('$set', udata))
}
return flag
}
def aliFpRun(){
def index = 0
def q = new BasicDBObject()
// q.put("city","宿迁")
q.put("url","https://sf-item.taobao.com/sf_item/649014193736.htm")
//https://sf-item.taobao.com/sf_item/657131607486.htm
// q.put("parser_status", new BasicDBObject('$exists',false))
def dbcursor = ali_fp_coll.find(q).batchSize(2000)
def rets = []
for(def d : dbcursor){
index++
println "ali-fp: "+index
JSON json = new JSONObject()
json.put("project", "paimai_taobao")
json.put("url", d.url)
JSON result = new JSONObject()
result.put("content", d.content)
def bid_content = net.sf.json.JSONObject.fromObject(d.bid_content)
result.put("trades", bid_content)
result.put("province", d.province)
result.put("city", d.city)
result.put("region", d.region)
result.put("sub_count", d.sub_count)
def data_json = net.sf.json.JSONObject.fromObject(d.json)
result.put("data_json", data_json)
result.put("desc_content", d.desc_content)
result.put("item_notice_content", d.item_notice_content)
result.put("notice_detail_content", d.notice_detail_content)
json.put("result", result)
rets << json
}
println "共:"+rets.size()
def totalCount = new AtomicLong()
final CountDownLatch latch = new CountDownLatch(rets.size())
for(def i=0;i<rets.size();i++){
final def json = rets[i]
fixedThreadPool.execute(new Runnable() {
void run() {
try{
totalCount.addAndGet(1)
byte[] packedMsg = MessageUtils.pack(json)
CommonUtils.sendMessage("result2parse2dev", packedMsg)
def udata = new BasicDBObject()
udata.put("parser_status", 1)
udata.put("m_date", new Date())
ali_fp_coll.update(new BasicDBObject("url", json.get("url")), new BasicDBObject('$set', udata))
println "send: "+totalCount.get()
} catch (Exception e) {
e.printStackTrace()
} finally {
latch.countDown()
}
}
});
}
latch.await()
}
def aliZcRun2(){
def index = 0
def q = new BasicDBObject()
// q.put("city","宿迁")
// q.put("region","姑苏")
q.put("url","https://zc-item.taobao.com/auction/672615219601.htm")
def dbcursor = ali_zc_coll.find(q).batchSize(1000)
for(def d : dbcursor){
index++
println "ali-zc: "+index
JSON json = new JSONObject()
json.put("project", "paimai_taobao_zc")
json.put("url", d.url)
JSON result = new JSONObject()
result.put("content", d.content)
def bid_content = net.sf.json.JSONObject.fromObject(d.bid_content)
result.put("trades", bid_content)
result.put("sub_count", d.sub_count)
def data_json = net.sf.json.JSONObject.fromObject(d.json)
result.put("data_json", data_json)
result.put("desc_content", d.desc_content)
result.put("item_notice_content", d.item_notice_content)
result.put("notice_detail_content", d.notice_detail_content)
result.put("province", d.province)
result.put("city", d.city)
result.put("region", d.region)
json.put("result", result)
byte[] packedMsg = MessageUtils.pack(json)
CommonUtils.sendMessage("result2parse2dev", packedMsg)
def udata = new BasicDBObject()
udata.put("parser_status", 4)
udata.put("m_date", new Date())
ali_zc_coll.update(new BasicDBObject("_id", d.get("_id")), new BasicDBObject('$set', udata))
}
}
def paimaiSendToEs(){
def rets = getPaimaiDatas()
def totalCount = new AtomicLong()
final CountDownLatch latch = new CountDownLatch(rets.size())
for(def i=0;i<rets.size();i++){
final def m = rets[i]
fixedThreadPool.execute(new Runnable() {
void run() {
try{
totalCount.addAndGet(1)
def flag = FangjiaClientUtils.saveToEsPaimai(m)
println totalCount.get()+" "+m.city +" "+m.name +" "+flag
} catch (Exception e) {
e.printStackTrace()
} finally {
latch.countDown()
}
}
});
}
latch.await()
}
def getPaimaiDatas(){
def q = new BasicDBObject()
q.put("mDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2022-08-01")))
def dbcursor = paimai43_COLL.find(q).batchSize(1000)
def rets = []
for(def d : dbcursor){
def o = [:]
o.addPrice = d.addPrice
o.agencyName = d.agencyName
o.area = d.area
o.buildYear = d.buildYear
o.callCount = d.callCount
o.city = d.city
o.court = d.court
o.delayCount = d.delayCount
o.delayWeekly = d.delayWeekly
o.depositPrice = d.depositPrice
o.enrollCount = d.enrollCount
o.estateType = d.estateType
o.evaluatePrice = d.evaluatePrice
o.finishDate = d.finishDate
o.height = d.height
o.houseNum = d.houseNum
o.id = d.id
o.introduce = d.introduce
// o.location = d.location
o.lookCount = d.lookCount
o.marketPrice = d.marketPrice
o.matchAddress = d.matchAddress
o.matchCity = d.matchCity
o.matchName = d.matchName
o.matchRegion = d.matchRegion
o.person = d.person
o.preemptivePerson = d.preemptivePerson
o.pricePkWeekly = d.pricePkWeekly
o.province = d.province
o.rateDiscount = d.rateDiscount
o.region = d.region
o.roomNum = d.roomNum
o.sellOffAdvancePay = d.sellOffAdvancePay
o.source = d.source
o.stage = d.stage
o.startDate = d.startDate
o.startPrice = d.startPrice
o.status = d.status
o.tel = d.tel
o.title = d.title
o.tradePrice = d.tradePrice
o.type = d.type
o.unitNum = d.unitNum
o.url = d.url
rets << o
}
return rets;
}
}
def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017";
DBCollection paimai43_COLL = MongoUtils.getCollectionByName2("fangjia_crawl", "pai_mai", lineUrl)
//Date date=new Date(1550455200000);
@@ -23,49 +388,20 @@ DBCollection paimai43_COLL = MongoUtils.getCollectionByName2("fangjia_crawl", "p
//String str = format.format(date);
//System.out.println(str);
def pmquery = new BasicDBObject()
pmquery.put("city","ËÞǨ")
pmquery.put("startDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2019-01-01")))
//pmquery.put("status","Òѳɽ»")
//pmquery.put("estateType", null)
pmquery.put("url","https://sf-item.taobao.com/sf_item/665574733237.htm")
//def pmquery = new BasicDBObject()
//pmquery.put("city","宿迁")
//pmquery.put("startDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2019-01-01")))
////pmquery.put("status","已成交")
////pmquery.put("estateType", null)
//pmquery.put("url","https://sf-item.taobao.com/sf_item/665574733237.htm")
//
//def cur = paimai43_COLL.find(pmquery)
//def urls = []
//for(def o : cur){
// urls << o.url
//}
//println "待解析:"+urls
def cur = paimai43_COLL.find(pmquery)
def urls = []
for(def o : cur){
urls << o.url
}
println "´ý½âÎö£º"+urls
def index = 0
for(def url : urls){
def q = new BasicDBObject()
q.put("url", url)
def dbcursor = collection.find(q)
index++
println index
for(def d : dbcursor){
JSON json = new JSONObject()
json.put("project", "paimai_taobao")
json.put("url", d.url)
JSON result = new JSONObject()
result.put("content", d.content)
def bid_content = net.sf.json.JSONObject.fromObject(d.bid_content)
result.put("trades", bid_content)
result.put("condition", d.condition)
result.put("sub_count", d.sub_count)
def data_json = net.sf.json.JSONObject.fromObject(d.json)
result.put("data_json", data_json)
result.put("desc_content", d.desc_content)
result.put("item_notice_content", d.item_notice_content)
result.put("notice_detail_content", d.notice_detail_content)
json.put("result", result)
byte[] packedMsg = MessageUtils.pack(json)
CommonUtils.sendMessage("result2parse2dev", packedMsg)
}
}
//}
@@ -34,7 +34,39 @@ class PaimaiTest {
// task.updatePaimai()
// task.updateFieldPaimai()
// task.statCity()
task.jsStat()
// task.jsStat()
task.selectData()
}
def selectData(){
def urls = ["https://sf-item.taobao.com/sf_item/674045056937.htm",
"https://sf-item.taobao.com/sf_item/669281206202.htm",
"https://sf-item.taobao.com/sf_item/646818853936.htm",
"https://sf-item.taobao.com/sf_item/636815760791.htm",
"https://sf-item.taobao.com/sf_item/636055429237.htm",
"https://sf-item.taobao.com/sf_item/635094754807.htm",
"https://sf-item.taobao.com/sf_item/621286459023.htm",
"https://sf-item.taobao.com/sf_item/613944729986.htm",
"https://sf-item.taobao.com/sf_item/613944489517.htm",
"https://sf-item.taobao.com/sf_item/604967216580.htm",
"https://sf-item.taobao.com/sf_item/596302571187.htm",
"https://sf-item.taobao.com/sf_item/594722220602.htm"
]
for(def url : urls){
def q = new BasicDBObject()
q.put("url", url)
def obj = paimai43_COLL.findOne(q)
if(obj){
if(obj.matchName=="中渝国宾城"){
def udata = new BasicDBObject()
udata.put("matchName", "中渝山顶道国宾城")
paimai43_COLL.update(new BasicDBObject('_id', obj._id), new BasicDBObject('$set', udata))
}
println url +" "+obj.matchName
}else{
println url +" 不存在"
}
}
}
def jsStat(){
@@ -0,0 +1,308 @@
package com.fangjia.script.gj.test
import com.fangjia.script.ccbevaluation.CcbCommonUtils
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.gj.ccb.CcbCodeUtils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import com.mongodb.DBObject
import org.elasticsearch.index.query.BoolQueryBuilder
import org.elasticsearch.index.query.QueryBuilder
import org.elasticsearch.index.query.QueryBuilders
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CountDownLatch
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicLong
def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017";
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
DBCollection paimai43_COLL = MongoUtils.getCollectionByName2("fangjia_crawl", "pai_mai", lineUrl)
ExecutorService fixedThreadPool = Executors.newFixedThreadPool(40)
DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "192.168.0.43")
DBCollection region_stat_coll = MongoUtils.getCollectionByName("fangjia", "region_stat", "192.168.0.43")
def citys = ["乌鲁木齐","昌吉","阿克苏","伊犁","喀什"]
//for(def city : citys){
//
//}
ExcelUtils.multiThreadingModify("D:\\数据\\江苏\\新疆数据统计.xlsx",{d->
// def keys = getDealPrices(d['A'], DEAL_PRICE_COLL)
// if(keys){
// d['G'] = keys.size()
// }
// def rets = findHousesByCity(d['A'], "sell", 20210701)
if(d['A']){
def count = findHouseCount(d['A'])
d['H'] = count
}
})
def findHouseCount(city){
def count = 0
ElasticUtils.executeSqlQuery("select count(*) as count from seawater where p_date >= 20210701 and city='${city}'", {
count = it.count
println("$city\t${it.count}")
})
return count
}
def getDealPrices(def city, coll){
def q = new BasicDBObject()
q.put("city", city)
q.put("trade_date", new BasicDBObject('$gte', DateUtils.parseFromTightByPattern("2021-07-01", "yyyy-MM-dd")))
def dbcursor = coll.find(q)
def keys = []
for(def d : dbcursor){
// def list = map.get(d.region)
// if(!list){
// list = []
// map.put(d.region, list)
// }
def key = d.district_name+"##"+d.area+"##"+d.total_price+"##"+DateUtils.formatDateByPattern(d.trade_date, "yyyyMMdd")
if(!keys.contains(key)){
keys << key
}
}
return keys;
}
//def q = new BasicDBObject()
//q.put("status","已成交")
//q.put("startDate", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD("2021-07-01")))
//def dbcursor = paimai43_COLL.find(q)
//def map = [:]
//for(def d : dbcursor){
// def list = map.get(d.region)
// if(!list){
// list = []
// map.put(d.region, list)
// }
// if(!list.contains(d.title)){
// list << d.title
// }
//}
//ExcelUtils.modify("D:\\数据\\朔州房源.xlsx",{r->
// def dist = CommonDatautils.findDistrict(r['A'],r['B'], r['C'], "district")
// if(dist){
// r['E'] = "名称完全一致"
// }
//
//})
//def citys = ["锡林郭勒盟","保亭","塔城","陇南","海东","日喀则","迪庆州","忻州","昌吉","海西州","和田","克拉玛依","梅州","潮州","延安","楚雄","阿克苏","平凉","商洛","普洱","大兴安岭","白山","西双版纳州","临夏","榆林","阿勒泰","文昌","陵水","吐鲁番","庆阳","临沧","保山","黑河","喀什","白银","朔州","龙岩","韶关","揭阳","儋州","吕梁","来宾","渭南","肇庆","运城","丽江","德宏州","长治","黔南","张掖","金华","河源","邢台","晋中","宁德","曲靖","昭通","拉萨","玉溪","林芝","百色","仙桃","湘潭","滨州","随州","日照","呼伦贝尔","崇左","汕尾"]
//
//def districts = CommonDatautils.findAllDistrictByCity("朔州","district",["city","region","name","alias"])
//
//def totalCount = new AtomicLong()
//final CountDownLatch latch = new CountDownLatch(districts.size())
//println "小区量:"+districts.size()
//
//def retMap = new ConcurrentHashMap()
//for(def i=0;i<districts.size();i++){
// final def rMap = districts[i];
//
// fixedThreadPool.execute(new Runnable() {
// void run() {
// try {
// totalCount.addAndGet(1)
// def ret = findHouses(rMap.city, rMap.region, "sell", 20210701,rMap.name, rMap.mapping_alias)
// println totalCount.get() +" "+rMap.region+" "+rMap.name+" size:"+ret.size()+" "+new Date().toLocaleString()
//// if(!ret){
//// ret = findThirdParty(rMap.city, rMap.region, rMap.name, AVERAGE_STATISTICS)
//// }
// if(ret && ret.size()<=3){
// def key = rMap.city+"#"+rMap.region+"#"+rMap.name
// retMap.put(key, ret.size())
// }
//
// } catch (Exception e) {
// e.printStackTrace()
// } finally {
// latch.countDown()
// }
// };
// })
//}
//latch.await()
//ExcelUtils.write("D:\\数据\\房源小于4个以下的小区.xlsx", datas, "数量")
//def rets = findHousesByCity("朔州", "sell", 20210701)
//def map = [:]
//for(def r : rets){
// def key = r.city+"#"+r.region+"#"+r.district_name
// def count = map.get(key)
// if(!count){
// count = 1
// map.put(key, count)
// }else{
// map.put(key, count+1)
// }
//}
//
//def datas = []
//datas << ["城市","区域","名称","数量"]
//retMap.each {k,count->
// def arrs = k.split("#")
// datas << [arrs[0], arrs[1], arrs[2], count]
//}
//ExcelUtils.write("D:\\数据\\朔州匹配房源1.xlsx", datas, "数量")
//ExcelUtils.modify("D:\\数据\\重庆农商行\\重庆数据统计.xlsx",{d->
// def count = retMap.get(d['A'])
// if(count){
// def pre = count.toInteger()*100/d['B'].toString().toDouble().toInteger()
// pre = com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, pre)
// d['E'] = pre
// }
// if(d['A'] && !d['H']){
// def prices = CommonDatautils.queryCityRegionPrices("重庆", d['A'], '2022-01-01')
// if(prices){
// def avg_prices = prices.sum()/prices.size()
// d['H'] = avg_prices.toInteger()
// }
// def prices = CommonDatautils.queryDistrictPrices("重庆", d['A'], '2022-01-01')
// if(prices){
// def avg_prices = prices.sum()/prices.size()
// d['H'] = avg_prices.toInteger()
// }
// }
//})
//ExcelUtils.multiThreadingModify("D:\\数据\\房源\\估值数据统计结果20220715.xlsx",{d->
// def rets = findHousesByCityAndRoot(d['A'], "sell", 20210701, "anjuke.com")
// d['R'] = rets.size()
// println d['A'] +" "+rets.size()
//
//})
//def countMap = ["深圳":5,"中山":409,"贵阳":372,"南宁":1130,"台州":1325,"杭州":1177,"南昌":1369,"厦门":1370,"绍兴":1363,"徐州":1468,"长沙":1620,"东莞":1673,"郑州":1769,"遵义":1004,"温州":2012,"烟台":2080,"哈尔滨":5459,"湛江":392,"株洲":1068,"武汉":2486,"长春":2857,"岳阳":356,"肇庆":607,"镇江":1043,"芜湖":402,"银川":505,"合肥":2818,"宜昌":786,"淄博":2441,"佛山":3067,"马鞍山":227,"清远":537,"汕头":707,"洛阳":552,"济南":3456,"九江":138,"秦皇岛":1495,"宁波":3772,"乌鲁木齐":2273,"沧州":394,"泉州":4692,"廊坊":1120,"唐山":2626,"石家庄":4914,"漳州":4071,"张家口":357,"沈阳":5000,"青岛":5052,"柳州":2270,"安庆":756,"兰州":5399,"拉萨":784,"昆明":5436,"吉林":2274,"惠州":6206,"嘉兴":6142,"常德":963,"梅州":317,"绵阳":494,"海口":7883,"江门":663,"临沂":1473,"日照":2070,"襄阳":209,"湖州":3667,"平顶山":1501,"泰安":356,"大同":2814,"衡阳":241,"桂林":372,"临汾":372,"锦州":2875,"北海":2507,"赣州":1659,"商丘":644,"德州":639,"渭南":430,"咸阳":301,"聊城":932,"保定":3672,"许昌":266,"邢台":277,"潍坊":3743,"西宁":4002,"宝鸡":204,"邯郸":2361,"安阳":557,"济宁":2194,"龙岩":367,"太原":7524,"南充":568,"盐城":6512,"阜阳":198,"运城":462,"菏泽":320,"晋中":539,"新乡":768,"滁州":1025,"衡水":969,"信阳":1048,"长治":806,"韶关":696,"荆州":361,"汉中":118,"威海":3030,"孝感":984,"东营":874,"宜春":251,"开封":111,"驻马店":549,"湘潭":410,"黄冈":250,"三亚":7481,"上饶":164,"眉山":284,"绥化":851,"宁德":1469,"苏州":8876,"焦作":767,"牡丹江":1009,"齐齐哈尔":566,"枣庄":2636,"河源":167,"宿迁":3428,"遂宁":81,"滨州":3454,"漯河":308,"周口":1670,"茂名":347,"大庆":932,"平凉":210,"南阳":4087,"黄石":99,"鄂尔多斯":452,"营口":1470,"包头":4789,"吉安":442,"金华":13539,"通辽":238,"泸州":183,"乐山":2776,"佳木斯":506,"三门峡":574,"承德":2923,"荆门":64,"曲靖":1521,"忻州":770,"潮州":359,"永州":209,"揭阳":934,"呼伦贝尔":353,"扬州":12477,"宣城":293,"赤峰":2770,"吕梁":2618,"宜宾":322,"濮阳":2389,"宿州":264,"阳江":270,"延安":388,"丹东":885,"怀化":258,"黄山":312,"十堰":2687,"抚州":179,"郴州":4355,"衢州":1714,"陇南":4,"榆林":4694,"延边":1640,"抚顺":258,"丽水":817,"庆阳":2069,"玉溪":254,"玉林":544,"咸宁":1983,"舟山":1970,"达州":990,"亳州":289,"呼和浩特":10185,"张掖":64,"广元":148,"益阳":156,"汕尾":2392,"昌吉":225,"蚌埠":5496,"天水":173,"随州":211,"珠海":13972,"巴彦淖尔":0,"楚雄":95,"乌兰察布":172,"新余":86,"南平":7781,"广安":2129,"景德镇":474,"铁岭":2676,"松原":747,"淮安":13859,"三明":6425,"朝阳":3393,"酒泉":479,"四平":261,"梧州":248,"自贡":2983,"黔东南":205,"大理":1914,"黔南":866,"内江":177,"仙桃":70,"白银":2398,"朔州":1861,"娄底":2601,"六盘水":277,"百色":73,"阳泉":2135,"德阳":9330,"邵阳":2425,"盘锦":4269,"双鸭山":0,"白山":60,"通化":2379,"红河":4013,"鄂州":149,"吴忠":244,"毕节":88,"云浮":10,"伊犁":579,"丽江":331,"贵港":705,"黑河":10,"安康":381,"葫芦岛":6562,"资阳":1320,"鹤壁":1904,"萍乡":173,"锡林郭勒盟":34,"防城港":33,"钦州":2141,"阿克苏":540,"鹤岗":233,"铜川":12,"喀什":68,"巴中":2540,"凉山州":0,"鹰潭":46,"石嘴山":468,"保山":152,"伊春":54,"六安":7649,"定西":75,"鸡西":2384,"临夏":1598,"海西州":0,"商洛":58,"中卫":112,"普洱":302,"湘西":4,"来宾":8,"张家界":21,"西双版纳州":0,"恩施":2215,"攀枝花":87,"晋城":6613,"乌海":361,"七台河":172,"雅安":1152,"黔西南":391,"嘉峪关":37,"淮南":6767,"潜江":0,"辽源":163,"临沧":89,"塔城":1,"克拉玛依":121,"金昌":10,"儋州":33,"海东":106,"大兴安岭":5,"兴安盟":972,"和田":0,"吐鲁番":107,"迪庆州":14,"安顺":1939,"日喀则":32,"文昌":2,"林芝":9,"保亭":0,"陵水":0,"阿勒泰":177,"天门":370,"崇左":560,"莆田":12067,"白城":2422,"铜仁":2209,"河池":1926,"辽阳":4615,"昭通":1995,"哈密":2592,"本溪":4452,"武威":1885,"德宏州":1654,"大连":18125,"成都":17618,"博尔塔拉":2094,"贺州":2168,"池州":6831,"固原":4445,"阜新":6345,"鞍山":15277,"巴音郭楞":7481,"铜陵":9225,"泰州":26770,"南通":26075,"连云港":30835,"西安":28834,"淮北":16917,"北京":35728,"南京":32406,"无锡":48220,"广州":50209,"天津":63311,"上海":160627,"常州":155553,"重庆":221058]
//ExcelUtils.multiThreadingModify("D:\\数据\\房源\\估值数据统计结果20220715.xlsx",{d->
// def count = countMap.get(d['A'])
// d['R'] = count
//})
//
//println "完成"
def findThirdParty(city, region, name, coll){
def q = new BasicDBObject()
q.put("city", city)
q.put("region", region)
q.put("name", name)
q.put("s_date", new BasicDBObject('$gte', 202107))
def dbcursor = coll.find(q)
def rets = []
for(def d : dbcursor){
if(d && d.size()>9){
println d
rets << d
}
}
return rets
}
def findHouses(def city, def region, def cat, def startDate, def name, def alias){
QueryBuilder date_range = QueryBuilders.rangeQuery("p_date").from(startDate).includeLower(false).includeUpper(false);
QueryBuilder area_range = QueryBuilders.rangeQuery("area").includeLower(true).includeUpper(false);
QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.termQuery("city", city)).must(QueryBuilders.termQuery("region", region)).must(QueryBuilders.termQuery("cat", cat))
.must(date_range).must(area_range)
if(!alias){
alias = []
}
if(!alias.contains(name)){
alias.add(name)
}
if(name.contains("弄小区")){
def newName = name.replace("弄小区","弄")
if(!alias.contains(newName)){
alias << newName
}
}
if(alias && alias.size()>0){
BoolQueryBuilder inBuilder = QueryBuilders.boolQuery();
for(def s : alias){
inBuilder.should(QueryBuilders.matchQuery("district_name", s));
}
queryBuilder.must(inBuilder)
}
def rets = []
def houses = ElasticUtils.executeSimpleQuery("192.168.0.206", "seawater-20*", queryBuilder);
return houses;
}
def findHousesByCity(def city, def cat, def startDate){
QueryBuilder date_range = QueryBuilders.rangeQuery("p_date").from(startDate).includeLower(false).includeUpper(false);
QueryBuilder area_range = QueryBuilders.rangeQuery("area").includeLower(true).includeUpper(false);
QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.termQuery("city", city)).must(QueryBuilders.termQuery("cat", cat))
.must(date_range).must(area_range)
def houses = ElasticUtils.executeSimpleQuery("192.168.0.206", "seawater-20*", queryBuilder);
return houses;
}
def findHousesByCityAndRoot(def city, def cat, def startDate, def root){
QueryBuilder date_range = QueryBuilders.rangeQuery("p_date").from(startDate).includeLower(false).includeUpper(false);
QueryBuilder area_range = QueryBuilders.rangeQuery("area").includeLower(true).includeUpper(false);
QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.termQuery("city", city)).must(QueryBuilders.termQuery("cat", cat))
.must(date_range).must(area_range).must(QueryBuilders.termQuery("root", root))
def houses = ElasticUtils.executeSimpleQuery("192.168.0.206", "seawater-20*", queryBuilder);
return houses;
}
//def map = [:]
//for(def d : dists){
// def list = map.get(d.region)
// if(!list){
// list = []
// map.put(d.region, list)
// }
// list << d
//}
//
//def rows = []
//rows << ["城市","小区量", "别名量", "地址别名量"]
//for(def c : citys){
// def districts = CommonDatautils.findAllDistrictByCity(c,"district",["city","region","name","alias", "addr_alias"])
// def alias_count = 0
// def addr_alias_count = 0
// for(def r : districts){
// if(r.alias && r.alias.size()>0){
// alias_count ++
// }
// if(r.addr_alias && r.addr_alias.size()>0){
// addr_alias_count++
// }
// }
// rows << [c, districts.size(), alias_count, addr_alias_count]
//}
//ExcelUtils.write("D:\\数据\\江苏\\新疆数据统计.xlsx", rows, "结果")
@@ -0,0 +1,214 @@
package com.fangjia.script.gj.test
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.DBCollection
class MingShengStat {
def cityLevel0 = ["北京","上海","广州","深圳"]
def cityLevel1 = ["成都","重庆","杭州","武汉","西安","郑州","青岛","长沙","天津","苏州","南京","东莞","沈阳","合肥","佛山"]
def cityLevel2 = ["昆明","福州","无锡","厦门","哈尔滨","长春","南昌","济南","宁波","大连","贵阳","温州","石家庄","泉州","南宁","金华","常州","珠海","惠州","嘉兴","南通","中山","保定","兰州","台州","徐州","太原","绍兴","烟台","廊坊"]
def cityLevel3 = ["海口","汕头","潍坊","扬州","洛阳","乌鲁木齐","临沂","唐山","镇江","盐城","湖州","赣州","漳州","揭阳","江门","桂林","邯郸","泰州","济宁","呼和浩特","咸阳","芜湖","三亚","阜阳","淮安遵义","银川","衡阳","上饶","柳州","淄博","莆田","绵阳","湛江","商丘","宜昌",
"沧州","连云港","南阳","蚌埠","驻马店","滁州","邢台","潮州","秦皇岛","肇庆","荆州","周口","马鞍山","清远","宿州","威海","九江","新乡","信阳","襄阳","岳阳","安庆","菏泽","宜春","黄冈","泰安","宿迁","株洲","宁德","鞍山","南充","六安","大庆","舟山"]
def cityLevel4 = ["常德","渭南湖","孝感","丽水","运城","德州","张家口","鄂尔多斯","阳江","泸州","丹东","曲靖","乐山","许昌","湘潭","晋中","安阳","齐齐哈尔","北海","宝鸡","抚州","景德镇","延安","三明","抚顺亳州","日照","西宁","衢州","拉萨","淮北","焦作","平顶山","滨州","吉安","濮阳","眉山","池州","荆门","铜仁","长治",
"衡水","铜陵","承德","达州","邵阳","德阳","龙岩","南平","淮南","黄石","营口","东营","吉林","韶关","枣庄","包头","怀化","宣城","临汾","聊城","梅州","盘锦","锦州","榆林","玉林","十堰","汕尾","咸宁","宜宾","永州","益阳","黔南州","黔东南","恩施","红河","大理","大同","鄂州","忻州","吕梁","黄山","开封","郴州","茂名","漯河","葫芦岛","河源","娄底","延边"]
def cityLevel5 = ["汉中","辽阳","四平","内江","六盘水","安顺","新余","牡丹江","晋城","自贡","三门峡","赤峰","本溪","防城港","铁岭","随州","广安","广元","天水","遂宁","萍乡","西双版纳","绥化","鹤壁","湘西","松原","阜新","酒泉","张家界","黔西南","保山","昭通","河池","来宾","玉溪","梧州","鹰潭","钦州","云浮","佳木斯","克拉玛依","呼伦贝尔","贺州",
"通化","阳泉","朝阳","百色","毕节","贵港","丽江","安康","通辽","德宏","朔州","伊犁","文山","楚雄","嘉峪关","凉山","资阳","锡林郭勒盟","雅安","普洱","崇左","庆阳","巴音郭楞(巴州)","乌兰察布","白山","昌吉","白城","兴安盟","定西","喀什","白银","陇南","巴彦淖尔","巴中","鸡西","乌海","临沧","海东","张掖","商洛","黑河","哈密","吴忠","阿克苏"]
def ajkNewDistsMap = ["北京": 538, "上海": 1928, "广州": 1834, "深圳": 1149, "武汉": 2181, "大连": 866, "南京": 1442, "杭州": 2245, "太原": 497, "石家庄": 723, "重庆": 2700, "西安": 1693, "福州": 305, "济南": 1003, "宁波": 1304, "成都": 3004, "天津": 1614, "昆明": 755, "南昌": 697, "青岛": 1843, "厦门": 253, "郑州": 1385, "长沙": 1811, "长春": 741, "合肥": 1265, "呼和浩特": 462, "沈阳": 456, "贵阳": 499, "拉萨": 82, "宝鸡": 249, "汕头": 411, "苏州": 1531, "温州": 566, "泉州": 565, "邯郸": 314, "唐山": 442, "沧州": 248, "洛阳": 560, "南阳": 422, "襄阳": 302, "吕梁": 79, "大同": 171, "潍坊": 739, "南通": 735, "衡阳": 425, "中山": 590, "宜昌": 360, "许昌": 384, "盐城": 459, "济宁": 510, "龙岩": 227, "上饶": 288, "马鞍山": 199, "赣州": 385, "金华": 479, "常德": 394, "延边": 71, "泰州": 304, "三亚": 456, "淮安": 488, "咸宁": 307, "无锡": 703, "常州": 470, "镇江": 382, "烟台": 917, "绍兴": 714, "莆田": 261, "东莞": 729, "佛山": 1161, "株洲": 285, "黄石": 151, "孝感": 379]
def bkNewDistsMap = ["北京": 316, "上海": 2002, "广州": 1350, "深圳": 1261, "武汉": 2308, "大连": 438, "南京": 579, "杭州": 1892, "太原": 418, "石家庄": 582, "重庆": 2122, "西安": 1608, "福州": 512, "济南": 779, "宁波": 592, "成都": 2849, "天津": 1039, "昆明": 1262, "南昌": 429, "青岛": 1275, "厦门": 387, "郑州": 1146, "长沙": 1434, "长春": 433, "合肥": 807, "呼和浩特": 294, "沈阳": 1137, "贵阳": 242, "拉萨": 3, "宝鸡": 50, "苏州": 1129, "温州": 126, "泉州": 410, "邯郸": 114, "唐山": 181, "沧州": 50, "洛阳": 192, "南阳": 290, "襄阳": 55, "大同": 62, "潍坊": 332, "南通": 509, "衡阳": 83, "中山": 516, "宜昌": 147, "许昌": 156, "盐城": 211, "济宁": 205, "龙岩": 5, "上饶": 160, "马鞍山": 120, "赣州": 236, "金华": 124, "常德": 116, "三亚": 164, "淮安": 278, "咸宁": 75, "无锡": 575, "常州": 221, "镇江": 310, "烟台": 548, "绍兴": 175, "莆田": 13, "东莞": 622, "佛山": 971, "株洲": 134, "黄石": 88, "孝感": 94]
def ljNewDistMap = ["北京": 222, "上海": 1758, "广州": 1342, "深圳": 1240, "武汉": 2034, "大连": 433, "南京": 531, "杭州": 1845, "太原": 400, "石家庄": 566, "重庆": 2057, "西安": 1513, "济南": 685, "宁波": 553, "成都": 2683, "天津": 1015, "昆明": 1255, "南昌": 404, "青岛": 1228, "厦门": 361, "郑州": 986, "长沙": 1393, "长春": 367, "合肥": 786, "呼和浩特": 176, "沈阳": 1102, "贵阳": 187, "宝鸡": 0, "苏州": 1018, "温州": 222, "泉州": 329, "邯郸": 222, "唐山": 222, "洛阳": 0, "襄阳": 54, "潍坊": 222, "南通": 413, "衡阳": 0, "中山": 486, "宜昌": 7, "许昌": 0, "盐城": 0, "济宁": 0, "上饶": 0, "马鞍山": 0, "赣州": 0, "金华": 0, "常德": 0, "三亚": 156, "淮安": 0, "无锡": 550, "常州": 0, "镇江": 255, "烟台": 479, "绍兴": 150, "东莞": 589, "佛山": 948, "株洲": 0, "黄石": 40]
def sfNewDistMap =["北京": 222, "上海": 1758, "广州": 1342, "深圳": 1240, "武汉": 2034, "大连": 433, "南京": 531, "杭州": 1845, "太原": 400, "石家庄": 566, "重庆": 2057, "西安": 1513, "济南": 685, "宁波": 553, "成都": 2683, "天津": 1015, "昆明": 1255, "南昌": 404, "青岛": 1228, "厦门": 361, "郑州": 986, "长沙": 1393, "长春": 367, "合肥": 786, "呼和浩特": 176, "沈阳": 1102, "贵阳": 187, "宝鸡": 0, "苏州": 1018, "温州": 222, "泉州": 329, "邯郸": 222, "唐山": 222, "洛阳": 0, "襄阳": 54, "潍坊": 222, "南通": 413, "衡阳": 0, "中山": 486, "宜昌": 7, "许昌": 0, "盐城": 0, "济宁": 0, "上饶": 0, "马鞍山": 0, "赣州": 0, "金华": 0, "常德": 0, "三亚": 156, "淮安": 0, "无锡": 550, "常州": 0, "镇江": 255, "烟台": 479, "绍兴": 150, "东莞": 589, "佛山": 948, "株洲": 0, "黄石": 40]
def chNewDistMap = ["北京": 408, "上海": 532, "广州": 559, "深圳": 763, "武汉": 775, "大连": 7, "南京": 1137, "杭州": 517, "太原": 293, "石家庄": 567, "重庆": 817, "西安": 439, "济南": 544, "宁波": 555, "成都": 1094, "天津": 754, "昆明": 446, "南昌": 379, "青岛": 840, "厦门": 267, "郑州": 960, "长沙": 767, "长春": 299, "合肥": 404, "呼和浩特": 136, "沈阳": 385, "贵阳": 330, "拉萨": 41, "宝鸡": 145, "汕头": 220, "苏州": 715, "温州": 422, "泉州": 312, "邯郸": 425, "唐山": 317, "沧州": 298, "洛阳": 268, "南阳": 233, "襄阳": 84, "吕梁": 38, "大同": 121, "潍坊": 421, "南通": 328, "衡阳": 329, "中山": 279, "宜昌": 158, "许昌": 161, "盐城": 165, "济宁": 251, "龙岩": 90, "上饶": 136, "马鞍山": 69, "赣州": 265, "金华": 252, "常德": 192, "延边": 59, "泰州": 122, "三亚": 120, "淮安": 150, "咸宁": 175, "无锡": 468, "常州": 259, "镇江": 223, "烟台": 420, "绍兴": 368, "莆田": 106, "东莞": 249, "佛山": 438, "株洲": 216, "黄石": 96, "孝感": 160]
def jwNewDistMap = ["北京": 510, "上海": 1353, "广州": 1193, "深圳": 697, "武汉": 1746, "大连": 539, "南京": 1219, "杭州": 2030, "太原": 631, "石家庄": 521, "重庆": 2165, "西安": 1518, "济南": 811, "宁波": 1023, "成都": 3192, "天津": 91, "昆明": 764, "南昌": 632, "青岛": 1420, "厦门": 274, "郑州": 1509, "长沙": 1474, "长春": 400, "合肥": 1112, "呼和浩特": 320, "沈阳": 648, "贵阳": 501, "拉萨": 75, "宝鸡": 217, "汕头": 350, "苏州": 1210, "温州": 628, "泉州": 407, "邯郸": 203, "唐山": 638, "沧州": 367, "洛阳": 509, "南阳": 311, "襄阳": 206, "吕梁": 48, "大同": 159, "潍坊": 1041, "南通": 883, "衡阳": 420, "中山": 457, "宜昌": 319, "许昌": 151, "盐城": 488, "济宁": 534, "龙岩": 161, "上饶": 205, "马鞍山": 181, "赣州": 380, "金华": 424, "常德": 305, "延边": 102, "泰州": 172, "三亚": 460, "淮安": 368, "咸宁": 223, "无锡": 509, "常州": 420, "镇江": 506, "烟台": 976, "绍兴": 608, "莆田": 226, "东莞": 1270, "佛山": 894, "株洲": 274, "黄石": 170, "孝感": 233]
def zgNewDistMap = ["南京": 711, "大连": 143, "青岛": 1117, "济南": 577, "昆明": 726, "中山": 466, "佛山": 852, "盐城": 384, "北京": 563, "无锡": 342, "东莞": 428, "烟台": 853, "厦门": 289, "南通": 325, "太原": 310, "泉州": 354, "贵阳": 1324, "马鞍山": 141, "上海": 1776, "苏州": 385, "郑州": 610, "常州": 230, "洛阳": 228, "潍坊": 795, "赣州": 238, "淮安": 268, "深圳": 1034, "长沙": 1252, "石家庄": 296, "金华": 156, "南昌": 383, "泰州": 255, "广州": 1193, "三亚": 341, "宁波": 475, "唐山": 382, "镇江": 495, "济宁": 330, "莆田": 213, "沧州": 155, "宝鸡": 173, "重庆": 634, "沈阳": 494, "长春": 182, "襄阳": 164, "天津": 556, "合肥": 366, "宜昌": 252, "温州": 428, "南阳": 379, "成都": 2452, "绍兴": 147, "呼和浩特": 337, "武汉": 845, "西安": 1407, "邯郸": 220, "常德": 259, "杭州": 568, "黄石": 143, "大同": 151, "许昌": 289, "延边": 72, "咸宁": 230, "拉萨": 60, "株洲": 225, "上饶": 210, "孝感": 229, "吕梁": 78, "汕头": 329, "龙岩": 150, "衡阳": 328]
def fields = ["city","region","district_name","estate_type","area","avg_price","total_price","direction","fitment","room","hall","toilet","floor","height","build_structure","comm_id","dataType1","purpose","root","url", "p_date"]
def no_fields = ["build_date","build_type","floor_info"]
static main(args) {
def task = new MingShengStat();
// task.run()
// task.addNewLevel
// task.addHouseRate()
// task.houseFieldStat()
task.addDistBuildStr()
// task.statFloorInfo()
}
def addDistBuildStr(){
def citys = ["北京","上海","广州","深圳","武汉","大连","南京","杭州","太原","石家庄","重庆","西安","福州","济南","宁波","成都","天津","昆明","南昌","青岛","厦门","郑州","长沙","长春","合肥","呼和浩特","沈阳","贵阳","拉萨","宝鸡","汕头","苏州","温州","泉州","邯郸","唐山","沧州","洛阳","南阳","襄阳","吕梁","大同","潍坊","南通","衡阳","中山","宜昌","许昌","盐城","济宁","龙岩","上饶","马鞍山","赣州","金华","常德","延边","泰州","三亚","淮安","咸宁","无锡","常州","镇江","烟台","绍兴","莆田","东莞","佛山","株洲","黄石","孝感","香港"]
def rows = []
for(def c : citys){
def row = []
row << c
def cityInfoDto = CommonDatautils.findCityInfo(c)
if(cityInfoDto){
def detailMap = cityInfoDto.district_detail
row << detailMap.finishBuildingDate.toDouble()*100
}
rows << row
}
ExcelUtils.write("D:\\数据\\民生\\字段覆盖率统计-竣工时间.xlsx", rows, "字段统计")
}
def houseFieldStat(){
def citys = ["北京","上海","广州","深圳","武汉","大连","南京","杭州","太原","石家庄","重庆","西安","福州","济南","宁波","成都","天津","昆明","南昌","青岛","厦门","郑州","长沙","长春","合肥","呼和浩特","沈阳","贵阳","拉萨","宝鸡","汕头","苏州","温州","泉州","邯郸","唐山","沧州","洛阳","南阳","襄阳","吕梁","大同","潍坊","南通","衡阳","中山","宜昌","许昌","盐城","济宁","龙岩","上饶","马鞍山","赣州","金华","常德","延边","泰州","三亚","淮安","咸宁","无锡","常州","镇江","烟台","绍兴","莆田","东莞","佛山","株洲","黄石","孝感","香港"]
def rows = []
for(def c : citys){
def row = []
row << c
def total = findHouseCount(c)
for(def f : no_fields){
def num = findValueByCity(c, f);
if(num){
def rate = com.fangjia.script.common.DataHandleUtils.getDoubleRound(4, num*100/total)
row << rate
}else{
row << 0
}
}
rows << row
}
ExcelUtils.write("D:\\数据\\民生\\字段覆盖率统计2.xlsx", rows, "字段统计")
}
def statFloorInfo(){
def file = "D:\\数据\\民生\\字段覆盖率统计-楼层.xlsx"
ExcelUtils.multiThreadingModify(file,{d->
def total = findHouseCount(d['A'])
if(total>=100000){
total = 100000
}
def num = findHouseDatas(d['A']);
if(num){
def rate = com.fangjia.script.common.DataHandleUtils.getDoubleRound(4, num*100/total)
d['C'] = rate
}else{
d['C'] = 0
}
})
}
def addHouseRate(){
// def datas = ExcelUtils.read("C:\\Users\\gaojuan\\Downloads\\估值数据统计结果20220816.xlsx",0,1)
ExcelUtils.multiThreadingModify("D:\\数据\\民生\\城市统计.xlsx",{d->
if(d['B']){
def cityInfoDto = CommonDatautils.findCityInfo(d['B'])
d['G'] = com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, cityInfoDto.price_coverage*100)
def dists = CommonDatautils.findAllDistrictByCity(d['B'], "district", ["city","region","name"])
d['F'] = dists.size()
d['D'] = statNewDistCount(d['B'])
d['E'] = findHouseCount(d['B'])
}
})
}
def findValueByCity(city, field){
def count = 0
def sql = "select count(*) as count from seawater where p_date >= 20200801 and city='${city}' and cat='sell' and ${field} is not null"
ElasticUtils.executeSqlQuery(sql, {
count = it.count
println("$city\t${field} ${it.count}")
})
return count
}
def findHouseDatas(city){
def sql = "select floor_info from seawater where p_date >= 20200801 and city='${city}' and cat='sell' order by p_date desc limit 100000"
def f_count = 0
def count = 0
ElasticUtils.executeSqlQuery(sql, {
count++
def s = it.floor_info
if(s && !s.contains("暂")){
f_count = f_count +1
}
println("${count} $city\t floor_info ${s}")
})
return f_count
}
def findHouseCount(city){
def count = 0
ElasticUtils.executeSqlQuery("select count(*) as count from seawater where p_date >= 20200801 and city='${city}' and cat='sell'", {
count = it.count
println("$city\t${it.count}")
})
return count
}
def statNewDistCount(def city){
def sum = 0
if(ajkNewDistsMap.get(city)){
sum = sum + ajkNewDistsMap.get(city)
}
if(bkNewDistsMap.get(city)){
sum = sum + bkNewDistsMap.get(city)
}
if(ljNewDistMap.get(city)){
sum = sum + ljNewDistMap.get(city)
}
if(sfNewDistMap.get(city)){
sum = sum + sfNewDistMap.get(city)
}
if(chNewDistMap.get(city)){
sum = sum + chNewDistMap.get(city)
}
if(jwNewDistMap.get(city)){
sum = sum + jwNewDistMap.get(city)
}
if(zgNewDistMap.get(city)){
sum = sum + zgNewDistMap.get(city)
}
return sum
}
def addNewLevel(){
ExcelUtils.modify("D:\\数据\\民生\\城市统计.xlsx",{d->
if(d['B']){
if(cityLevel0.contains(d['B'])){
d['D'] = "一线"
}else if(cityLevel1.contains(d['B'])){
d['D'] = "新一线"
}else if(cityLevel2.contains(d['B'])){
d['D'] = "二线"
}else if(cityLevel3.contains(d['B'])){
d['D'] = "三线"
}else if(cityLevel4.contains(d['B'])){
d['D'] = "四线"
}else if(cityLevel5.contains(d['B'])){
d['D'] = "五线"
}
}
})
}
def run(){
def citys = ["北京","上海","广州","深圳","武汉","大连","南京","杭州","太原","石家庄","重庆","西安","福州","济南","宁波","成都","天津","昆明","南昌","青岛","厦门","郑州","长沙","长春","合肥","呼和浩特","沈阳","贵阳","拉萨","宝鸡","汕头","苏州","温州","泉州","邯郸","唐山","沧州","洛阳","南阳","襄阳","吕梁","大同","潍坊","南通","衡阳","中山","宜昌","许昌","盐城","济宁","龙岩","上饶","马鞍山","赣州","金华","常德","延边","泰州","三亚","淮安","咸宁","无锡","常州","镇江","烟台","绍兴","莆田","东莞","佛山","株洲","黄石","孝感","香港"]
def rows = []
for(def c : citys){
def dbo = CommonDatautils.findAlCityDetail(c)
def row = []
if(dbo){
row << dbo.province
row << c
row << dbo.new_city_grade/1000
}else{
row << ""
row << c
row << ""
}
rows << row
}
ExcelUtils.write("D:\\数据\\民生\\城市统计.xlsx", rows, "数据")
}
}
@@ -1,17 +1,25 @@
package com.fangjia.script.gj.test
import ch.qos.logback.core.db.dialect.DBUtil
import com.fangjia.core.RegionData
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.lixue.util.DBUtils
import com.fangjia.script.util.CommonUtils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.DbUtils
import com.fangjia.script.util.ExcelUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import com.mongodb.Mongo
import groovy.sql.Sql
import org.bson.types.ObjectId
import java.text.SimpleDateFormat
def dist = CommonDatautils.findDistrictById("62ce233a3705890001dfa164")
DBUtils.seaweed.save(dist)
//DbUtils.seaweed.update(new BasicDBObject("_id", new ObjectId("62ce233a3705890001dfa164")), new BasicDBObject('$set', dist))
//SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
//Date date = new Date(1617211269868);
//print dateFormat.format(date);
@@ -50,13 +58,13 @@ import java.text.SimpleDateFormat
//}
def dists = CommonDatautils.findAllDistrictByCity("上海", "district", ["city","region","name","finish_building_date"])
def rets = []
for(def d : dists){
def year = CommonUtils.getDistrictAge(d)
rets << [d.city,d.region, d.name, year]
}
ExcelUtils.write("D:\\数据\\统计房龄.xlsx", rets, "数据")
//def dists = CommonDatautils.findAllDistrictByCity("ÉϺ£", "district", ["city","region","name","finish_building_date"])
//def rets = []
//for(def d : dists){
// def year = CommonUtils.getDistrictAge(d)
// rets << [d.city,d.region, d.name, year]
//}
//ExcelUtils.write("D:\\Êý¾Ý\\ͳ¼Æ·¿Áä.xlsx", rets, "Êý¾Ý")
@@ -0,0 +1,31 @@
package com.fangjia.script.jiangshu
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.OpenApiClient
class JsBlankTest {
static main(args) {
def task = new JsBlankTest();
task.run();
}
def run(){
def path = "D:\\Êý¾Ý\\½­ËÕ\\"
}
def match(path){
ExcelUtils.multiThreadingModify(path, { row ->
if(!row['Q'] && row['D']){
def city = row['B']
def address = row['D']
def region = row['C']
println "[match] city:"+city+" region:"+region+" address:"+address
def jsonObject = OpenApiClient.addressMatch(city, address, "property", false, region, null)
if(jsonObject != null && jsonObject.precise!=-1) {
row['Q'] = jsonObject.get("name")
row['R'] = jsonObject.get("id")
}
}
})
}
}
@@ -0,0 +1,102 @@
package com.fangjia.script.temp.shenjian.poi
import com.alibaba.fastjson.JSONObject
import com.fangjia.core.RegionData
import com.fangjia.script.statistics.poi.AmapPoi
import com.fangjia.script.statistics.poi.AmapPoiDetail
import com.fangjia.script.temp.shenjian.poi.entity.Community
import com.fangjia.script.temp.shenjian.util.CommonDtoUtils
import com.fangjia.script.temp.shenjian.util.EsUtils
import com.fangjia.script.temp.shenjian.util.GaoDeUtils
import com.fangjia.script.temp.shenjian.util.HttpUtils
import org.apache.commons.collections.CollectionUtils
import org.elasticsearch.action.bulk.BulkRequest
import org.elasticsearch.action.update.UpdateRequest
import org.elasticsearch.client.RequestOptions
import org.elasticsearch.index.query.QueryBuilder
import org.elasticsearch.index.query.QueryBuilders
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CountDownLatch
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicLong
import java.util.stream.Collectors
/**
* 逆解析第三方小区经纬度
*/
class ReGeoFromCommunity {
static final ExecutorService executorService = Executors.newFixedThreadPool(5)
static void main(String[] args) {
AtomicLong atomicLong = new AtomicLong(0)
Map<String, String> map = new ConcurrentHashMap<>()
def rets = this.findCommunities()
CountDownLatch countDownLatch = new CountDownLatch(rets.size())
final BulkRequest bulkRequest = new BulkRequest();
for (def retTemp : rets) {
final def ret = retTemp
executorService.submit(new Runnable() {
@Override
void run() {
try {
final String id = ret._id // 索引ID,并非小区ID
if (ret.location) {
String lon = ret.location.lon
String lat = ret.location.lat
def addressComponent = GaoDeUtils.reGeoLocation(lon + "," + lat)
if (addressComponent) {
def city_format = RegionData.formatCity(addressComponent.city)
def region_format = RegionData.formatRegion(city_format, addressComponent.district)
def township = addressComponent.township
Map<String, String> obj = new HashMap<>()
obj.put("city", city_format)
obj.put("region", region_format)
obj.put("township", township)
Map<String, Object> doc = new HashMap<>();
doc.put("address_component", obj)
bulkRequest.add(new UpdateRequest("community", id).doc(doc));
}
}
synchronized (map) {
map.put(id, id)
if (map.size() % 1000 == 0) {
atomicLong.addAndGet(map.size())
EsUtils.ES_CLIENT.bulk(bulkRequest, RequestOptions.DEFAULT)
bulkRequest = new BulkRequest();
map.clear()
println(atomicLong.intValue())
}
}
} catch(Exception ex) {
} finally {
countDownLatch.countDown()
}
}
})
};
countDownLatch.await();
if (map.size() > 0) {
atomicLong.addAndGet(map.size())
EsUtils.ES_CLIENT.bulk(bulkRequest, RequestOptions.DEFAULT)
bulkRequest = new BulkRequest();
map.clear()
println(atomicLong.intValue())
}
System.exit(1)
}
static def findCommunities(){
QueryBuilder queryBuilder = QueryBuilders.boolQuery()
.mustNot(QueryBuilders.existsQuery("address_component"))
.must(QueryBuilders.existsQuery("location"))
List<Community> communities = EsUtils.scrollQuery("community", queryBuilder, Community.class, 200000)
return communities
}
}
@@ -1,6 +1,6 @@
package com.fangjia.script.temp.shenjian.poi.entity;
package com.fangjia.script.temp.shenjian.poi.entity
public class Community extends MyId {
class Community extends MyLocation {
private String id;
private String city;
private String region;
@@ -0,0 +1,16 @@
package com.fangjia.script.temp.shenjian.poi.entity
import org.elasticsearch.common.geo.GeoPoint
class MyLocation extends MyId {
GeoPoint location;
GeoPoint getLocation() {
return location
}
void setLocation(GeoPoint location) {
this.location = location
}
}
@@ -3,12 +3,14 @@ package com.fangjia.script.temp.shenjian.util
import com.alibaba.fastjson.JSONObject
import com.fangjia.script.temp.shenjian.es.util.RestHighLevelClientUtils
import com.fangjia.script.temp.shenjian.poi.entity.MyId
import com.fangjia.script.temp.shenjian.poi.entity.MyLocation
import org.elasticsearch.action.DocWriteRequest
import org.elasticsearch.action.bulk.BulkRequest
import org.elasticsearch.action.search.*
import org.elasticsearch.action.update.UpdateRequest
import org.elasticsearch.client.RequestOptions
import org.elasticsearch.client.RestHighLevelClient
import org.elasticsearch.common.geo.GeoPoint
import org.elasticsearch.common.unit.TimeValue
import org.elasticsearch.index.query.QueryBuilder
import org.elasticsearch.search.Scroll
@@ -23,7 +25,7 @@ import org.slf4j.LoggerFactory
*/
class EsUtils {
private static RestHighLevelClient ES_CLIENT = RestHighLevelClientUtils.getClient()
public static RestHighLevelClient ES_CLIENT = RestHighLevelClientUtils.getClient()
private static final Logger logger = LoggerFactory.getLogger(EsUtils.class)
/**
@@ -35,7 +37,7 @@ class EsUtils {
* @param <T>
* @return
*/
public static <T extends MyId> List<T> scrollQuery(String index, QueryBuilder boolQuery, Class<T> clazz, def limitSize=300000) {
public static <T extends MyLocation> List<T> scrollQuery(String index, QueryBuilder boolQuery, Class<T> clazz, def limitSize=300000) {
List<T> result = new ArrayList<>();
// 存活时间,当索引数据量特别大时,出现超时可能性大,此值适当调大
Scroll scroll = new Scroll(TimeValue.timeValueMinutes(30L));
@@ -43,7 +45,11 @@ class EsUtils {
searchSourceBuilder.query(boolQuery);
// TEST 用!!!!!!!!!!!!!!!!!!!!!!
//searchSourceBuilder.size(1);
searchSourceBuilder.size(10000);
if (limitSize < 10000) {
searchSourceBuilder.size(limitSize)
} else {
searchSourceBuilder.size(10000)
}
SearchRequest searchRequest = new SearchRequest().indices(index).scroll(scroll).source(searchSourceBuilder);
SearchResponse searchResponse = null;
try {
@@ -57,6 +63,13 @@ class EsUtils {
for (SearchHit searchHit : searchHits) {
T t = JSONObject.parseObject(searchHit.getSourceAsString(), clazz);
t.set_id(searchHit.getId())
Map<String, Double> location = searchHit.getSourceAsMap().get("location")
if (location != null) {
Double lon = location["lon"]
Double lat = location["lat"]
GeoPoint geoPoint = new GeoPoint(lat, lon)
t.setLocation(geoPoint)
}
result.add(t);
}
}
@@ -24,10 +24,6 @@ import java.util.concurrent.atomic.AtomicInteger
*/
class GaoDeUtils {
// лñÈ¡key
def static GAO_DE_AK = ["4e9592208336433ee1b7aa4d1d434418", "10bcb421d2ee4e51ed9268d6dca58ad1"]
def static AtomicInteger keyUsed = new AtomicInteger(0)
def static codeNameMap = new HashMap<String, String>(){{
put("150500", "地铁");
put("1507", "公交");
@@ -54,6 +50,20 @@ class GaoDeUtils {
put("0601", "商场")
}};
/**
* 获取高德KEY
* @return
*/
static String getGaodeKey(String type) {
Map<String, String> params = new HashMap<>();
params.put("type", type)
JSONObject json = HttpRequestUtil.getJsonContent("http://192.168.0.100:38080/FangJiaDataService/getAmapKey", params)
if (json.status == 0 && json.result != null) {
return json.result
}
System.exit(1);
}
/**
* 查找周边配套
* @param city
@@ -66,7 +76,7 @@ class GaoDeUtils {
*/
static List searchNearByPoi(String city, String types, Double lng, Double lat, Integer radius, String keywords){
def params = [:]
params.key = GAO_DE_AK[keyUsed]
if (types) {
params.types = types
@@ -83,25 +93,17 @@ class GaoDeUtils {
while (result.size() < count) {
params.page = "${page}".toString()
page++
params.key = this.getGaodeKey("v3/place/around")
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v3/place/around", params);
if (json == null) {
params.key = this.getGaodeKey("v3/place/around")
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v3/place/around", params);
}
if (json && json.info && json.info == "OK") {
count = json.getString("count").toInteger()
result.addAll(DataUtil.toMongoDbObj(json.pois))
} else if (json && json.infocode && json.infocode == "10044") {
synchronized (this) {
for (int i = 0; i < GAO_DE_AK.size(); i++) {
if (GAO_DE_AK[i] == params.key) {
if (i + 1 >= GAO_DE_AK.size()) {
System.exit(1)
}
keyUsed = new AtomicInteger(i+1)
}
}
break;
}
System.exit(1)
} else if (json && json.infocode && json.infocode == "10004") {
// 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。
Thread.sleep(60000)
@@ -128,7 +130,6 @@ class GaoDeUtils {
*/
static List searchNearDtoByPoi(String city, String types, Double lng, Double lat, Integer radius, String keywords){
def params = [:]
params.key = GAO_DE_AK[keyUsed.intValue()]
if (types) {
params.types = types
@@ -145,8 +146,10 @@ class GaoDeUtils {
while (result.size() < count) {
params.page = "${page}".toString()
page++
params.key = this.getGaodeKey("v5/place/around")
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/around", params);
if (json == null) {
params.key = this.getGaodeKey("v5/place/around")
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/around", params);
}
if (json && json.info && json.info == "OK") {
@@ -158,26 +161,14 @@ class GaoDeUtils {
ex.printStackTrace()
}
} else if (json && json.infocode && json.infocode == "10044") {
synchronized (this) {
for (int i = 0; i < GAO_DE_AK.size(); i++) {
if (GAO_DE_AK[i] == params.key) {
if (i + 1 >= GAO_DE_AK.size()) {
System.exit(1)
}
keyUsed = new AtomicInteger(i+1)
}
}
break;
}
System.exit(1)
} else if (json && json.infocode && json.infocode == "10004") {
// 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。
Thread.sleep(60000)
break;
} else if (json && json.infocode && json.infocode == "10017") {
// 所请求的资源不可用
//System.exit(1)
Thread.sleep(60000)
break;
System.exit(1)
} else {
break
}
@@ -225,11 +216,12 @@ class GaoDeUtils {
*/
static List<AmapPoi> getAmapById(id){
def params = [:]
params.key = GAO_DE_AK[keyUsed.intValue()]
params.id = id
params.output = 'json'
params.key = this.getGaodeKey("v3/place/detail")
JSONObject json = HttpRequestUtil.getJsonContent("https://restapi.amap.com/v3/place/detail", params);
if (json == null) {
params.key = this.getGaodeKey("v3/place/detail")
json = HttpRequestUtil.getJsonContent("https://restapi.amap.com/v3/place/detail", params);
}
if (json && json.info && json.info == "OK") {
@@ -240,23 +232,13 @@ class GaoDeUtils {
ex.printStackTrace()
}
} else if (json && json.infocode && json.infocode == "10044") {
synchronized (this) {
for (int i = 0; i < GAO_DE_AK.size(); i++) {
if (GAO_DE_AK[i] == params.key) {
if (i + 1 >= GAO_DE_AK.size()) {
System.exit(1)
}
keyUsed = new AtomicInteger(i+1)
}
}
}
System.exit(1)
} else if (json && json.infocode && json.infocode == "10004") {
// 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。
Thread.sleep(60000)
} else if (json && json.infocode && json.infocode == "10017") {
// 所请求的资源不可用
//System.exit(1)
Thread.sleep(60000)
System.exit(1)
}
return Collections.emptyList()
}
@@ -266,11 +248,12 @@ class GaoDeUtils {
*/
static List<AmapPoiDetail> getAmapDetailById(id){
def params = [:]
params.key = GAO_DE_AK[keyUsed.intValue()]
params.id = id
params.output = 'json'
params.key = this.getGaodeKey("v3/place/detail")
JSONObject json = HttpRequestUtil.getJsonContent("https://restapi.amap.com/v3/place/detail", params);
if (json == null) {
params.key = this.getGaodeKey("v3/place/detail")
json = HttpRequestUtil.getJsonContent("https://restapi.amap.com/v3/place/detail", params);
}
if (json && json.info && json.info == "OK") {
@@ -281,23 +264,13 @@ class GaoDeUtils {
ex.printStackTrace()
}
} else if (json && json.infocode && json.infocode == "10044") {
synchronized (this) {
for (int i = 0; i < GAO_DE_AK.size(); i++) {
if (GAO_DE_AK[i] == params.key) {
if (i + 1 >= GAO_DE_AK.size()) {
System.exit(1)
}
keyUsed = new AtomicInteger(i+1)
}
}
}
System.exit(1)
} else if (json && json.infocode && json.infocode == "10004") {
// 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。
Thread.sleep(60000)
} else if (json && json.infocode && json.infocode == "10017") {
// 所请求的资源不可用
//System.exit(1)
Thread.sleep(60000)
System.exit(1)
}
return Collections.emptyList()
}
@@ -307,7 +280,6 @@ class GaoDeUtils {
*/
static List searchPoi(String city, String keywords, String region, String typecodes){
def params = [:]
params.key = GAO_DE_AK[keyUsed.intValue()]
params.keywords = keywords
params.city = city
params.region = region
@@ -324,8 +296,10 @@ class GaoDeUtils {
while (result.size() < count) {
params.page = "${page}".toString()
page++
params.key = this.getGaodeKey("v5/place/text")
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/text", params);
if (json == null) {
params.key = this.getGaodeKey("v5/place/text")
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/text", params);
}
if (json && json.info && json.info == "OK") {
@@ -337,17 +311,7 @@ class GaoDeUtils {
ex.printStackTrace()
}
} else if (json && json.infocode && json.infocode == "10044") {
synchronized (this) {
for (int i = 0; i < GAO_DE_AK.size(); i++) {
if (GAO_DE_AK[i] == params.key) {
if (i + 1 >= GAO_DE_AK.size()) {
System.exit(1)
}
keyUsed = new AtomicInteger(i+1)
}
}
break;
}
System.exit(1)
} else if (json && json.infocode && (json.infocode == "10004" || json.infocode == "10021" || json.infocode == "10017")) {
// 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。
Thread.sleep(60000)
@@ -370,19 +334,16 @@ class GaoDeUtils {
/**
* 经纬度转地址<br>
* 规则: 最多支持20个坐标点。多个点之间用"|"分割。经度在前,纬度在后,经纬度间以“,”分割,经纬度小数点后不得超过6位
* @author yinjihuan
* @date 2016Äê9ÔÂ9ÈÕ
* @param location
* @return
*/
static def getGaoDeAddress(location) {
Map<String, String> params = new HashMap<String, String>()
params.put("key", GAO_DE_AK[keyUsed.intValue()])
params.put("location", location)
String content
try {
params.put("key", this.getGaodeKey("v3/geocode/regeo"))
content = new HttpRequest().get("http://restapi.amap.com/v3/geocode/regeo", params, "utf-8")
} catch (Exception e) {
params.put("key", this.getGaodeKey("v3/geocode/regeo"))
content = new HttpRequest().get("http://restapi.amap.com/v3/geocode/regeo", params, "utf-8")
}
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(content)
@@ -393,16 +354,42 @@ class GaoDeUtils {
return regeocode.formatted_address;
}
} else if (json && json.infocode && json.infocode == "10044") {
synchronized (this) {
for (int i = 0; i < GAO_DE_AK.size(); i++) {
if (GAO_DE_AK[i] == params.key) {
if (i + 1 >= GAO_DE_AK.size()) {
System.exit(1)
}
keyUsed = new AtomicInteger(i+1)
}
}
System.exit(1)
} else if (json && json.infocode && json.infocode == "10004") {
// 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。
Thread.sleep(60000)
} else if (json && json.infocode && json.infocode == "10017") {
// 所请求的资源不可用
System.exit(1)
}
return null
}
/**
* 地址逆解析
* @param location
* @return 经度在前,纬度在后,经纬度间以“,”分割,经纬度小数点后不得超过6位
*/
static def reGeoLocation(location) {
Map<String, String> params = new HashMap<String, String>()
params.put("location", location)
String content
try {
params.put("key", this.getGaodeKey("v3/geocode/regeo"))
content = new HttpRequest().get("http://restapi.amap.com/v3/geocode/regeo", params, "utf-8")
} catch (Exception e) {
params.put("key", this.getGaodeKey("v3/geocode/regeo"))
content = new HttpRequest().get("http://restapi.amap.com/v3/geocode/regeo", params, "utf-8")
}
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(content)
Map<String, Object> infoMap = DataHandleUtils.JsonToMap(json);
if (infoMap && infoMap.info == "OK") {
def regeocode = infoMap.regeocode
if (regeocode) {
return regeocode.addressComponent
}
} else if (json && json.infocode && json.infocode == "10044") {
System.exit(1)
} else if (json && json.infocode && json.infocode == "10004") {
// 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。
Thread.sleep(60000)
@@ -418,13 +405,14 @@ class GaoDeUtils {
*/
static def parserByGaode(def city, def address) {
Map<String, String> params = new HashMap<String, String>()
params.put("key", GAO_DE_AK[keyUsed.intValue()])
params.put("city", city)
params.put("address", address)
String content
try {
params.put("key", this.getGaodeKey("v3/geocode/geo"))
content = new HttpRequest().get("https://restapi.amap.com/v3/geocode/geo", params, "utf-8")
} catch (Exception e) {
params.put("key", this.getGaodeKey("v3/geocode/geo"))
content = new HttpRequest().get("https://restapi.amap.com/v3/geocode/geo", params, "utf-8")
}
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(content)
@@ -437,16 +425,7 @@ class GaoDeUtils {
return ["lng": arrs[0], "lat": arrs[1]]
}
} else if (json && json.infocode && json.infocode == "10044") {
synchronized (this) {
for (int i = 0; i < GAO_DE_AK.size(); i++) {
if (GAO_DE_AK[i] == params.key) {
if (i + 1 >= GAO_DE_AK.size()) {
System.exit(1)
}
keyUsed = new AtomicInteger(i+1)
}
}
}
System.exit(1)
} else if (json && json.infocode && json.infocode == "10004") {
// 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。
Thread.sleep(60000)
@@ -455,4 +434,8 @@ class GaoDeUtils {
System.exit(1)
}
}
static void main(String[] args) {
println(this.getGaodeKey("v3/geocode/geo"))
}
}
@@ -40,11 +40,11 @@ class DataStat {
def run(){
def source = "Q·¿"//
def citys = findCrawlCity(source, 202204);
def source = "365ÌÔ·¿"//
def citys = findCrawlCity(source, 202206);
for(def city : citys){
def count1 = findCount(source, city, 202204);
def count2 = findCount(source, city, 202203);
def count1 = findCount(source, city, 202206);
def count2 = findCount(source, city, 202207);
println city +" "+count1+" "+count2
// println count1
// println "--- ----"
@@ -193,7 +193,7 @@ class Esf58Crawl extends BaseBatch{
//addContent("福州","https://fz.58.com/xiaoqu/", 70);
// "宁波","佛山","南通","烟台","临沂","呼和浩特","海口","广州",
def citys = ["宁波","大连","佛山","乌鲁木齐","济南","长春","兰州","石家庄","温州","烟台","太原","泉州","南通","呼和浩特","徐州","惠州","厦门","南昌","临沂","贵阳","嘉兴","常州","盐城","威海","淄博","深圳","中山","重庆","苏州","西宁","绍兴","洛阳","廊坊","昆明","金华","珠海","宜昌","南充","信阳","杭州","沧州","宿迁","南阳","德州","桂林","新乡","包头","遵义","乐山","株洲","德阳","眉山","驻马店","许昌","宜宾","衡水","泸州","营口","清远","达州","宝鸡","长沙","广安"]
def citys = ["¸£ÖÝ"]
for(def city : citys){
def str = cityList.get(city)
for(def i=0;i<1;i++){
@@ -21,7 +21,10 @@ class SynchDistrictPrice {
// "anjuke.com":"安居客","cityhouse.cn":"城市房产","zhuge.com":"诸葛找房","5i5j.com":"我爱我家","jiwu.com":"吉屋"]
//"fang.com":"搜房",
def sourceMap = ["ke.com":"贝壳找房","cityhouse.cn":"城市房产"]
def esSourceMap = ["ke.com":"±´¿Ç"]
//,"城市房产":"城市房产"
//"365淘房":"365淘房","贝壳":"贝壳找房","链家":"链家","Q房":"Q房","我爱我家":"我爱我家","麦田":"麦田","中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房",
def esSources = ["C21":"C21","365淘房":"365淘房"]//"吉屋":"吉屋","365淘房":"365淘房"
static main(args) {
def task = new SynchDistrictPrice()
// task.run()
@@ -30,21 +33,23 @@ class SynchDistrictPrice {
def run1(){
def citys = CommonUtils.findAllCity()
// citys.remove("上海")
// citys.remove("广州")
esSourceMap.each { k, v ->
esSources.each{esSource, mgSource->
for(def city : citys){
def rets = findAllEsData(city, v)
def rets = findAllEsData(city, esSource, mgSource)
println city +" "+rets.size()
synchData(city, rets, "±´¿ÇÕÒ·¿")
synchData(city, rets, mgSource)
}
}
}
def findAllEsData(city,source){
def findAllEsData(city,esSource, mgSource){
def names = new HashSet()
def rets = []
ElasticUtils.executeSqlQuery("select * from community where source='±´¿Ç' and city='${city}'", {d->
ElasticUtils.executeSqlQuery("select * from community where source='${esSource}' and city='${city}' and m_date>='2022-07-01' order by m_date", {d->
def s = d.city +"#"+d.region+"#"+d.name
if(!names.contains(s)){
names << s
@@ -54,8 +59,11 @@ class SynchDistrictPrice {
data.put("name", d.name)
data.put("address", d.address)
data.put("avg_price", d.avg_price)
data.put("source", source)
data.put("source", mgSource)
data.put("s_date", SHORT_DATE)
data.put("url", d.url)
data.put("c_date", new Date())
data.put("m_date", new Date())
rets << data
}
})
@@ -138,7 +146,7 @@ class SynchDistrictPrice {
def udata = new BasicDBObject()
udata.put("avg_price", r.avg_price)
udata.put("m_date",new Date())
thirdPartyColl.update(new BasicDBObject('_id',obj._id), udata)
thirdPartyColl.update(new BasicDBObject('_id',obj._id), new BasicDBObject('$set', udata))
}else{
try{
@@ -14,8 +14,8 @@ class TestCrawlTotalCount {
def run(){
def sources = ["房估估","诸葛找房","安居客","搜房","中原地产","赶集","链家","兔博士","城市房产","贝壳找房","Q房","Q房(新)","中原地产(新)","乐有家","乐有家(新)","房探","房多多","小资家","我爱我家","麦田","房途","C21","乐居","房产超市","58同城","365淘房","吉屋"]
for(def source :sources){
def count1 = findTotalCount(source, 202205);
def count2 = findTotalCount(source, 202206);
def count1 = findTotalCount(source, 202206);
def count2 = findTotalCount(source, 202207);
println source +" "+count1 +" "+count2
}
}
@@ -15,7 +15,8 @@ import org.apache.commons.lang.StringUtils
public class DistrictRegionTransfer {
static final DBCollection TASK_COLL = MongoUtils.getCollectionByName("fangjia", "district_update_task", "mongo.db.fangjia.com")
static final DBCollection DISTRICT_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_stat", "mongo.db.fangjia.com")
static final DBCollection SQMETRE_RENT = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com")
static final DBCollection REGION_MIGRATE_COLL = MongoUtils.getCollectionByName("fangjia_log", "region_migrate", "mongo.db.fangjia.com")
static final List<String> IGNORE_FIELDS = ["_id", "region", "city", "flag", "estate_type2", "c_date", "m_date", "other_info", "mark_map", "addr_alias", "alias", "name", "address", "status"]
static List ALL_CITY = CommonUtils.findAllCity()
@@ -31,15 +32,24 @@ public class DistrictRegionTransfer {
copyDistrictInfo(orgDistrict, destDistrict)
DbUtils.seaweed.save(destDistrict)
DbUtils.deleteOnSeaweed(orgDistrict._id.toString())
sendRelatedInfoMigrateCommand(orgDistrict, destDistrict)
saveMigrateLog(orgDistrict, destDistrict)
} else {
destDistrict = (BasicDBObject) orgDistrict.clone()
destDistrict.city = newCity
destDistrict.region = newRegion
DbUtils.seaweed.save(destDistrict)
sendRelatedInfoMigrateCommand(orgDistrict, destDistrict)
saveMigrateLog(orgDistrict, destDistrict)
DISTRICT_STAT.remove(new BasicDBObject("city", newCity).append("region", newRegion).append("district_name", orgDistrict.name))
DISTRICT_STAT.find(new BasicDBObject("city", newCity).append("region", orgDistrict.region).append("district_name", orgDistrict.name)).each {BasicDBObject stat->
stat.region = newRegion
DISTRICT_STAT.save(stat)
}
SQMETRE_RENT.remove(new BasicDBObject("city", newCity).append("region", newRegion).append("district_name", orgDistrict.name))
SQMETRE_RENT.find(new BasicDBObject("city", newCity).append("region", orgDistrict.region).append("district_name", orgDistrict.name)).each {BasicDBObject stat->
stat.region = newRegion
SQMETRE_RENT.save(stat)
}
}
}
@@ -60,72 +70,72 @@ public class DistrictRegionTransfer {
}
}
def sendRelatedInfoMigrateCommand(BasicDBObject orgDistrict, BasicDBObject destDistrict) {
BasicDBObject task = new BasicDBObject()
task.append("city", orgDistrict.city)
task.append("new_city", destDistrict.city)
task.append("region", orgDistrict.region)
task.append("new_region", destDistrict.region)
task.append("new_name", orgDistrict.name)
task.append("name", destDistrict.name)
task.append("type", 2)
task.append("c_date", new Date())
task.append("status", 1)
String estateType;
if ("district" == orgDistrict.cat) {
if (StringUtils.isNotBlank(destDistrict.estate_type2)) {
if (destDistrict.getString("estate_type2").contains("别墅")) {
estateType = "villa"
} else {
estateType = "district"
}
} else {
if (StringUtils.isNotBlank(destDistrict.estate_type2)) {
if (destDistrict.getString("estate_type").contains("别墅")) {
estateType = "villa"
} else {
estateType = "district"
}
} else {
estateType = "district"
}
}
} else {
estateType = destDistrict.getString("cat")
}
task.append("estate_type", estateType)
def query = new BasicDBObject()
query.append("city", task.city)
query.append("region", task.region)
query.append("name", task.name)
query.append("type", task.type)
TASK_COLL.update(query, new BasicDBObject('$set', task), true, false)
def params = [:]
params.city = orgDistrict.city
params.region = orgDistrict.region
params.name = orgDistrict.name
params.estateType = orgDistrict.estate_type2
params.newCity = destDistrict.city
params.newRegion = destDistrict.region
params.newName = destDistrict.name
params.newEstateType = destDistrict.estate_type2
int count = 3
while (count-- > 0) {
try {
JSONObject json = new HttpRequest().getJsonContent("http://192.168.0.24:9080/command/transfer", params, "UTF-8")
if (json && json.getInt("code") == 200) {
println("均价重算命令发从成功:" + params)
break
}
} catch (Exception e) {
}
}
}
// def sendRelatedInfoMigrateCommand(BasicDBObject orgDistrict, BasicDBObject destDistrict) {
//
// BasicDBObject task = new BasicDBObject()
// task.append("city", orgDistrict.city)
// task.append("new_city", destDistrict.city)
// task.append("region", orgDistrict.region)
// task.append("new_region", destDistrict.region)
// task.append("new_name", orgDistrict.name)
// task.append("name", destDistrict.name)
// task.append("type", 2)
// task.append("c_date", new Date())
// task.append("status", 1)
// String estateType;
// if ("district" == orgDistrict.cat) {
// if (StringUtils.isNotBlank(destDistrict.estate_type2)) {
// if (destDistrict.getString("estate_type2").contains("别墅")) {
// estateType = "villa"
// } else {
// estateType = "district"
// }
// } else {
// if (StringUtils.isNotBlank(destDistrict.estate_type2)) {
// if (destDistrict.getString("estate_type").contains("别墅")) {
// estateType = "villa"
// } else {
// estateType = "district"
// }
// } else {
// estateType = "district"
// }
// }
// } else {
// estateType = destDistrict.getString("cat")
// }
// task.append("estate_type", estateType)
// def query = new BasicDBObject()
// query.append("city", task.city)
// query.append("region", task.region)
// query.append("name", task.name)
// query.append("type", task.type)
// TASK_COLL.update(query, new BasicDBObject('$set', task), true, false)
//
// def params = [:]
// params.city = orgDistrict.city
// params.region = orgDistrict.region
// params.name = orgDistrict.name
// params.estateType = orgDistrict.estate_type2
//
// params.newCity = destDistrict.city
// params.newRegion = destDistrict.region
// params.newName = destDistrict.name
// params.newEstateType = destDistrict.estate_type2
// int count = 3
// while (count-- > 0) {
// try {
// JSONObject json = new HttpRequest().getJsonContent("http://192.168.0.24:9080/command/transfer", params, "UTF-8")
// if (json && json.getInt("code") == 200) {
// println("均价重算命令发从成功:" + params)
// break
// }
// } catch (Exception e) {
//
// }
//
// }
// }
def saveMigrateLog(BasicDBObject orgDistrict, BasicDBObject destDistrict) {
@@ -8,10 +8,10 @@ import static com.mongodb.client.model.Filters.*
import com.fangjia.core.util.Mongo3Utils
def city = "쭤捺"
def destCity = "쭤捺"
def region = "섈적"
def destRegion = "촙쏠"
def city = "中山"
def destCity = "中山"
def region = "火炬"
def destRegion = "中山港"
@@ -45,6 +45,9 @@ import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import net.sf.json.JSONObject
import org.apache.commons.lang.StringUtils
import org.elasticsearch.index.query.BoolQueryBuilder
import org.elasticsearch.index.query.QueryBuilders
//DBCollection SEAWEED_TOWNSHIP = MongoUtils.getCollectionByName("fangjia_base", "seaweed_township", "192.168.0.235", 27018)
//def count = 0
//List<List<String>> data = Collections.synchronizedList([])
@@ -145,12 +148,41 @@ import org.apache.commons.lang.StringUtils
// }
//},sheetIndex = 1)
//ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Downloads\\moban (3).xls",{List item->
// item["B"] = RegionData.formatRegion(item["A"], item["B"])
// println(item)
//})
int count = 0
DbUtils.seaweed.find(DbUtils.buildSeaweedQuery("¶«Ý¸")).each {def a->
count += 1
}
println(count)
ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Desktop\\小区字段补充.xlsx",{List item->
BasicDBObject seaweed = DbUtils.seaweed.findById(item["A"])
if(StringUtils.isBlank(seaweed.create_year)){
def names = []
names.add(seaweed.name)
if(seaweed.alias){
for(def it in seaweed.alias){
if(StringUtils.isNotBlank(it) && !names.contains(it)){
names.add(it)
}
}
}
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery()
boolQueryBuilder.must(QueryBuilders.termQuery("city", seaweed.city))
boolQueryBuilder.must(QueryBuilders.termQuery("region", seaweed.region))
boolQueryBuilder.must(QueryBuilders.termsQuery("name", names));
item["B"] = seaweed.city
item["C"] = seaweed.region
item["D"] = seaweed.name
List result = ElasticUtils.executeSimpleQuery("192.168.0.206", "community", boolQueryBuilder)
def buildYears = []
result.each {
if(StringUtils.isNotBlank(it.build_year) && !StringUtils.containsAny(it.build_year,"无")){
String build_year = it.build_year
build_year = build_year.replaceAll("((|\\().*()|\\))", "")
build_year = build_year.replaceAll("[年建]", "")
// property_fee = property_fee.replace("元/㎡·月", "元/平米/月")
buildYears.add(build_year)
}
}
buildYears = buildYears.unique()
if(buildYears.size() > 0){
DbUtils.seaweed.update(new BasicDBObject("_id", seaweed._id), new BasicDBObject('$set', new BasicDBObject('create_year', buildYears[0])))
println(item)
println(buildYears)
}
}
})
@@ -38,8 +38,8 @@ class BasicInfoDataSynch extends BaseBatch{
synchRegion()
synchTown()
synchDict()
synchDistrict("district")
synchDistrict("office")
// synchDistrict("district")
// synchDistrict("office")
}
def synchCitys(){
@@ -299,7 +299,7 @@ class BasicInfoDataSynch extends BaseBatch{
}
def synchDistrictByCity(fjCity, districts, cat){
def zsDistrictCursor = ZS_SEAWEED_CONN.find(new BasicDBObject("city", fjCity).append("cat", cat))
def zsDistrictCursor = ZS_SEAWEED_CONN.find(new BasicDBObject("city", fjCity).append("category", cat))
def zsDistricts = []
def zsDistrictMap = [:]
def fjDistrictMap = [:]
@@ -322,7 +322,6 @@ class BasicInfoDataSynch extends BaseBatch{
udata.put("estate_type",fjDistrict.estate_type2)
udata.put("township",fjDistrict.township)
udata.put("alias",fjDistrict.alias)
udata.put("cat",cat)
udata.put("update_date",new Date().getTime())
if(fjDistrict.addr_alias){
udata.put("addr_alias",fjDistrict.addr_alias)
@@ -1042,7 +1042,7 @@ public class EvaluationServiceImpl implements EvaluationService {
evaluation.setTotalPrice(((Number) (totalPrice)).intValue());
evaluation.setEvaluateWay(sqmetreRent.getSampleEnum());
evaluation.setEvaluateWay(sqmetreRent.getValueType());
evaluation.setCredit(sqmetreRent.getCredit());
}else{
evaluation.setTotalPrice(null);
@@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.fangjia.dal.common.DistrictKey;
import com.fangjia.dal.mongo.model.SqmetreRent;
public interface SqmetreRentService {
@@ -28,4 +29,5 @@ public interface SqmetreRentService {
SqmetreRent findNearestSqmetreRent(String city, String region, String name, String cat);
List<SqmetreRent> findAllAvgPriceByKeys(DistrictKey districtKey, String cat);
}

Some files were not shown because too many files have changed in this diff Show More