From 97b933451d67f3ef90926a435fc6a4e4606d8771 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 28 Aug 2023 11:00:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=BA=E8=A1=8C=E4=B8=B4=E6=97=B6=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E4=B8=80=E4=B8=AA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pgsql/ExportPgsqlEvaluationResult.groovy | 21 ++- .../script/fuzhou/AmapAddressUpdate.groovy | 10 +- .../gj/xiamen/GaoDePoiDataProcess.groovy | 5 +- .../gj/xiamen/NetworkDistanceBatch.groovy | 124 ++++++++++++++++++ .../script/gj/xiamen/SeaweedDataSynch.groovy | 10 +- 5 files changed, 149 insertions(+), 21 deletions(-) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/NetworkDistanceBatch.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/pgsql/ExportPgsqlEvaluationResult.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/pgsql/ExportPgsqlEvaluationResult.groovy index 6686d596f..5f5bcb8ac 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/pgsql/ExportPgsqlEvaluationResult.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/pgsql/ExportPgsqlEvaluationResult.groovy @@ -34,20 +34,19 @@ class ExportPgsqlEvaluationResult { def curMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), 0, "yyyyMM")); //计算结果相关 - exportAvmEvaluationGJNB(curMonth) - exportAVMEvaluationItemGJNB(curMonth) - - exportCityPrice(curMonth) - exportRegionPrice(curMonth) - - exportCommunityBasePrice(curMonth) -// exportCommunityBasePrice1(curMonth) +// exportAvmEvaluationGJNB(curMonth) +// exportAVMEvaluationItemGJNB(curMonth) +// +// exportCityPrice(curMonth) +// exportRegionPrice(curMonth) +// +// exportCommunityBasePrice(curMonth) exportCommunityPdescribeGj(curMonth) - exportCommCaseDetailGj(curMonth) -// +// exportCommCaseDetailGj(curMonth) + exportInOk() -// + SSHHelperTest jschCommand = new SSHHelperTest(); System.out.println(jschCommand.executeCommand("sh /home/ccb_evaluation/output/eval_package.sh ${curDate}")); diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/AmapAddressUpdate.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/AmapAddressUpdate.groovy index cecc0536d..0be2c85d2 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/AmapAddressUpdate.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/AmapAddressUpdate.groovy @@ -38,10 +38,10 @@ class AmapAddressUpdate { static main(args) { def task = new AmapAddressUpdate() - def path = "d:\\数据\\小区\\福州小区地址与高德地图V2.xlsx" - def addr = task.formatAddress("福州", "北三环路201号") - println addr -// task.run(path) + def path = "d:\\数据\\小区\\福建省小区地址与高德地图V2.xlsx" +// def addr = task.formatAddress("福州", "北三环路201号") +// println addr + task.run(path) // task.similarMatch(path) // task.addressRun(path) // task.addressSource(path) @@ -52,7 +52,7 @@ class AmapAddressUpdate { // task.updateLocation(path)//更新经纬度 } def run(path){ - def citys = ["福州"]//CommonDatautils.findAllCity() + def citys = ["三明","宁德","泉州","厦门","福州","漳州","南平","龙岩","莆田"]//CommonDatautils.findAllCity() def allrets = [] allrets << ["城市","区域","名称","地址","地址别名","高德区域","高德名称","高德地址","高德地址格式化","高德经度","高德纬度"] for (def city : citys) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy index a9511c985..3ec5214f7 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy @@ -33,7 +33,7 @@ import java.util.concurrent.atomic.AtomicLong @BatchOwner(Watcher.GaoJuan) class GaoDePoiDataProcess extends BaseBatch{ - public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) + public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(1) public static def version = new Date().getTime() @@ -62,7 +62,8 @@ class GaoDePoiDataProcess extends BaseBatch{ def synchCompany(){ - def citys = ["三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市","重庆市"] + //"三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市", + def citys = ["重庆市"] for(def c : citys){ def townMap = findTownRange(c) def companyDatas = findCompanyDatas(c) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/NetworkDistanceBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/NetworkDistanceBatch.groovy new file mode 100644 index 000000000..bd8531aae --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/NetworkDistanceBatch.groovy @@ -0,0 +1,124 @@ +package com.fangjia.script.gj.xiamen + +import com.fangjia.core.util.GeoUtils +import com.fangjia.datastore.driver.DSCursor +import com.fangjia.script.BaseBatch +import com.fangjia.script.commData.CommonDatautils +import com.fangjia.script.util.ExcelUtils +import com.fangjia.script.util.MongoUtils +import com.mongodb.BasicDBObject +import com.mongodb.DBCollection +import com.mongodb.DBObject + +import java.util.concurrent.CopyOnWriteArrayList +import java.util.concurrent.CountDownLatch +import java.util.concurrent.ExecutorService +import java.util.concurrent.Executors +import java.util.concurrent.atomic.AtomicLong + +class NetworkDistanceBatch extends BaseBatch{ + + + def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; + DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL) + + public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) + + + final DBCollection NETWORK_COLL = MongoUtils.getCollectionByName("business", "xm_network", "192.168.0.43") + + static main(args) { + runBatch(new NetworkDistanceBatch(), args) + } + + @Override + void process(Object args) { + + def networks = ExcelUtils.read("D:\\数据\\厦门\\网点.xlsx", 0, 1) + def citys = ["厦门","三明","宁德","泉州","福州","漳州","南平","龙岩","莆田","重庆"] + for(def c : citys){ + run(c, "district", networks) + } + } + + def run(city, cat, networks){ + def datas = findDistrictData(city, cat, ["city","region", "name", "category", "location"]) + def rets = new CopyOnWriteArrayList() + def totalCount = new AtomicLong() + final CountDownLatch latch = new CountDownLatch(datas.size()) + for(def i=0;i