+5
-3
@@ -5,7 +5,6 @@ import com.fangjia.script.util.MongoUtils
|
||||
import com.fangjia.script.yinjihaun.amap.GaoDeApiUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
import org.bson.types.ObjectId
|
||||
|
||||
class DistrictLocationGeo {
|
||||
|
||||
@@ -16,9 +15,10 @@ class DistrictLocationGeo {
|
||||
task.run()//调用高德逆解析,并保存数据
|
||||
}
|
||||
def run(){
|
||||
ExcelUtils.modify("D:\\数据\\京东\\需逆解析数据-test.xlsx",{ d->
|
||||
ExcelUtils.multiThreadingModify("D:\\数据\\京东\\需逆解析数据.xlsx", { d ->
|
||||
def jsonObject = GaoDeApiUtils.geocode(d['C'])
|
||||
if(jsonObject){
|
||||
def count = 0
|
||||
if (jsonObject) {
|
||||
def dbo = new BasicDBObject()
|
||||
dbo.put("old_id", d['B'])
|
||||
dbo.put("old_location", d['C'])
|
||||
@@ -29,7 +29,9 @@ class DistrictLocationGeo {
|
||||
dbo.put("roadinters", jsonObject.regeocode.roadinters)
|
||||
dbo.put("aois", jsonObject.regeocode.aois)
|
||||
seaweedGaodePoisColl.save(dbo)
|
||||
count = jsonObject.regeocode.pois.size()
|
||||
}
|
||||
d['D'] = count
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+5
-10
@@ -6,17 +6,15 @@ import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.ccbevaluation.CcbCommonUtils
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ElasticUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.FangJiaAreaMapUtils
|
||||
import com.google.common.hash.*
|
||||
import com.google.common.hash.BloomFilter
|
||||
import com.google.common.hash.Funnels
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBObject
|
||||
import groovy.sql.Sql
|
||||
import org.apache.commons.lang.StringUtils
|
||||
import org.bson.types.ObjectId
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilders
|
||||
@@ -24,15 +22,12 @@ import org.elasticsearch.xpack.sql.jdbc.EsDataSource
|
||||
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import java.util.regex.Matcher
|
||||
import java.util.regex.Pattern
|
||||
|
||||
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 出售房源数据同步
|
||||
@@ -201,7 +196,7 @@ class FjwBigdataForsaleBatch extends BaseBatch{
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
};
|
||||
};
|
||||
})
|
||||
}
|
||||
latch.await()
|
||||
@@ -492,8 +487,8 @@ class FjwBigdataForsaleBatch extends BaseBatch{
|
||||
|
||||
|
||||
def findHousesByMdate(def city, def region, def cat, def startDate, def endDate, def name, def alias, def estate_type2, rets1){
|
||||
// def date = DateUtils.addMonth(endDate.toString(), -3, "yyyyMMdd")
|
||||
def date = DateUtils.addMonth(endDate.toString(), -12, "yyyyMMdd")
|
||||
def date = DateUtils.addMonth(endDate.toString(), -3, "yyyyMMdd")
|
||||
// def date = DateUtils.addMonth(endDate.toString(), -12, "yyyyMMdd")
|
||||
def startMdate = DateUtils.parseFromTightByPattern(date,"yyyyMMdd")//DateUtils.parseFromTightByPattern("20240519","yyyyMMdd")
|
||||
def endMdate = DateUtils.parseFromTightByPattern(endDate.toString(), "yyyyMMdd")//DateUtils.parseFromTightByPattern("20240718", "yyyyMMdd")
|
||||
|
||||
|
||||
+3
-4
@@ -1,19 +1,17 @@
|
||||
package com.fangjia.script.yinjihaun.amap
|
||||
|
||||
import com.fangjia.core.util.HttpRequest
|
||||
import com.fangjia.script.common.DataHandleUtils
|
||||
import com.fangjia.script.thirdPriceCrawl.UserAgents
|
||||
import com.fangjia.script.util.ABuYunUtil
|
||||
import com.fangjia.script.util.JacksonUtil
|
||||
import net.sf.json.JSONObject
|
||||
import org.apache.commons.lang.StringUtils
|
||||
import org.jsoup.Jsoup
|
||||
|
||||
import java.util.zip.GZIPInputStream
|
||||
|
||||
class GaoDeApiUtils {
|
||||
//94c74c60e102972a8d17b7b75d7403be
|
||||
def static GAO_DE_AK = "a34894d151fffff94f9a33bae3d5565c" //宝剑:c6fcd4bfbc40d73ee762b8115dca3390
|
||||
//67423021cae3b58e5c2ac595a389b036 :临时买的key
|
||||
def static GAO_DE_AK = "67423021cae3b58e5c2ac595a389b036" //宝剑:c6fcd4bfbc40d73ee762b8115dca3390
|
||||
//15021384995:dfc2245bac8a7b2d5b62e060e59d4eca
|
||||
|
||||
/**
|
||||
@@ -39,6 +37,7 @@ class GaoDeApiUtils {
|
||||
try {
|
||||
content = new HttpRequest().get("http://restapi.amap.com/v3/geocode/regeo", params, "utf-8")
|
||||
} catch (Exception e) {
|
||||
println location + " 出错:"+content
|
||||
content = new HttpRequest().get("http://restapi.amap.com/v3/geocode/regeo", params, "utf-8")
|
||||
}
|
||||
jsonObj = JSONObject.fromObject(content)
|
||||
|
||||
Reference in New Issue
Block a user