From 431ae4aa1b1cfd609ac4f20a2e215476ce2ff985 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 19 Jan 2022 16:38:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/BigdataDealBatch.groovy | 2 +- .../ccbevaluation/ExportOracleData.groovy | 34 +++++++++---------- .../ccbevaluation/StagingDistrictBatch.groovy | 2 +- .../ccbevaluation/ThirdPartyPriceBatch.groovy | 6 ++-- .../gj/paimai/LianjiaCrawlByChrome.groovy | 14 +++++--- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy index 39b653a2f..e38ff62f4 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy @@ -42,7 +42,7 @@ class BigdataDealBatch extends BaseBatch{ DBCollection DIST_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_stat", "mongo.db.fangjia.com") - def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", + def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl", "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") static main(args) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy index bc608f48f..b3f07018c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy @@ -24,36 +24,36 @@ class ExportOracleData { } def run() { - def curMonth = 202112//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), 0, "yyyyMM")); + def curMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), 0, "yyyyMM")); def lastMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); -// exportGuidedPrice() -// exportCommunityGuidedPrice(lastMonth.toString()+"28") -// + + //不会变 + exportEvaluationRateData() + exportBigdataPoiData() + exportBigdataDistrictData() + + exportGuidedPrice()//随人工改变 + exportCommunityGuidedPrice(lastMonth.toString()+"28")//随政策 + + //处理小区情况 + exportBigdataCommunity() + exportCommunityStaging() + exportCommunityBuileType() + // //exportThirdPartyPrice()//废弃掉,老表 // exportThirdPartyPrice2(lastMonth) -// -// -// // exportBigdataForsale("2021-11-19") -// -// exportEvaluationRateData() -// exportBigdataPoiData() -// exportCommunityStaging() -// exportCommunityBuileType() -// exportBigdataDistrictData() -// exportBigdataCommunity() -// exportBigdataDeal("2021-11-01") +// exportBigdataDeal("2021-11-01") // exportAvmEvaluationGJNB(curMonth) // exportAVMEvaluationItemGJNB(curMonth) -// // exportCityPrice(curMonth) // exportRegionPrice(curMonth) // exportCommunityBasePriceGj(curMonth)//已合下面的合并 - exportCommunityBasePrice(curMonth) +// exportCommunityBasePrice(curMonth) // exportCommunityPdescribeGj(curMonth) // exportCommCaseDetailGj(curMonth) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/StagingDistrictBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/StagingDistrictBatch.groovy index 6f9584e40..532a96c43 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/StagingDistrictBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/StagingDistrictBatch.groovy @@ -40,7 +40,7 @@ class StagingDistrictBatch extends BaseBatch{ results << headers results.addAll(rows) - ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\COMMUNITY_STAGING_GJ.xlsx", results, "数据") + //ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\COMMUNITY_STAGING_GJ.xlsx", results, "数据") FileUtils.batchCreateFile(rows, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\COMMUNITY_STAGING_GJ.dat",headers, "utf-8", false); } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ThirdPartyPriceBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ThirdPartyPriceBatch.groovy index 32bc302ae..ca4add802 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ThirdPartyPriceBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ThirdPartyPriceBatch.groovy @@ -22,9 +22,9 @@ import java.util.concurrent.ConcurrentHashMap @BatchOwner(Watcher.GaoJuan) class ThirdPartyPriceBatch extends BaseBatch { - def sDate= 202111//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); - def startDate = 202109 - def endDate = 202111 + def sDate= 202112//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); + def startDate = 202110 + def endDate = 202112 def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -6, "yyyyMM")); static final DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "192.168.0.43") diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy index cba9e27b7..fe25a7538 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy @@ -35,6 +35,7 @@ public class LianjiaCrawlByChrome { def task = new LianjiaCrawlByChrome(); task.run() // task.run1() + task.addDealRegion(); } def run1(){ @@ -100,14 +101,16 @@ public class LianjiaCrawlByChrome { // getLogin(driver) // crawlData(driver, cityMap) - addDealRegion(); + } def addDealRegion(){ + def lastMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -1, "yyyy-MM") + lastMonth = lastMonth +"-01" def q = new BasicDBObject() q.put("region", null) q.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern("2021-12-01","yyyy-MM-dd"))) - q.put("source", new BasicDBObject('$in', ["链家在线","贝壳找房"])) + // q.put("source", new BasicDBObject('$in', ["链家在线","贝壳找房"])) def dbcursor = DEAL_PRICE_COLL.find(q) def keys = [] for(def d : dbcursor){ @@ -121,13 +124,14 @@ public class LianjiaCrawlByChrome { def query = new BasicDBObject() query.put("city", m.city) + query.put("region", null) query.put("district_name", m.name) - query.put("source", "链家在线") - query.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern("2021-12-01","yyyy-MM-dd"))) +// query.put("source", "链家在线") + query.put("trade_date", new BasicDBObject(QueryOperators.GTE, DateUtils.parseFromTightByPattern(lastMonth,"yyyy-MM-dd"))) def data = new BasicDBObject() data.put("region", dist.region) - def count = DEAL_PRICE_COLL.count(query) + def ds = DEAL_PRICE_COLL.count(query) DEAL_PRICE_COLL.update(query, new BasicDBObject('$set',data), false, true) } }