diff --git a/projects/fangjia-script/pom.xml b/projects/fangjia-script/pom.xml index 4d31f29ec..e04dc02ff 100644 --- a/projects/fangjia-script/pom.xml +++ b/projects/fangjia-script/pom.xml @@ -542,16 +542,16 @@ aliyun-java-sdk-address-purification 1.0.1 - - - - - - - - - - + + com.aliyun + aliyun-java-sdk-core + 4.5.9 + + + com.alibaba + fastjson + 1.2.83 + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/GuangdaTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/GuangdaTest.groovy index 110cb3ce8..7d683c976 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/GuangdaTest.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/GuangdaTest.groovy @@ -1,6 +1,7 @@ package com.fangjia.script.gj.village import com.fangjia.core.util.HttpRequest +import com.fangjia.script.gj.village.ailiyun.SignatureUtils import com.fangjia.script.util.CosineSimilarAlgorithm import com.fangjia.script.util.ExcelUtils import com.fangjia.script.util.MongoUtils @@ -61,19 +62,19 @@ def filePath = "D:\\ // } // } -// def retMap = SignatureUtils.getBaiduAddressStrc(row['A']) -// println row['A'] +" " + retMap.toString() -// if(retMap){ -// row['Y'] = retMap.prov -// row['Z'] = retMap.city -// row['AA'] = retMap.district -// row['AB'] = retMap.town -// row['AC'] = retMap.devzone -// row['AD'] = retMap.road -// row['AE'] = retMap.roadno -// row['AF'] = retMap.poi -// row['AG'] = retMap.subpoi -// } + def retMap = SignatureUtils.getAliAddressStrc(row['A']) + println row['A'] +" " + retMap.toString() + if(retMap){ + row['Y'] = retMap.prov + row['Z'] = retMap.city + row['AA'] = retMap.district + row['AB'] = retMap.town + row['AC'] = retMap.devzone + row['AD'] = retMap.road + row['AE'] = retMap.roadno + row['AF'] = retMap.poi + row['AG'] = retMap.subpoi + } // }) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/ailiyun/SignatureUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/ailiyun/SignatureUtils.groovy index c0bff3a99..6dd3714bb 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/ailiyun/SignatureUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/ailiyun/SignatureUtils.groovy @@ -146,7 +146,7 @@ public class SignatureUtils { // } - public static def getBaiduAddressStrc(def address) { + public static def getAliAddressStrc(def address) { DefaultProfile defaultProfile = DefaultProfile.getProfile( "cn-hangzhou", Config.accessKey, diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStat.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStat.groovy index 595fdeafb..49136a392 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStat.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStat.groovy @@ -23,8 +23,8 @@ class DataStat { // for(def city :citys){ // println city // } - task.run(); -// task.stat() +// task.run(); + task.stat() // def citys = ["福州", "厦门", "泉州", "莆田", "宁德", "三明", "龙岩", "南平", "漳州"] // def rets = [] @@ -76,12 +76,8 @@ class DataStat { } def stat(){ - def dates = [201810,201811,201812,201901,201902,201903,201904,201905,201906,201907,201908,201909] - def sources = ["时间","房估估","诸葛找房","安居客","搜房","中原地产","赶集", - "链家","兔博士","城市房产","贝壳找房","Q房","乐有家", - "房探","房多多","小资家","我爱我家","麦田","房途", - "C21","乐居","房产超市","58同城"] - + def dates = [202301,202302,202303,202304,202305,202306,202307,202308,202309,202310,202311,202401] + def sources = ["时间","我爱我家","兔博士","吉屋","贝壳找房","乐有家","365淘房","诸葛找房","链家","Q房","麦田","中原地产","安居客","搜房","C21","城市房产","幸福里"] // crawlCount(dates,sources); matchCount(dates,sources); } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/TestCrawlTotalCount.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/TestCrawlTotalCount.groovy index bdd887539..e396b2e96 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/TestCrawlTotalCount.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/TestCrawlTotalCount.groovy @@ -12,10 +12,10 @@ class TestCrawlTotalCount { task.run(); } def run(){ - def sources = ["房估估","诸葛找房","安居客","搜房","中原地产","赶集","链家","兔博士","城市房产","贝壳找房","Q房","Q房(新)","中原地产(新)","乐有家","乐有家(新)","房探","房多多","小资家","我爱我家","麦田","房途","C21","乐居","房产超市","58同城","365淘房","吉屋"] + def sources = ["房估估","诸葛找房","安居客","搜房","中原地产","赶集","链家","兔博士","城市房产","贝壳找房","Q房","Q房(新)","中原地产(新)","乐有家","乐有家(新)","房探","房多多","小资家","我爱我家","麦田","房途","C21","乐居","房产超市","58同城","365淘房","吉屋","幸福里"] for(def source :sources){ - def count1 = findTotalCount(source, 202302); - def count2 = findTotalCount(source, 202303); + def count1 = findTotalCount(source, 202307); + def count2 = findTotalCount(source, 202401); println source +" "+count1 +" "+count2 } }