From fb2809d165f8fbeacbffa6686afc216a3c852e88 Mon Sep 17 00:00:00 2001 From: wangwenyan Date: Thu, 8 May 2025 13:52:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/wenyan/guojun.groovy | 49 ++----------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/guojun.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/guojun.groovy index e837ce0ba..717a8d81f 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/guojun.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/guojun.groovy @@ -2,49 +2,10 @@ package com.fangjia.script.wenyan import com.fangjia.core.ProvinceData import com.fangjia.core.RegionData -import com.fangjia.core.util.DateUtil -import com.fangjia.core.util.Mongo3Utils -import com.fangjia.script.util.CommonUtils -import com.fangjia.script.util.DbUtils -import com.fangjia.script.util.ElasticUtils import com.fangjia.script.util.ExcelUtils -import com.mongodb.BasicDBObject -import org.bson.Document -import org.elasticsearch.action.get.GetRequest -import org.elasticsearch.action.get.GetResponse -import org.elasticsearch.client.RequestOptions -import org.elasticsearch.client.RestHighLevelClient +fullCityMap = CommonDatautils.queryFullNameCity() -////def data = [] -////data << ["ID","城市","区域","名称","地址", "财力评级"] -//RestHighLevelClient client = ElasticUtils.getClient89("192.168.0.89") -//district_analy_data_client = Mongo3Utils.getDbCollection("fangjia_stat", "district_analy_data") -//level_map = ["1": "S", "2": "A", "3": "B", "4": "C", "5": "D"] -//level_maps = new HashMap<>() -//for(def key in level_map.keySet()){ -// level_maps.put(level_map[key], key) -//} -//ExcelUtils.modify("C:\\Users\\goojia\\Desktop\\财力评级-厦门.xlsx",{List item-> -//// GetResponse response = client.get(new GetRequest("community_summary", item["A"] as String), RequestOptions.DEFAULT) -//// def query = new Document("city", item['B'].toString().replace("市", "")) -//// query.append("region", item['C'].replace("区", "")) -//// query.append("district_name", item["D"]) -//// def stat = district_analy_data_client.find(query).first() -//// println(query) -//// item["F"] = response.getSourceAsMap()?.consumption_rating -//// item["G"] = stat?.community_rating -// item["G"] = level_maps.get(item["G"], null) -//// println(item) -//}) -//System.exit(0) -////for (def region in ["思明", "翔安", "湖里"]) { -//// DbUtils.seaweed.find(new BasicDBObject("city", "厦门").append("region", region).append("cat", "district").append("status", 0)).each { BasicDBObject dbo -> -//// println("${dbo._id.toString()}\t${dbo.city}市\t${dbo.region}区\t${dbo.name}\t${dbo.address}") -//// } -////} - -ExcelUtils.read("C:\\Users\\goojia\\Desktop\\海南省城市均价.xlsx",1).each {List item-> - def yearMonth = DateUtil.formatByPattern(item[0], "yyyyMM").toInteger() - - println(item) -} \ No newline at end of file +ExcelUtils.multiThreadingModify("C:\\Users\\goojia\\Desktop\\区域楼盘评级.xlsx",{List item-> + item["E"] = ProvinceData.getDisplay(item[0]) + print(item) +}) \ No newline at end of file From 6363f13b0242326ff8f9243c3c8c7d8d8d3dc7b2 Mon Sep 17 00:00:00 2001 From: wangwenyan Date: Mon, 16 Jun 2025 14:04:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B9=B3=E7=B1=B3?= =?UTF-8?q?=E7=A7=9F=E9=87=91=E8=AE=A1=E7=AE=97=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../averager/InsertMonitorSquareRentCalcCommandBatch.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/averager/InsertMonitorSquareRentCalcCommandBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/averager/InsertMonitorSquareRentCalcCommandBatch.groovy index 9be5b8c21..c72b0288a 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/averager/InsertMonitorSquareRentCalcCommandBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/averager/InsertMonitorSquareRentCalcCommandBatch.groovy @@ -32,8 +32,8 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch { // public static final DSCollection SEAWEED_COLL = new DataStore("seaweed.db.fangjia.com", 27007).getCollection("fangjia.seaweed") public static final DBCollection SEAWEED_COLL = MongoUtils.getCollectionByName("fangjia", "seaweed", "mongo.db.fangjia.com") public final static DBCollection COMMAND_COLL = new MongoClient("log.mongo.db.fangjia.com", 52002).getDB('fangjia_log').getCollection('calc_command') - public final static DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com", 27017) - public final static DBCollection REGION_COLL = MongoUtils.getCollectionByName("fangjia", "region_block", "mongo.db.fangjia.com", 27017) + public final static DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com") + public final static DBCollection REGION_COLL = MongoUtils.getCollectionByName("fangjia", "region_block", "mongo.db.fangjia.com") public final static def WORKER_MACHINE_IPS = ["fangjia-priceanalysis-0", "fangjia-priceanalysis-1","fangjia-priceanalysis-2"] public final static def TOKEN="35587c9e7accc54ff7ddf2c6ebdc36a3ba065b4a2bdac78c0e9928596361b430" @@ -185,7 +185,6 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch { q.put("category", CALC_CATEGORY) q.put('status', new BasicDBObject('$in', [0,1,102])) // 0-初始状态 1-处理中 102-计算完成 2-完成 3-处理错误 4-处理异常 while(true) { - sleep(5 * 60 * 1000) def c = COMMAND_COLL.count(q) logInfo("calc command: " + c) if(c <= 0) { @@ -208,6 +207,7 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch { break; } } + sleep(5 * 60 * 1000) }