重新跑小区高德最新信息

This commit is contained in:
沈健
2021-12-16 15:55:05 +08:00
parent 4b1f9a6ab3
commit d8e8bb6885
@@ -30,19 +30,22 @@ import java.util.concurrent.atomic.AtomicLong
class GetPoi { class GetPoi {
static final def URL = "http://192.168.0.216:38080/FangJiaDataService/saveAmapPoi" static final def URL = "http://192.168.0.216:38080/FangJiaDataService/saveAmapPoi"
static final ExecutorService executorService = Executors.newFixedThreadPool(10) static final ExecutorService executorService = Executors.newFixedThreadPool(20)
static void main(String[] args) { static void main(String[] args) {
AtomicLong atomicLong = new AtomicLong(0) AtomicLong atomicLong = new AtomicLong(0)
List<List<String>> seaweeds = ExcelUtils.read("D:\\数据\\建行\\房产估值\\小区\\500000_重庆小区数据匹配.xlsx") DBObject filter = new BasicDBObject()
for (List<String> infoTemp : seaweeds) { filter.append("_id", 1).append("name", 1).append("city", 1).append("region", 1)
final List<String> info = infoTemp DBObject query = new BasicDBObject()
query.append("cat", "district").append("visible", 0).append("city", "重庆")
DbUtils.seaweed.find(query, filter).batchSize(10000).forEach( {seaweedTemp ->
final DBObject seaweed = seaweedTemp;
executorService.submit(new Runnable() { executorService.submit(new Runnable() {
@Override @Override
void run() { void run() {
String city = "重庆"//info.get(2) String city = seaweed.get("city")
String region = info.get(3) String region = seaweed.get("region")
String seaweedName = info.get(4) String seaweedName = seaweed.get("name")
List<AmapPoi> pois = GaoDeUtils.searchPoi(city, seaweedName, region, "120300|120301|120302"); List<AmapPoi> pois = GaoDeUtils.searchPoi(city, seaweedName, region, "120300|120301|120302");
if (CollectionUtils.isNotEmpty(pois)) { if (CollectionUtils.isNotEmpty(pois)) {
String jsonStr = JSONObject.toJSONString(pois) String jsonStr = JSONObject.toJSONString(pois)
@@ -56,7 +59,7 @@ class GetPoi {
} }
} }
}) })
} })
executorService.shutdown() executorService.shutdown()
} }