抓取审核小区

This commit is contained in:
Jian Shen
2022-05-30 20:59:51 +08:00
parent 505d93eda8
commit 95cd48bc06
2 changed files with 13 additions and 8 deletions
@@ -2,6 +2,8 @@ package com.fangjia.script.temp.shenjian.poi
import com.alibaba.fastjson.JSONObject import com.alibaba.fastjson.JSONObject
import com.fangjia.script.statistics.poi.AmapPoi 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.ExcelUtils
import com.fangjia.script.temp.shenjian.util.GaoDeUtils import com.fangjia.script.temp.shenjian.util.GaoDeUtils
import com.fangjia.script.temp.shenjian.util.HttpUtils import com.fangjia.script.temp.shenjian.util.HttpUtils
@@ -14,13 +16,15 @@ import java.util.concurrent.atomic.AtomicLong
class GetPoiFromExcel { class GetPoiFromExcel {
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(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) { static void main(String[] args) {
AtomicLong atomicLong = new AtomicLong(0) AtomicLong atomicLong = new AtomicLong(0)
//List<File> fileList = FileUtils.listFiles(new File("D:\\Users\\Domi\\Desktop\\房价网\\项目\\建行\\模型级联\\POI"), null, false); //List<File> fileList = FileUtils.listFiles(new File("D:\\Users\\Domi\\Desktop\\房价网\\项目\\建行\\模型级联\\POI"), null, false);
List<File> fileList = FileUtils.listFiles(new File("D:\\Users\\Domi\\Desktop\\房价网\\项目\\建行\\模型级联\\高德反查无ID"), null, false); List<File> fileList = FileUtils.listFiles(new File("D:\\Users\\Domi\\Documents\\知识库\\建行\\审核小区"), null, false);
for (File file : fileList) { for (File file : fileList) {
List<List<String>> seaweeds = ExcelUtils.read(file.getPath()) List<List<String>> seaweeds = ExcelUtils.read(file.getPath())
for (List<String> infoTemp : seaweeds) { for (List<String> infoTemp : seaweeds) {
@@ -28,12 +32,13 @@ class GetPoiFromExcel {
executorService.submit(new Runnable() { executorService.submit(new Runnable() {
@Override @Override
void run() { void run() {
String city = info.get(0) String city = info.get(1)
String region = info.get(1) String region = info.get(2)
String seaweedName = info.get(2) String seaweedName = info.get(3)
List<AmapPoi> pois = GaoDeUtils.searchPoi(city, seaweedName, region, "120300|120301|120302"); List<AmapPoi> pois = GaoDeUtils.searchPoi(city, seaweedName, region, typecodes);
if (CollectionUtils.isNotEmpty(pois)) { if (CollectionUtils.isNotEmpty(pois)) {
String jsonStr = JSONObject.toJSONString(pois) List<AmapPoiDetail> detailList = CommonDtoUtils.transformListV(AmapPoiDetail.class, pois);
String jsonStr = JSONObject.toJSONString(detailList)
HttpUtils.postForJson(URL, jsonStr) HttpUtils.postForJson(URL, jsonStr)
atomicLong.incrementAndGet() atomicLong.incrementAndGet()
} }
@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger
class GaoDeUtils { class GaoDeUtils {
// 新获取key // 新获取key
def static GAO_DE_AK = ["4ccfe3c898a9489884bd2bcb1ef6dcde", "4e9592208336433ee1b7aa4d1d434418"] def static GAO_DE_AK = ["4e9592208336433ee1b7aa4d1d434418"]
def static AtomicInteger keyUsed = new AtomicInteger(0) def static AtomicInteger keyUsed = new AtomicInteger(0)
def static codeNameMap = new HashMap<String, String>(){{ def static codeNameMap = new HashMap<String, String>(){{