diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/ThirdPriceMappingBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/ThirdPriceMappingBatch.groovy index 7560c83ef..0e8f5c83e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/ThirdPriceMappingBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/ThirdPriceMappingBatch.groovy @@ -31,7 +31,7 @@ class ThirdPriceMappingBatch extends BaseBatch{ final DBCollection dataProcessColl = MongoUtils.getCollectionByName("fangjia_craw", "data_process", "192.168.0.235", 27018) - def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); + def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -2, "yyyyMM")); static main(args) { runBatch(new ThirdPriceMappingBatch(), args); @@ -40,7 +40,7 @@ class ThirdPriceMappingBatch extends BaseBatch{ @Override public void process(Object args) { // //将新增数据同步过来 -// addNemCommunity() + addNemCommunity() //// //接口进行匹配 match() @@ -48,7 +48,7 @@ class ThirdPriceMappingBatch extends BaseBatch{ } def match(){ - def citys = CommonUtils.findAllCity() + def citys = ["北京","厦门","泉州","安顺"]//CommonUtils.findAllCity() def index = 0 for(def c : citys){ index ++ @@ -115,7 +115,7 @@ class ThirdPriceMappingBatch extends BaseBatch{ } def addNemCommunity(){ - def citys = CommonUtils.findAllCity() + def citys = ["北京","厦门","泉州","安顺"] //CommonUtils.findAllCity() def total = 0 def index = 0 for(def c : citys){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/ExportArroundHouse.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/ExportArroundHouse.groovy new file mode 100644 index 000000000..9ba0891ab --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/ExportArroundHouse.groovy @@ -0,0 +1,72 @@ +package com.fangjia.script.gj.house + +import com.fangjia.core.util.GeoUtils +import com.fangjia.script.commData.CommonDatautils +import com.fangjia.script.util.CommonUtils +import com.fangjia.script.util.ExcelUtils + +/** + * 导出某小区周边房源 + */ +class ExportArroundHouse { + + static main(args) { + def task = new ExportArroundHouse() + task.run() + } + + def run(){ + def name = "南山雨果" + def lng = 121.270784 + def lat = 31.160661 + def districts = CommonDatautils.getDistrictArround("上海", lng, lat) + def startPrice = 45000 + def endPrice = 50000 + def lastHouses = [] + for(def d : districts){ + def distance = GeoUtils.calculateDistance(lng, lat, d.lng/10000000000.0, d.lat/10000000000.0); + println d.name +" 相距:"+distance + def houses = CommonDatautils.findHouses(d.city, d.region, "sell", 20240829, 20250901, d.name, d.alias, d.estate_type2) + for(def h : houses){ + if(h.avg_price>startPrice && h.avg_price +// def data = fullCityMap.get(d['A']) +// if(data){ +// def q = new BasicDBObject() +// q.put("city", data.city) +// def count = seaweed_fs_coll.count(q) +// d['B'] = count +// } + def dists= CommonDatautils.findAllDistricts(d['A'], "district", ["car_site_count","household_count"]) + if(dists){ + def total = 0 + for(def dist : dists){ + if(dist.car_site_count && dist.household_count){ + total ++ + } + } + d['C'] = total + } + }) + } + } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/meituan/AddField.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/meituan/AddField.groovy new file mode 100644 index 000000000..1b9af5b23 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/meituan/AddField.groovy @@ -0,0 +1,46 @@ +package com.fangjia.script.gj.meituan + +import com.fangjia.script.commData.CommonDatautils +import com.fangjia.script.util.ExcelUtils + +class AddField { + + static main(args) { + def task = new AddField() + task.run() + } + + def run(){ + ExcelUtils.multiThreadingModify("D:\\数据\\美团\\小区测试需求测试-结果0828.xlsx",{d-> + def obj = CommonDatautils.findDistrictById(d['F']) + if(obj){ + d['G'] = obj.city + d['H'] = obj.region + d['I'] = obj.name + d['J'] = obj.address + d['K'] = obj.estate_type2 + d['L'] = obj.build_type + d['M'] = obj.township + d['N'] = obj.business_quarter + d['O'] = obj.household_count + d['P'] = obj.car_site_count + d['Q'] = obj.estate_charge + if(obj.create_year){ + d['R'] = obj.create_year + }else if(obj.build_date){ + d['R'] = obj.build_date + }else if(obj.finish_building_date) { + d['R'] = obj.finish_building_date + } +// d['S'] = obj.live_date + d['T'] = obj.all_area + d['U'] = obj.build_area + d['V'] = obj.cubage_percent + d['W'] = obj.virescence_percent + d['X'] = obj.developer + d['Y'] = obj.estate_company + } + }) + } + +}