From 95cd48bc06c71c334b287a065665e8dda9ce6aed Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Mon, 30 May 2022 20:59:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=93=E5=8F=96=E5=AE=A1=E6=A0=B8=E5=B0=8F?= =?UTF-8?q?=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../temp/shenjian/poi/GetPoiFromExcel.groovy | 19 ++++++++++++------- .../temp/shenjian/util/GaoDeUtils.groovy | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoiFromExcel.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoiFromExcel.groovy index bd49875b0..f9b073743 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoiFromExcel.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoiFromExcel.groovy @@ -2,6 +2,8 @@ package com.fangjia.script.temp.shenjian.poi import com.alibaba.fastjson.JSONObject import com.fangjia.script.statistics.poi.AmapPoi +import com.fangjia.script.statistics.poi.AmapPoiDetail +import com.fangjia.script.temp.shenjian.util.CommonDtoUtils import com.fangjia.script.temp.shenjian.util.ExcelUtils import com.fangjia.script.temp.shenjian.util.GaoDeUtils import com.fangjia.script.temp.shenjian.util.HttpUtils @@ -14,13 +16,15 @@ import java.util.concurrent.atomic.AtomicLong class GetPoiFromExcel { - static final def URL = "http://192.168.0.216:38080/FangJiaDataService/saveAmapPoi" static final ExecutorService executorService = Executors.newFixedThreadPool(10) + static final def URL = "http://192.168.0.100:38080/FangJiaDataService/saveAmapPoiDetail" + // 住宅类 + static final String typecodes = "120000|120100|120200|120201|120202|120203|120300|120301|120302|120303|120304"; static void main(String[] args) { AtomicLong atomicLong = new AtomicLong(0) //List fileList = FileUtils.listFiles(new File("D:\\Users\\Domi\\Desktop\\房价网\\项目\\建行\\模型级联\\POI"), null, false); - List fileList = FileUtils.listFiles(new File("D:\\Users\\Domi\\Desktop\\房价网\\项目\\建行\\模型级联\\高德反查无ID"), null, false); + List fileList = FileUtils.listFiles(new File("D:\\Users\\Domi\\Documents\\知识库\\建行\\审核小区"), null, false); for (File file : fileList) { List> seaweeds = ExcelUtils.read(file.getPath()) for (List infoTemp : seaweeds) { @@ -28,12 +32,13 @@ class GetPoiFromExcel { executorService.submit(new Runnable() { @Override void run() { - String city = info.get(0) - String region = info.get(1) - String seaweedName = info.get(2) - List pois = GaoDeUtils.searchPoi(city, seaweedName, region, "120300|120301|120302"); + String city = info.get(1) + String region = info.get(2) + String seaweedName = info.get(3) + List pois = GaoDeUtils.searchPoi(city, seaweedName, region, typecodes); if (CollectionUtils.isNotEmpty(pois)) { - String jsonStr = JSONObject.toJSONString(pois) + List detailList = CommonDtoUtils.transformListV(AmapPoiDetail.class, pois); + String jsonStr = JSONObject.toJSONString(detailList) HttpUtils.postForJson(URL, jsonStr) atomicLong.incrementAndGet() } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy index ea456aa50..6b880c5ea 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy @@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger class GaoDeUtils { // 新获取key - def static GAO_DE_AK = ["4ccfe3c898a9489884bd2bcb1ef6dcde", "4e9592208336433ee1b7aa4d1d434418"] + def static GAO_DE_AK = ["4e9592208336433ee1b7aa4d1d434418"] def static AtomicInteger keyUsed = new AtomicInteger(0) def static codeNameMap = new HashMap(){{