Merge branch 'script_gj' into 'master'

Script gj

See merge request !326
This commit is contained in:
2022-06-20 15:52:05 +08:00
2 changed files with 10 additions and 8 deletions
@@ -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, 20220418, 20220519);
exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20220518, 20220619);
// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20210801, 20210831);
//测试通过匹配接口配房源效果
// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20201201, 20211118)
@@ -41,19 +41,21 @@ class SynchDistrictPrice {
}
def findAllEsData(){
def findAllEsData(source){
def names = new HashSet()
def rets = []
ElasticUtils.executeSqlQuery("select * from community where source='贝壳'", {d->
def s = d.city +"#"+d.region+"#"+d.name
if(!names.contains(s)){
names << s
d.put("district_id", d.url)
d.put("source", source)
d.put("s_date", SHORT_DATE)
d.removeField("root")
d.removeField("url")
d.removeField("_id")
def data = new BasicDBObject()
data.put("city", d.city)
data.put("region", d.region)
data.put("name", d.name)
data.put("address", d.address)
data.put("avg_price", d.avg_price)
data.put("source", source)
data.put("s_date", SHORT_DATE)
rets << d
}
})