Merge branch 'script_gj' into 'master'

方法名

See merge request !814
This commit is contained in:
2024-02-22 10:37:23 +08:00
5 changed files with 32 additions and 35 deletions
+10 -10
View File
@@ -542,16 +542,16 @@
<artifactId>aliyun-java-sdk-address-purification</artifactId>
<version>1.0.1</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.aliyun</groupId>-->
<!-- <artifactId>aliyun-java-sdk-core</artifactId>-->
<!-- <version>4.5.9</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- <version>1.2.83</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.5.9</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>
</dependencies>
@@ -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
}
// })
@@ -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,
@@ -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);
}
@@ -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
}
}