From 78ec9177153be917baf1e864d898a32a822ed1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Wed, 17 Nov 2021 13:40:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E5=BE=B7ID=E5=8F=8D=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shenjian/poi/CounterCheckGaoDe.groovy | 2 +- .../script/temp/shenjian/poi/GetPoi.groovy | 34 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/CounterCheckGaoDe.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/CounterCheckGaoDe.groovy index 8f22e231e..44d467755 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/CounterCheckGaoDe.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/CounterCheckGaoDe.groovy @@ -15,7 +15,7 @@ class CounterCheckGaoDe { static final def URL = "http://192.168.0.216:38080/FangJiaDataService/saveAmapPoi" static void main(String[] args) { - List> infos = ExcelUtils.read("D:\\Users\\Domi\\Desktop\\房价网\\项目\\建行\\模型级联\\地图反查信息_高德结果.xlsx") + List> infos = ExcelUtils.read("D:\\Users\\Domi\\Desktop\\房价网\\项目\\建行\\模型级联\\地图反查信息_高德结果2.xlsx") for (List info : infos) { if (info.size() < 6) { String id = info.get(4) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoi.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoi.groovy index 7ff7cb903..694b43539 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoi.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoi.groovy @@ -4,6 +4,7 @@ package com.fangjia.script.temp.shenjian.poi import com.alibaba.fastjson.JSONObject import com.fangjia.script.lixue.util.DBUtils import com.fangjia.script.statistics.poi.AmapPoi +import com.fangjia.script.temp.shenjian.util.ExcelUtils import com.fangjia.script.temp.shenjian.util.GaoDeUtils import com.fangjia.script.temp.shenjian.util.HttpUtils import com.fangjia.script.temp.shenjian.util.SeaweedUtils @@ -18,6 +19,7 @@ import org.bson.types.ObjectId import java.util.concurrent.ExecutorService import java.util.concurrent.Executors +import java.util.concurrent.atomic.AtomicLong /** * 获取具体点poi @@ -27,9 +29,39 @@ import java.util.concurrent.Executors */ class GetPoi { - static final def URL = "http://192.168.0.19:38080/FangJiaDataService/saveAmapPoi" + static final def URL = "http://192.168.0.216:38080/FangJiaDataService/saveAmapPoi" + static final ExecutorService executorService = Executors.newFixedThreadPool(10) static void main(String[] args) { + AtomicLong atomicLong = new AtomicLong(0) + List> seaweeds = ExcelUtils.read("D:\\Users\\Domi\\Desktop\\房价网\\项目\\建行\\模型级联\\分期数据高德核实.xlsx") + for (List infoTemp : seaweeds) { + final List info = infoTemp + executorService.submit(new Runnable() { + @Override + void run() { + String city = info.get(2) + String region = info.get(3) + String seaweedName = info.get(4) + List pois = GaoDeUtils.searchPoi(city, seaweedName, region, "120300|120301|120302"); + if (CollectionUtils.isNotEmpty(pois)) { + String jsonStr = JSONObject.toJSONString(pois) + HttpUtils.postForJson(URL, jsonStr) + atomicLong.incrementAndGet() + } + synchronized (this) { + if (atomicLong.intValue() % 500 == 0) { + println(atomicLong.intValue()) + } + } + } + }) + } + executorService.shutdown() + } + + + static void getPointInfo() { List pois = GaoDeUtils.searchNearDtoByPoi("无锡","190301",120.411465,31.864912, 1000, "江苏省江阴市周庄镇兴隆北路"); if (CollectionUtils.isNotEmpty(pois)) { String jsonStr = JSONObject.toJSONString(pois)