From 469ee5f2edf34cd31e56f307cb5c8cbf23b5f679 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 24 Dec 2025 16:20:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gj/district/DistrictLocationGeo.groovy | 29 ++++++++++++------- .../jiangnanblank/TestEvaluation.groovy | 19 ++++++++++-- .../yinjihaun/amap/GaoDeApiUtils.groovy | 2 +- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/DistrictLocationGeo.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/DistrictLocationGeo.groovy index b25c63f1e..23e7330f1 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/DistrictLocationGeo.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/DistrictLocationGeo.groovy @@ -1,22 +1,19 @@ 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.MongoUtils import com.fangjia.script.yinjihaun.amap.GaoDeApiUtils import com.mongodb.BasicDBList import com.mongodb.BasicDBObject import com.mongodb.DBCollection - import net.sf.json.JSONNull -import org.bson.types.ObjectId - class DistrictLocationGeo { 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_review_GEO_COLL = MongoUtils.getCollectionByName("business", "jingdong_review_geo", "192.168.0.206",27020) static main(args) { def task = new DistrictLocationGeo() task.run()//通过经纬度,调用高德逆解析,并保存数据 @@ -25,14 +22,23 @@ class DistrictLocationGeo { } def run(){ - ExcelUtils.multiThreadingModify("D:\\数据\\京东\\京东新增数据5.6万.xlsx",{ d-> + ExcelUtils.multiThreadingModify("D:\\数据\\京东\\房价网重复小区数据5-1217【机密】(1).xlsx",{ d-> if(d['A']){ - def dbo = JD_SEAWEED_COLL.findOne(new BasicDBObject("_id", new ObjectId(d['A']))) - if(dbo && dbo.longitude){ - def jsonObject = GaoDeApiUtils.geocode(dbo.longitude+","+dbo.latitude) +// def dbo = JD_SEAWEED_COLL.findOne(new BasicDBObject("_id", new ObjectId(d['A']))) + def obj = CommonDatautils.findDistrictById(d['A']) + if(obj && obj.lat){ + def lat = obj.lat/10000000000.0; + def lng = obj.lng/10000000000.0; + def jsonObject = GaoDeApiUtils.geocode(lng+","+lat) if(jsonObject){ 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) def addrComp = jsonObject.regeocode.addressComponent dbo.put("addressComponent", addrComp) @@ -42,13 +48,14 @@ class DistrictLocationGeo { dbo.put("aois", jsonObject.regeocode.aois) dbo = cleanGeoData(dbo) dbo = convertToDBObject(dbo) - JD_GEO_COLL.save(dbo) + JD_review_GEO_COLL.save(dbo) } } } }) + } static BasicDBObject convertToDBObject(Map map) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/TestEvaluation.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/TestEvaluation.groovy index 5a92ee89f..c395ff47d 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/TestEvaluation.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/TestEvaluation.groovy @@ -5,9 +5,7 @@ import com.fangjia.script.ccbevaluation.CcbCommonUtils import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.gj.district.FangjiaClientUtils import com.fangjia.script.util.ExcelUtils -import com.fangjia.script.util.MongoUtils import com.fangjia.script.util.OpenApiClient -import com.mongodb.DBCollection import groovy.sql.Sql import java.util.concurrent.ExecutorService @@ -40,7 +38,9 @@ class TestEvaluation { // task.addOptName() // task.addDistId() - task.addEvaluationToDB() +// task.addEvaluationToDB() + + task.addEvaluationDetail() } 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) { + + } + } + }); + } + + } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/yinjihaun/amap/GaoDeApiUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/yinjihaun/amap/GaoDeApiUtils.groovy index 7a14f7431..f41071b91 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/yinjihaun/amap/GaoDeApiUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/yinjihaun/amap/GaoDeApiUtils.groovy @@ -11,7 +11,7 @@ import java.util.zip.GZIPInputStream class GaoDeApiUtils { //67423021cae3b58e5c2ac595a389b036 :临时买的key - def static GAO_DE_AK = "67423021cae3b58e5c2ac595a389b036" //宝剑:c6fcd4bfbc40d73ee762b8115dca3390 + def static GAO_DE_AK = "d22fcd4274e037fdd1e9357d91152504" //宝剑:c6fcd4bfbc40d73ee762b8115dca3390 //15021384995:dfc2245bac8a7b2d5b62e060e59d4eca /**