+19
-3
@@ -226,7 +226,7 @@ class SuggestionDataSynch extends BaseBatch{
|
|||||||
def data = fullCityMap.get(city)
|
def data = fullCityMap.get(city)
|
||||||
if(data){
|
if(data){
|
||||||
def results = CommonDatautils.findAmapDetailBySql(data.city)
|
def results = CommonDatautils.findAmapDetailBySql(data.city)
|
||||||
def rets = createPoi(results, data, townMap)
|
def rets = createPoi(data.city, results, data, townMap)
|
||||||
println city +" 完成!"
|
println city +" 完成!"
|
||||||
return rets;
|
return rets;
|
||||||
}
|
}
|
||||||
@@ -235,10 +235,11 @@ class SuggestionDataSynch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def createPoi(results, data, townMap){
|
def createPoi(fullCity, results, data, townMap){
|
||||||
def rets = new CopyOnWriteArrayList()
|
def rets = new CopyOnWriteArrayList()
|
||||||
|
|
||||||
def totalCount = new AtomicLong()
|
def totalCount = new AtomicLong()
|
||||||
|
def townshipMap = findMapPoiTownshipMap(fullCity)
|
||||||
final CountDownLatch latch = new CountDownLatch(results.size())
|
final CountDownLatch latch = new CountDownLatch(results.size())
|
||||||
for(def i=0;i<results.size();i++){
|
for(def i=0;i<results.size();i++){
|
||||||
final def dist = results[i]
|
final def dist = results[i]
|
||||||
@@ -265,7 +266,7 @@ class SuggestionDataSynch extends BaseBatch{
|
|||||||
|
|
||||||
map.township = InsidePolygon.isInArea2(map.location.lon, map.location.lat, townMap)
|
map.township = InsidePolygon.isInArea2(map.location.lon, map.location.lat, townMap)
|
||||||
if(!map.township){
|
if(!map.township){
|
||||||
def obj = findTownshipByBD(dist.id)
|
def obj = townshipMap.get(dist.id)
|
||||||
if(obj){
|
if(obj){
|
||||||
map.township = obj.township
|
map.township = obj.township
|
||||||
}else{
|
}else{
|
||||||
@@ -294,6 +295,21 @@ class SuggestionDataSynch extends BaseBatch{
|
|||||||
return rets;
|
return rets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def findMapPoiTownshipMap(fullCity){
|
||||||
|
def q = new BasicDBObject()
|
||||||
|
q.put("city", fullCity)
|
||||||
|
|
||||||
|
def keys = new BasicDBObject()
|
||||||
|
keys.put("id", 1)
|
||||||
|
keys.put("township", 1)
|
||||||
|
def dbcursor = MAPPOI_CONN.find(q, keys)
|
||||||
|
def map = [:]
|
||||||
|
for(def d : dbcursor){
|
||||||
|
map.put(d.id, d.township)
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def findTownshipByBD(id){
|
def findTownshipByBD(id){
|
||||||
def q = new BasicDBObject()
|
def q = new BasicDBObject()
|
||||||
|
|||||||
Reference in New Issue
Block a user