Merge branch 'script_gj' of http://gitlab.fangjia.com/dev0/main into script_gj
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
package com.fangjia.script.temp.shenjian.didata
|
||||
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.OpenApiClient
|
||||
|
||||
/**
|
||||
* 从excel中匹配出
|
||||
*/
|
||||
ExcelUtils.multiThreadingModify("D:\\Users\\Domi\\Documents\\知识库\\地数\\数据建设\\待审核小区(地图匹配).xlsx", { row ->
|
||||
def city = row['A']
|
||||
def region = row['B']
|
||||
def district_name = row['C']
|
||||
|
||||
def gaodeRegion = row['H']
|
||||
def gaodeName = row['I']
|
||||
|
||||
def jsonObject = OpenApiClient.addressMatch(city, district_name, "district", false, region, district_name, "strict")
|
||||
if (jsonObject != null && jsonObject.precise != -1) {
|
||||
row['D'] = jsonObject.get("name")
|
||||
}
|
||||
|
||||
if (gaodeRegion && gaodeName) {
|
||||
def jsonObject2 = OpenApiClient.addressMatch(city, gaodeName, "district", false, gaodeRegion, gaodeName, "strict")
|
||||
if (jsonObject2 != null && jsonObject2.precise != -1) {
|
||||
row['J'] = jsonObject2.get("name")
|
||||
}
|
||||
}
|
||||
});
|
||||
+9
-4
@@ -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<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) {
|
||||
List<List<String>> seaweeds = ExcelUtils.read(file.getPath())
|
||||
for (List<String> infoTemp : seaweeds) {
|
||||
@@ -31,9 +35,10 @@ class GetPoiFromExcel {
|
||||
String city = info.get(0)
|
||||
String region = info.get(1)
|
||||
String seaweedName = info.get(2)
|
||||
List<AmapPoi> pois = GaoDeUtils.searchPoi(city, seaweedName, region, "120300|120301|120302");
|
||||
List<AmapPoi> pois = GaoDeUtils.searchPoi(city, seaweedName, region, typecodes);
|
||||
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)
|
||||
atomicLong.incrementAndGet()
|
||||
}
|
||||
|
||||
+3
@@ -81,6 +81,9 @@ class SeaweedPoiDetail {
|
||||
if (CollectionUtils.isEmpty(pois)) {
|
||||
pois = GaoDeUtils.searchPoi(city, name, region, typecodes)
|
||||
}
|
||||
if (CollectionUtils.isEmpty(pois)) {
|
||||
pois = GaoDeUtils.searchPoi(city, address, region, typecodes)
|
||||
}
|
||||
|
||||
List<AmapPoiDetail> detailList = CommonDtoUtils.transformListV(AmapPoiDetail.class, pois);
|
||||
// for (AmapPoi amapPoi : pois) {
|
||||
|
||||
+1
-1
@@ -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<String, String>(){{
|
||||
|
||||
Reference in New Issue
Block a user