修改
This commit is contained in:
+2
-2
@@ -4209,13 +4209,13 @@ class CommonDatautils {
|
|||||||
|
|
||||||
|
|
||||||
static def findAllNewPoiDatas(city){
|
static def findAllNewPoiDatas(city){
|
||||||
String sql = "select pname,cityname,adname,name,address,location,type,id from poi_amap_2024 where cityname='${city}'"
|
String sql = "select pname,cityname,adname,name,address,location,type,id,parent from poi_amap_2024 where cityname='${city}'"
|
||||||
def rets = []
|
def rets = []
|
||||||
def index= 0
|
def index= 0
|
||||||
ElasticUtils.executeSqlQuery(sql, { map->
|
ElasticUtils.executeSqlQuery(sql, { map->
|
||||||
// if(map.address && map.address.contains("五角场")){
|
// if(map.address && map.address.contains("五角场")){
|
||||||
index++
|
index++
|
||||||
rets << ["map_id":map.id,"province":map.pname,"city":map.cityname, "district":map.adname, "name":map.name, "address":map.address, "cat":map.type,"lng":map.location.x, "lat":map.location.y]
|
rets << ["map_id":map.id,"province":map.pname,"city":map.cityname, "district":map.adname, "name":map.name, "address":map.address, "cat":map.type,"lng":map.location.x, "lat":map.location.y, "parent_id":map.parent]
|
||||||
// }
|
// }
|
||||||
})
|
})
|
||||||
return rets;
|
return rets;
|
||||||
|
|||||||
+8
-2
@@ -40,11 +40,12 @@ class NewGaoDePoiBatch extends BaseBatch{
|
|||||||
@Override
|
@Override
|
||||||
void process(Object args) {
|
void process(Object args) {
|
||||||
run()
|
run()
|
||||||
|
// oldPoiMagre()
|
||||||
}
|
}
|
||||||
|
|
||||||
def run(){
|
def run(){
|
||||||
if (CommonDatautils.isWindow()) {
|
if (CommonDatautils.isWindow()) {
|
||||||
TAGS = getAllPoiType("D:\\数据\\福建省_POI_GCJ02_20240630\\POI分类白名单.xlsx")
|
TAGS = getAllPoiType("D:\\数据\\数据建设\\Poi\\POI分类白名单.xlsx")
|
||||||
}else{
|
}else{
|
||||||
TAGS = getAllPoiType("/home/goojia/gj/POI_TYPES.xlsx")
|
TAGS = getAllPoiType("/home/goojia/gj/POI_TYPES.xlsx")
|
||||||
}
|
}
|
||||||
@@ -145,6 +146,7 @@ class NewGaoDePoiBatch extends BaseBatch{
|
|||||||
saveObj.data_id = map.map_id
|
saveObj.data_id = map.map_id
|
||||||
saveObj.data_source = "高德地图"
|
saveObj.data_source = "高德地图"
|
||||||
saveObj.data_source_year = "2024-11"
|
saveObj.data_source_year = "2024-11"
|
||||||
|
saveObj.parent_id = map.parent_id
|
||||||
|
|
||||||
if(saveObj.cat && TAGS.contains(saveObj.cat)){
|
if(saveObj.cat && TAGS.contains(saveObj.cat)){
|
||||||
saveObj.status = 0
|
saveObj.status = 0
|
||||||
@@ -314,7 +316,7 @@ class NewGaoDePoiBatch extends BaseBatch{
|
|||||||
rows.each{map->
|
rows.each{map->
|
||||||
// def map = rows.get(key)
|
// def map = rows.get(key)
|
||||||
|
|
||||||
request.add(new IndexRequest("didata_map_poi_2024", "_doc", map.data_id).source(map, XContentType.JSON));
|
request.add(new IndexRequest("map_poi_2024", "_doc", map.data_id).source(map, XContentType.JSON));
|
||||||
|
|
||||||
// 批量提交数据
|
// 批量提交数据
|
||||||
if (request.numberOfActions() >= batchSize) {
|
if (request.numberOfActions() >= batchSize) {
|
||||||
@@ -346,4 +348,8 @@ class NewGaoDePoiBatch extends BaseBatch{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def oldPoiMagre(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user