京东
This commit is contained in:
+18
-11
@@ -1,22 +1,19 @@
|
|||||||
package com.fangjia.script.gj.district
|
package com.fangjia.script.gj.district
|
||||||
|
|
||||||
import com.fangjia.core.util.GeoUtils
|
import com.fangjia.script.commData.CommonDatautils
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
import com.fangjia.script.yinjihaun.amap.GaoDeApiUtils
|
import com.fangjia.script.yinjihaun.amap.GaoDeApiUtils
|
||||||
import com.mongodb.BasicDBList
|
import com.mongodb.BasicDBList
|
||||||
import com.mongodb.BasicDBObject
|
import com.mongodb.BasicDBObject
|
||||||
import com.mongodb.DBCollection
|
import com.mongodb.DBCollection
|
||||||
|
|
||||||
import net.sf.json.JSONNull
|
import net.sf.json.JSONNull
|
||||||
import org.bson.types.ObjectId
|
|
||||||
|
|
||||||
|
|
||||||
class DistrictLocationGeo {
|
class DistrictLocationGeo {
|
||||||
|
|
||||||
final DBCollection JD_SEAWEED_COLL = MongoUtils.getCollectionByName("business", "jingdong_community", "192.168.0.206",27020)
|
final DBCollection JD_SEAWEED_COLL = MongoUtils.getCollectionByName("business", "jingdong_community", "192.168.0.206",27020)
|
||||||
final DBCollection JD_GEO_COLL = MongoUtils.getCollectionByName("business", "jingdong_geo", "192.168.0.206",27020)
|
final DBCollection JD_GEO_COLL = MongoUtils.getCollectionByName("business", "jingdong_geo", "192.168.0.206",27020)
|
||||||
|
final DBCollection JD_review_GEO_COLL = MongoUtils.getCollectionByName("business", "jingdong_review_geo", "192.168.0.206",27020)
|
||||||
static main(args) {
|
static main(args) {
|
||||||
def task = new DistrictLocationGeo()
|
def task = new DistrictLocationGeo()
|
||||||
task.run()//通过经纬度,调用高德逆解析,并保存数据
|
task.run()//通过经纬度,调用高德逆解析,并保存数据
|
||||||
@@ -25,14 +22,23 @@ class DistrictLocationGeo {
|
|||||||
|
|
||||||
}
|
}
|
||||||
def run(){
|
def run(){
|
||||||
ExcelUtils.multiThreadingModify("D:\\数据\\京东\\京东新增数据5.6万.xlsx",{ d->
|
ExcelUtils.multiThreadingModify("D:\\数据\\京东\\房价网重复小区数据5-1217【机密】(1).xlsx",{ d->
|
||||||
if(d['A']){
|
if(d['A']){
|
||||||
def dbo = JD_SEAWEED_COLL.findOne(new BasicDBObject("_id", new ObjectId(d['A'])))
|
// def dbo = JD_SEAWEED_COLL.findOne(new BasicDBObject("_id", new ObjectId(d['A'])))
|
||||||
if(dbo && dbo.longitude){
|
def obj = CommonDatautils.findDistrictById(d['A'])
|
||||||
def jsonObject = GaoDeApiUtils.geocode(dbo.longitude+","+dbo.latitude)
|
if(obj && obj.lat){
|
||||||
|
def lat = obj.lat/10000000000.0;
|
||||||
|
def lng = obj.lng/10000000000.0;
|
||||||
|
def jsonObject = GaoDeApiUtils.geocode(lng+","+lat)
|
||||||
if(jsonObject){
|
if(jsonObject){
|
||||||
d["F"] = "高德"
|
d["F"] = "高德"
|
||||||
// def dbo = new BasicDBObject()
|
def dbo = new BasicDBObject()
|
||||||
|
dbo.put("city", obj.city)
|
||||||
|
dbo.put("district", obj.region)
|
||||||
|
dbo.put("name", obj.name)
|
||||||
|
dbo.put("comm_id", d['A'])
|
||||||
|
dbo.put("lng", lng)
|
||||||
|
dbo.put("lat", lat)
|
||||||
dbo.put("formatted_address", jsonObject.regeocode.formatted_address)
|
dbo.put("formatted_address", jsonObject.regeocode.formatted_address)
|
||||||
def addrComp = jsonObject.regeocode.addressComponent
|
def addrComp = jsonObject.regeocode.addressComponent
|
||||||
dbo.put("addressComponent", addrComp)
|
dbo.put("addressComponent", addrComp)
|
||||||
@@ -42,13 +48,14 @@ class DistrictLocationGeo {
|
|||||||
dbo.put("aois", jsonObject.regeocode.aois)
|
dbo.put("aois", jsonObject.regeocode.aois)
|
||||||
dbo = cleanGeoData(dbo)
|
dbo = cleanGeoData(dbo)
|
||||||
dbo = convertToDBObject(dbo)
|
dbo = convertToDBObject(dbo)
|
||||||
JD_GEO_COLL.save(dbo)
|
JD_review_GEO_COLL.save(dbo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static BasicDBObject convertToDBObject(Map map) {
|
static BasicDBObject convertToDBObject(Map map) {
|
||||||
|
|||||||
+16
-3
@@ -5,9 +5,7 @@ import com.fangjia.script.ccbevaluation.CcbCommonUtils
|
|||||||
import com.fangjia.script.commData.CommonDatautils
|
import com.fangjia.script.commData.CommonDatautils
|
||||||
import com.fangjia.script.gj.district.FangjiaClientUtils
|
import com.fangjia.script.gj.district.FangjiaClientUtils
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
|
||||||
import com.fangjia.script.util.OpenApiClient
|
import com.fangjia.script.util.OpenApiClient
|
||||||
import com.mongodb.DBCollection
|
|
||||||
import groovy.sql.Sql
|
import groovy.sql.Sql
|
||||||
|
|
||||||
import java.util.concurrent.ExecutorService
|
import java.util.concurrent.ExecutorService
|
||||||
@@ -40,7 +38,9 @@ class TestEvaluation {
|
|||||||
|
|
||||||
// task.addOptName()
|
// task.addOptName()
|
||||||
// task.addDistId()
|
// task.addDistId()
|
||||||
task.addEvaluationToDB()
|
// task.addEvaluationToDB()
|
||||||
|
|
||||||
|
task.addEvaluationDetail()
|
||||||
}
|
}
|
||||||
|
|
||||||
def houseSimilar(){
|
def houseSimilar(){
|
||||||
@@ -392,4 +392,17 @@ class TestEvaluation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def addEvaluationDetail(){
|
||||||
|
def rets = []
|
||||||
|
ExcelUtils.modify("D:\\数据\\宏信息\\宏信项目-最终.xlsx", { d ->
|
||||||
|
if (d['G']) {
|
||||||
|
def dist = CommonDatautils.findDistrictById(d['G'])
|
||||||
|
if (dist) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ import java.util.zip.GZIPInputStream
|
|||||||
|
|
||||||
class GaoDeApiUtils {
|
class GaoDeApiUtils {
|
||||||
//67423021cae3b58e5c2ac595a389b036 :临时买的key
|
//67423021cae3b58e5c2ac595a389b036 :临时买的key
|
||||||
def static GAO_DE_AK = "67423021cae3b58e5c2ac595a389b036" //宝剑:c6fcd4bfbc40d73ee762b8115dca3390
|
def static GAO_DE_AK = "d22fcd4274e037fdd1e9357d91152504" //宝剑:c6fcd4bfbc40d73ee762b8115dca3390
|
||||||
//15021384995:dfc2245bac8a7b2d5b62e060e59d4eca
|
//15021384995:dfc2245bac8a7b2d5b62e060e59d4eca
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user