新增农商行小区周围建筑信息导出
This commit is contained in:
+48
-2
@@ -1,6 +1,18 @@
|
||||
package com.fangjia.script.temp.shenjian.cqrcb
|
||||
|
||||
import cn.emay.mina.util.ConcurrentHashSet
|
||||
import com.fangjia.script.coredata.util.CollectionUtils
|
||||
import com.fangjia.script.temp.shenjian.util.GaoDeUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.GeoUtils
|
||||
import com.fangjia.script.util.MongoUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
import com.mongodb.DBObject
|
||||
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
/**
|
||||
* 小区周围信息导出
|
||||
@@ -10,9 +22,43 @@ import com.fangjia.script.temp.shenjian.util.GaoDeUtils
|
||||
*/
|
||||
class AroundExport {
|
||||
|
||||
def static types = ""
|
||||
static DBCollection conn = MongoUtils.getCollectionByName("seeddb_dev", "arround_temp", "192.168.0.235", 27018)
|
||||
|
||||
//3km范围内地铁站、公交站、银行、医院、商场、学校等名称及距离信息
|
||||
static def types = "150500|1507|090100|090101|090200|090202|090203|090204|090205|090206|090207|090208|090209|090210|090211|1601|0601|141200|141201|141202|141203|141204"
|
||||
static def radius = "3000"
|
||||
static ExecutorService executorService = Executors.newFixedThreadPool(30)
|
||||
|
||||
static void main(String[] args) {
|
||||
GaoDeUtils.searchNearByPoi()
|
||||
List<List<Object>> data = ExcelUtils.read("F:\\数据\\重庆农商行\\测试数据汇总_2021.xlsx", 9)
|
||||
AtomicInteger count = new AtomicInteger(0)
|
||||
for (List<Object> districtT : data) {
|
||||
final List<Object> district = districtT
|
||||
executorService.execute(new Runnable() {
|
||||
@Override
|
||||
void run() {
|
||||
def city = district.get(1)
|
||||
def name = district.get(3)
|
||||
if (district.get(20) != null && district.get(21) != null) {
|
||||
boolean exist = conn.count(new BasicDBObject("district_name", name)) > 0 ? true : false
|
||||
if (!exist) {
|
||||
def lng = com.fangjia.script.common.DataHandleUtils.getDoubleRound(6, district.get(20) / 10000000000d)
|
||||
def lat = com.fangjia.script.common.DataHandleUtils.getDoubleRound(6, district.get(21) / 10000000000d)
|
||||
List arounds = GaoDeUtils.searchNearByPoi(city, types, lng, lat, radius, "")
|
||||
if (CollectionUtils.isNotEmpty(arounds)) {
|
||||
for (BasicDBObject obj : arounds) {
|
||||
obj.put("district_name", name)
|
||||
obj.put("lng", lng)
|
||||
obj.put("lat", lat)
|
||||
}
|
||||
conn.insert(arounds)
|
||||
}
|
||||
}
|
||||
}
|
||||
println("当前处理小区" + name + " " + count.incrementAndGet())
|
||||
}
|
||||
})
|
||||
}
|
||||
executorService.shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -8,7 +8,6 @@ import com.mongodb.DBCollection
|
||||
import com.mongodb.DBObject
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.ConcurrentLinkedQueue
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
Reference in New Issue
Block a user