From 4fb29fc530bd8361f4bfb8bf67ee8dc4ba33cc05 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 15 Aug 2023 17:07:59 +0800 Subject: [PATCH 1/2] update --- .../com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy | 5 +++-- .../com/fangjia/script/fuzhou/ThirdPriceExportBatch.groovy | 6 +++--- .../fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy index 3b25072f8..459e3e505 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy @@ -140,6 +140,7 @@ class DistrictSellStatBatch extends BaseBatch { try { totalCount.addAndGet(1) def key = dist.region +"##" + dist.name + def weekendPriceObj = weekendPriceMap.get(key) if(weekendPriceObj){ def curPriceObj = curMonthlyPriceMap.get(key) @@ -155,7 +156,7 @@ class DistrictSellStatBatch extends BaseBatch { if(curPriceObj){ curPrice = curPriceObj.avg_price }else{ - curPrice = weekendPriceObj.avg_price + curPrice = weekendPriceObj.avg_price } if(weekendPriceObj.value_type!=1){ @@ -197,7 +198,7 @@ class DistrictSellStatBatch extends BaseBatch { data.put("commid", dist._id.toString()) data.put("mom", mom) data.put("yoy", yoy) - data.put("avg_price", curPrice) + data.put("avg_price", weekendPriceObj.avg_price) DISTRICT_SELL_STAT.update(new BasicDBObject("_id", curPriceObj._id) , new BasicDBObject('$set', data),true,false) println "[update]"+totalCount.get()+" "+ dist.city+" "+dist.name } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/ThirdPriceExportBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/ThirdPriceExportBatch.groovy index f7dcc4293..11d76c586 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/ThirdPriceExportBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/ThirdPriceExportBatch.groovy @@ -76,7 +76,7 @@ class ThirdPriceExportBatch extends BaseBatch{ row << dist.name row << o.s_date - def zgf_price = getLastThirdPrice(o.zhugezhaofang_esf_price, curPrice) + def zgf_price = getLastThirdPrice(o.xingfuli_esf_price, curPrice) row << zgf_price if(zgf_price){ add = true; @@ -217,8 +217,8 @@ class ThirdPriceExportBatch extends BaseBatch{ if(!retMap.s_date){ retMap.s_date = curDate } - if(!retMap.zhugezhaofang_esf_price && d.zhugezhaofang_esf_price){ - retMap.zhugezhaofang_esf_price = d.zhugezhaofang_esf_price + if(!retMap.xingfuli_esf_price && d.xingfuli_esf_price){ + retMap.xingfuli_esf_price = d.xingfuli_esf_price } if(!retMap.anjuke_esf_price && d.get("anjuke_esf_price")){ retMap.anjuke_esf_price = d.get("anjuke_esf_price") diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy index 1d0ca1224..18fdb2d2f 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy @@ -64,7 +64,7 @@ class DataStandardBatch extends BaseBatch{ def static final SHORT_DATE = Utils.getLastMonth() def static final statusMap = ["城市未匹配":1,"区域未匹配":2,"小区匹配失败":3,"小区匹配成功":4,"异常错误":5, "无价格":6, "无名称":7] - def static final websites = ["房估估","诸葛找房","安居客","搜房","中原地产","赶集", "链家","兔博士","城市房产","贝壳找房","Q房","Q房(新)","中原地产(新)","我爱我家","麦田","房途","C21","乐居","房产超市","58同城","365淘房","吉屋"] + def static final websites = ["房估估","诸葛找房","安居客","搜房","中原地产","赶集", "链家","兔博士","城市房产","贝壳找房","Q房","Q房(新)","中原地产(新)","我爱我家","麦田","房途","C21","乐居","房产超市","58同城","365淘房","吉屋","幸福里"] public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10) static { thirdPartyColl = CrawalDBUtil.getThirdPartyCol(); @@ -92,7 +92,7 @@ class DataStandardBatch extends BaseBatch{ cityMap.each{city,alias-> println "开始加载【${city}】" -// if(city == "石家庄"){ +// if(city == "福州"){ def detailMap = CommonDatautils.findAllCityDistrictNameAndAlias(city, "district", ["city","region","name","address","alias","addr_alias","mapping_alias","estate_type2"]) districtMap.putAll(detailMap) // } From af35c80ff01c5b71ad9090c7c35ad7ea42a209a4 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 15 Aug 2023 17:09:47 +0800 Subject: [PATCH 2/2] update --- .../fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy | 4 ++-- .../script/thirdPriceCrawl/ThirdDataToGatherBatch.groovy | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy index 175b2ebd1..7c9ed802c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy @@ -27,7 +27,7 @@ class SynchDistrictPrice extends BaseBatch{ // "吉屋":"吉屋","365淘房":"365淘房","我爱我家":"我爱我家","诸葛找房APP":"诸葛找房","贝壳":"贝壳找房","链家":"链家","Q房":"Q房","麦田":"麦田", // "中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房","乐有家":"乐有家","C21":"C21","城市房产":"城市房产","兔博士PC端":"兔博士" // def esSources = ["我爱我家":"我爱我家","兔博士PC端":"兔博士","吉屋":"吉屋","贝壳找房":"贝壳找房","乐有家":"乐有家","365淘房":"365淘房","诸葛找房APP":"诸葛找房","链家":"链家","Q房":"Q房","麦田":"麦田","中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房","C21":"C21","城市房产":"城市房产"] - def esSources = ["我爱我家":"我爱我家","兔博士PC端":"兔博士","吉屋":"吉屋","贝壳找房":"贝壳找房","乐有家":"乐有家","365淘房":"365淘房","诸葛找房APP":"诸葛找房","链家":"链家","Q房":"Q房","麦田":"麦田","中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房","C21":"C21","城市房产小程序":"城市房产"] + def esSources = ["我爱我家":"我爱我家","兔博士PC端":"兔博士","吉屋":"吉屋","贝壳找房":"贝壳找房","乐有家":"乐有家","365淘房":"365淘房","诸葛找房APP":"诸葛找房","链家":"链家","Q房":"Q房","麦田":"麦田","中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房","C21":"C21","城市房产":"城市房产","幸福里APP":"幸福里"] static main(args) { runBatch(new SynchDistrictPrice(), args); @@ -41,7 +41,7 @@ class SynchDistrictPrice extends BaseBatch{ def run1(){ println "starting......" - def mdate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), -1), "yyyy-MM-dd") + def mdate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), 0), "yyyy-MM-dd") def citys = CommonUtils.findAllCity() esSources.each{esSource, mgSource-> for(def city : citys){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/ThirdDataToGatherBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/ThirdDataToGatherBatch.groovy index 4fe5dd4a7..ad821196e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/ThirdDataToGatherBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/ThirdDataToGatherBatch.groovy @@ -32,7 +32,7 @@ class ThirdDataToGatherBatch extends BaseBatch{ "房估估":"fanggugu_esf","诸葛找房":"zhugezhaofang_esf","安居客":"anjuke_esf","搜房":"soufang_esf","中原地产":"zhongyuan_esf","赶集":"ganji_esf", "链家":"lianjia_esf","兔博士":"tuboshi_esf","城市房产":"cityhouse_esf","贝壳找房":"beike_esf","Q房":"qfang_esf","Q房(新)":"qfang_new","中原地产(新)":"zhongyuan_new", "乐有家":"leyoujia_esf","乐有家(新)":"leyoujia_new","房探":"fangtan_esf","房多多":"fangdoudou_esf","小资家":"xiaozijia_esf","我爱我家":"5i5j_esf","麦田":"maitian_esf", - "房途":"fangtoo_esf","C21":"c21_esf","乐居":"leju_esf","房产超市":"fccs_esf","58同城":"58tc_esf","365淘房":"365house_esf","吉屋":"jiwu_esf" + "房途":"fangtoo_esf","C21":"c21_esf","乐居":"leju_esf","房产超市":"fccs_esf","58同城":"58tc_esf","365淘房":"365house_esf","吉屋":"jiwu_esf","幸福里":"xingfuli_esf" ] public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(2)