From abd3be9e49b2653899762d389df658d48e49d190 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Tue, 2 Sep 2025 11:37:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/gj/data_handle/ThirdPriceMappingBatch.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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){ From e76180b1c5ec572a6f2c11bbed3f2a7490088f18 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Tue, 2 Sep 2025 11:38:28 +0800 Subject: [PATCH 2/4] add --- .../fangjia/script/gj/meituan/AddField.groovy | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/meituan/AddField.groovy 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 + } + }) + } + +} From 36ae7e5a37c8ecdacd8616749677d6ca85c3f204 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Tue, 2 Sep 2025 11:40:30 +0800 Subject: [PATCH 3/4] add --- .../script/gj/house/ExportArroundHouse.groovy | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/ExportArroundHouse.groovy 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 Date: Tue, 2 Sep 2025 12:07:02 +0800 Subject: [PATCH 4/4] update --- .../data_handle/ThirdPriceMappingBatch.groovy | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 0e8f5c83e..f9ea5362b 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 @@ -39,16 +39,17 @@ class ThirdPriceMappingBatch extends BaseBatch{ @Override public void process(Object args) { + def citys = ["北京","厦门","泉州","安顺"]//CommonUtils.findAllCity() // //将新增数据同步过来 - addNemCommunity() +// addNemCommunity(citys) //// //接口进行匹配 - match() + match(citys) - addOldMatchResult() + addOldMatchResult(citys) } - def match(){ - def citys = ["北京","厦门","泉州","安顺"]//CommonUtils.findAllCity() + def match(citys){ + def index = 0 for(def c : citys){ index ++ @@ -114,8 +115,8 @@ class ThirdPriceMappingBatch extends BaseBatch{ return addCount.get(); } - def addNemCommunity(){ - def citys = ["北京","厦门","泉州","安顺"] //CommonUtils.findAllCity() + def addNemCommunity(citys){ +// def citys = ["北京","厦门","泉州","安顺"] //CommonUtils.findAllCity() def total = 0 def index = 0 for(def c : citys){ @@ -172,8 +173,8 @@ class ThirdPriceMappingBatch extends BaseBatch{ return addCount.get(); } - def addOldMatchResult(){ - def citys = CommonUtils.findAllCity() + def addOldMatchResult(citys){ +// def citys = CommonUtils.findAllCity() def keys = new BasicDBObject() keys.put("_id", 1) keys.put("city", 1)