From 5d796ad2e0c32345d1a4f0df88083156c70a6e3a Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 28 Dec 2021 14:54:54 +0800 Subject: [PATCH] update --- .../ccbevaluation/BigdataBuildingBatch.groovy | 11 ++- .../ccbevaluation/BigdataForsaleBatch.groovy | 13 ++++ .../DealAndThirdPriceDataProcess.groovy | 40 +++++----- .../ccbevaluation/ExportOracleData.groovy | 49 +++++++------ .../fangjia/script/ccbevaluation/Test.groovy | 73 +++++++++++++++---- .../ccbevaluation/data/DistrictMarge.groovy | 4 +- .../ccbevaluation/data/MatchMapData.groovy | 35 +++++++-- .../script/commData/CommonDatautils.groovy | 9 +++ .../gj/district/FangjiaClientUtils.groovy | 2 +- .../script/thirdPriceCrawl/Esf58Crawl.groovy | 5 +- 10 files changed, 168 insertions(+), 73 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataBuildingBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataBuildingBatch.groovy index 29e3ac2a4..2fa1ecd76 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataBuildingBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataBuildingBatch.groovy @@ -3,6 +3,7 @@ package com.fangjia.script.ccbevaluation import com.fangjia.script.BaseBatch import com.fangjia.script.BatchOwner import com.fangjia.script.Watcher +import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.gj.ccb.CcbCodeUtils import com.fangjia.script.gj.ccb.FileUtils import com.fangjia.script.util.DateUtils @@ -22,8 +23,7 @@ class BigdataBuildingBatch extends BaseBatch{ @Override public void process(Object args) { - //def citys = CcbCommonUtils.citys; - def citys = ["苏州","北京","广州","杭州","合肥","深圳","石家庄","武汉","西安","重庆"] + def citys = CcbCommonUtils.citys; def rows = [] def headers = [] for (def city : citys) { @@ -35,9 +35,12 @@ class BigdataBuildingBatch extends BaseBatch{ if(buildingMap){ def distMap = getDistrictMap(city) def rets = createCityDatas(cityCodeDatas, distCodeMap, distMap, buildingMap) -// rows.addAll(rets) println city + " " + rets.size() - FileUtils.batchCreateFile(rets, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\bigdata_building_fjw.dat", headers, "utf-8", true); + def fileName = "/home/goojia/ccb/BIGDATA_COMMUNITY_GJ.dat" + if(CommonDatautils.isWindow()){ + fileName = "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_COMMUNITY_GJ.dat" + } + FileUtils.batchCreateFile(rets, fileName, headers, "utf-8", true); } } } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy index 3c8299fed..41273e6c3 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy @@ -271,10 +271,23 @@ class BigdataForsaleBatch extends BaseBatch{ if(!seawater.avg_price){ continue; } + if(seawater.name && seawater.name.contains("商住")){ + continue; + } + + if(seawater.estate_type && seawater.estate_type.contains("商住")){ + continue; + } + + if(seawater.purpose && seawater.purpose.contains("商住")){ + continue; + } if(!seawater.height){ seawater.height = null } + + // if(seawater.height && seawater.height<1){ // continue; // } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/DealAndThirdPriceDataProcess.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/DealAndThirdPriceDataProcess.groovy index 633e69759..e21a8556a 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/DealAndThirdPriceDataProcess.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/DealAndThirdPriceDataProcess.groovy @@ -35,29 +35,29 @@ class DealPriceDataProcess { def thirdMonth = 202111 def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\估值模型测试202112_1223 - 副本.xlsx",0,1) for(def d : datas){ -// if(d['G']){ -// def rets = findDealByPe(d['A'], yearMonth, d['G']) -// for(def r : rets){ -// deleteDealPrice(r) -// } -// } - - if(d['H']){ - def rets = findCityByPpeRange(d['A'], yearMonth, 15, 20) - for(def m : rets){ - def precent = d['H']/100.0 - def newPrice = null - if(m.unit_price > m.deal_price){ - newPrice = m.deal_price*precent + m.deal_price - }else if(m.unit_price < m.deal_price){ - newPrice = m.deal_price - (m.deal_price*precent) - } - if(newPrice){ - updateDealPrice(m, newPrice.toInteger()) - } + if(d['G']){ + def rets = findDealByPe(d['A'], yearMonth, d['G']) + for(def r : rets){ + deleteDealPrice(r) } } +// if(d['H']){ +// def rets = findCityByPpeRange(d['A'], yearMonth, 15, 20) +// for(def m : rets){ +// def precent = d['H']/100.0 +// def newPrice = null +// if(m.unit_price > m.deal_price){ +// newPrice = m.deal_price*precent + m.deal_price +// }else if(m.unit_price < m.deal_price){ +// newPrice = m.deal_price - (m.deal_price*precent) +// } +// if(newPrice){ +// updateDealPrice(m, newPrice.toInteger()) +// } +// } +// } + // if(d['M']){ // def rets = findThirdByPe(d['A'], yearMonth, d['M']) // for(def r : rets){ 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 40e695632..8749dacb7 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,7 +24,7 @@ class ExportOracleData { } def run() { - +// // exportGuidedPrice() // exportCommunityGuidedPrice() // @@ -43,18 +43,18 @@ class ExportOracleData { // exportBigdataCommunity() // exportBigdataDeal("2021-11-01") -// exportAvmEvaluationGJNB(202111) -// exportAVMEvaluationItemGJNB(202111) -// exportCommunityBasePrice(202111) +// exportAvmEvaluationGJNB(202112) +// exportAVMEvaluationItemGJNB(202112) +// exportCommunityBasePrice(202112) +// +// exportCityPrice(202112) +// exportRegionPrice(202112) -// exportCityPrice(202111) -// exportRegionPrice(202111) +// exportCommunityBasePriceGj(202112) -// exportCommunityBasePriceGj(202111) - - exportCommunityPdescribeGj(202112) +// exportCommunityPdescribeGj(202112) // exportCommCaseDetailGj(202112) -// exportLastFile() + exportLastFile() } @@ -615,7 +615,7 @@ class ExportOracleData { "DEAL_COEFFICIENT, DEAL_RATE_MEDIAN, THIRD_TEST_CASE_NUM, THIRD_TEST_COMM_NUM, THIRD_TEST_COMM_COVERAGE, THIRD_PPE15_COVERAGE, THIRD_COEFFICIENT, THIRD_RATE_MEDIAN, \n" + "to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from avm_evaluation_gj where YEAR_MONTH = ${yearMonth}"; def allRows = [] - sqlInstance2.eachRow(sql,{r-> + sqlInstance.eachRow(sql,{r-> def data = [] data << r.ID data << r.CITYID @@ -677,7 +677,7 @@ class ExportOracleData { "to_char(DEALDATE,'yyyy-mm-dd hh24:mi:ss') as DEALDATE, UNIT_PRICE, BUILDAREA, FITMENT, HOUSEASPECT, FLOORNUM, FLOORCNT, DATA_TYPE, RATE, PE, \n" + "to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME from avm_evaluation_item_gj where YEAR_MONTH = ${yearMonth}"; def allRows = [] - sqlInstance2.eachRow(sql,{r-> + sqlInstance.eachRow(sql,{r-> def data = [] data << r.ID data << r.CITYID @@ -725,7 +725,7 @@ class ExportOracleData { def exportCommunityBasePrice(yearMonth){ def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, COMMID, COMMNAME, YEAR_MONTH, CALC_AVG_PRICE, AVG_PRICE, CALC_TYPE, FAKE_RATE, DIFF_RATE, CONFI_RATE, CORR_RATE, CONFIDENCE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from community_base_price_gj where year_month=${yearMonth}"; def allRows = [] - sqlInstance2.eachRow(sql,{r-> + sqlInstance.eachRow(sql,{r-> def data = [] data << r.ID data << r.CITYID @@ -768,7 +768,7 @@ class ExportOracleData { def exportCommunityBasePriceGj(yearMonth){ def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, COMMID, COMMNAME, YEAR_MONTH, CALC_AVG_PRICE, AVG_PRICE, CALC_TYPE, FAKE_RATE, DIFF_RATE, CONFI_RATE, CORR_RATE, CONFIDENCE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from community_base_price_gj where year_month=${yearMonth}"; def allRows = [] - sqlInstance2.eachRow(sql,{r-> + sqlInstance.eachRow(sql,{r-> def data = [] data << r.ID data << r.CITYID @@ -807,7 +807,7 @@ class ExportOracleData { def exportCityPrice(month){ def sql = "select ID, CITYID, CITYNAME, YEAR_MONTH, CALC_AVG_PRICE, PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from city_price_gj where year_month=${month}"; def allRows = [] - sqlInstance2.eachRow(sql,{r-> + sqlInstance.eachRow(sql,{r-> def data = [] data << r.ID data << r.CITYID @@ -836,7 +836,7 @@ class ExportOracleData { def exportRegionPrice(month){ def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, YEAR_MONTH, CALC_AVG_PRICE, PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from DISTRICT_PRICE_GJ where year_month=${month}"; def allRows = [] - sqlInstance2.eachRow(sql,{r-> + sqlInstance.eachRow(sql,{r-> def data = [] data << r.ID data << r.CITYID @@ -866,18 +866,18 @@ class ExportOracleData { def exportCommunityPdescribeGj(month){ - def citys = CcbCommonUtils.citys; - def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() +// def citys = CcbCommonUtils.citys; +// def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28" def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_P_DESCRIBE_GJ_ADD_${curDate}_0001.dat" if(CommonDatautils.isWindow()){ fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_COMMUNITY_P_DESCRIBE_GJ_ADD_${curDate}_0001.dat" } def headers = [] - - for(def city : citys) { - def cityCode = cityCodeDataMap.get(city) - def sql = "select ID,COMMUNITY_ID,CITYID ,CITY_NAME,DISTRICT_CODE ,DISTRICT_NAME,COMMUNITY_NAME,PQ_NAME,BASE_PRICE,CONFIDENCE_LEVEL,CNT,MIN_PRICE,MEDIANPRICE,MEANPRICE,MAX_PRICE,TIME,FIRSTDATAT,THIRDDATA,RELATIVEERROR,SKEWNESS,PQ_PRICE_RANGE,DISTRICT_PRICE_RANGE ,DESCRIPTION,PRIV_BASE_PRICE,IS_ARTTFICIAL,PRIV_FINAL_PRICE,to_char(CREATE_DATE,'yyyy-mm-dd') as CREATE_DATE,PRICE,PRICE_SOURCE,CASE_MD_PRICE,CASE_AVG_PRICE,INDEX_LABEL,MAIN_PROPERTY,COMMTYPE,NEW_DEAL_PRICE,to_char(NEW_DEAL_DATE,'yyyy-mm-dd') as NEW_DEAL_DATE,PRICE_MOM_RATIO,MAX_MOM_RATIO,PRICE_YOY_RATIO ,SATUR_RATIO,NEIGHBOR_PRICE from community_p_describe_gj where cityid='${cityCode}'"; +// +// for(def city : citys) { +// def cityCode = cityCodeDataMap.get(city) + def sql = "select ID,COMMUNITY_ID,CITYID ,CITY_NAME,DISTRICT_CODE ,DISTRICT_NAME,COMMUNITY_NAME,PQ_NAME,BASE_PRICE,CONFIDENCE_LEVEL,CNT,MIN_PRICE,MEDIANPRICE,MEANPRICE,MAX_PRICE,TIME,FIRSTDATAT,THIRDDATA,RELATIVEERROR,SKEWNESS,PQ_PRICE_RANGE,DISTRICT_PRICE_RANGE ,DESCRIPTION,PRIV_BASE_PRICE,IS_ARTTFICIAL,PRIV_FINAL_PRICE,to_char(CREATE_DATE,'yyyy-mm-dd') as CREATE_DATE,PRICE,PRICE_SOURCE,CASE_MD_PRICE,CASE_AVG_PRICE,INDEX_LABEL,MAIN_PROPERTY,COMMTYPE,NEW_DEAL_PRICE,to_char(NEW_DEAL_DATE,'yyyy-mm-dd') as NEW_DEAL_DATE,PRICE_MOM_RATIO,MAX_MOM_RATIO,PRICE_YOY_RATIO ,SATUR_RATIO,NEIGHBOR_PRICE from community_p_describe_gj"; def allRows = [] sqlInstance.eachRow(sql, { r -> def data = [] @@ -924,9 +924,9 @@ class ExportOracleData { data << r.NEIGHBOR_PRICE allRows << data }); - println city + " "+allRows.size() + println allRows.size() FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", true); - } +// } println "community_p_describe_gj 数据文件输出完成......" CcbFtpUtils.ftpUpload(fileName, curDate) println "community_p_describe_gj 上传Ftp完成......" @@ -980,6 +980,7 @@ class ExportOracleData { if(CommonDatautils.isWindow()){ dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\${curDate}.ok" } + FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); CcbFtpUtils.ftpUpload(dataCodeFileName, curDate) } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/Test.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/Test.groovy index 9450808e8..0707c749c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/Test.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/Test.groovy @@ -224,18 +224,18 @@ def youdaDeal(youda_esfhouse_coll, def city, def region, def name, def area, def } -def fileName = "D:\\数据\\建行\\房产估值\\成交数据_1222 - 副本.xlsx" -def dealMap = findDealCount(sqlInstance236, "2021-11-01", "2021-12-01") -def testMap = findCaluateCityPPE(sqlInstance236, 202112) -ExcelUtils.modify(fileName,{d-> - if(d['C']){ - def oldcount = dealMap.get(d['C']) - d['P'] = oldcount - def casecount = testMap.get(d['C']) - d['Q'] = casecount - println d - } -},0) +//def fileName = "D:\\数据\\建行\\房产估值\\成交数据_1222 - 副本.xlsx" +//def dealMap = findDealCount(sqlInstance236, "2021-11-01", "2021-12-01") +//def testMap = findCaluateCityPPE(sqlInstance236, 202112) +//ExcelUtils.modify(fileName,{d-> +// if(d['C']){ +// def oldcount = dealMap.get(d['C']) +// d['R'] = oldcount +// def casecount = testMap.get(d['C']) +// d['S'] = casecount +// println d +// } +//},0) //ExcelUtils.multiThreadingModify("D:\\数据\\小区\\5个城市小区列表0723(1).xlsx",{d-> // if(d['I'] && d['K']){ @@ -271,7 +271,7 @@ ExcelUtils.modify(fileName,{d-> //},0) //def index = 0 -//ExcelUtils.modify("D:\\数据\\建行\\房产估值\\小区\\第四批需要删除的数据.xlsx",{d-> +//ExcelUtils.modify("D:\\数据\\建行\\房产估值\\小区\\补充数据删除3658_1228.xlsx",{d-> // if(d['A']){ // def udata = new BasicDBObject() // udata.put("name_cat", 11) @@ -284,6 +284,53 @@ ExcelUtils.modify(fileName,{d-> // println index // } //},0) +ExcelUtils.modify("D:\\数据\\建行\\房产估值\\小区\\补充删除数据1223_1228.xlsx",{d-> + if(d['A']){ + def region = d['B'] + def newRegion = RegionData.formatRegion(d['A'], region) + if(newRegion) { + def dist = CommonDatautils.findDistrict(d['A'], newRegion, d['C'], "district") + if(dist){ + def udata = new BasicDBObject() + udata.put("name_cat", 11) + udata.put("m_date",new Date()) + + def q = new BasicDBObject() + q.put("_id", dist._id) + DbUtils.seaweed.update(q, new BasicDBObject('$set', udata)) + }else{ + println d + } + } + } +},0) + +//def citys = CcbCommonUtils.citys +//def rets = [] +//for(def city : citys){ +// def count = CommonDatautils.findSeaweeds(city, "district", 1) +// rets << [city, count] +//} +//ExcelUtils.write("D:\\数据\\建行\\房产估值\\小区\\统计.xlsx", rets, "数据") + +//def citys = ["广州","重庆","深圳","上海","北京","南京","泉州"] +//for(def city : citys){ +// def districts = CommonDatautils.findAllDistrictByCity(city, "district", ["name_cat"]) +// def index = 0 +// for(def dist : districts){ +// if(dist.name_cat && dist.name_cat==1){ +// def udata = new BasicDBObject() +// udata.put("name_cat", 0) +// udata.put("m_date",new Date()) +// +// def q = new BasicDBObject() +// q.put("_id", dist._id) +// DbUtils.seaweed.update(q, new BasicDBObject('$set', udata)) +// index++ +// } +// } +// println city +" "+index +//} //ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\小区\\价格过滤的小区.xlsx",{d-> diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/DistrictMarge.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/DistrictMarge.groovy index 88156feec..d15caa8a7 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/DistrictMarge.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/DistrictMarge.groovy @@ -103,7 +103,7 @@ class DistrictMarge { DbUtils.seaweed.update(q, new BasicDBObject('$set', mudata)) updateIndex++ - println "删除:"+updateObj['A'] + println "修改:"+updateObj['A'] + " "+ mudata }else{ println amap_id+" 此组无更新" } @@ -117,7 +117,7 @@ class DistrictMarge { } def getDatas(){ - def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\小区\\第四批修正的重复数据_1363.xlsx",0,1) + def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\小区\\重庆反查数据_669(审核完毕)(1).xlsx",0,1) def map = [:] for(def d : datas){ if(d['E']){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/MatchMapData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/MatchMapData.groovy index a1edd0ef0..663546757 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/MatchMapData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/MatchMapData.groovy @@ -4,6 +4,7 @@ import com.fangjia.core.RegionData import com.fangjia.core.util.GeoUtils import com.fangjia.script.ccbevaluation.CcbCommonUtils import com.fangjia.script.commData.CommonDatautils +import com.fangjia.script.gj.district.FangjiaClientUtils import com.fangjia.script.gj.district.SeaweedDataMatchProcess import com.fangjia.script.util.DateUtils import com.fangjia.script.util.ElasticUtils @@ -128,20 +129,23 @@ class MatchMapData { } def run(){ - - def files = ["合肥","上海","北京","广州","杭州","深圳","石家庄","天津","武汉","西安","重庆"] + //"合肥", + def files = ["上海","北京","广州","杭州","深圳","石家庄","天津","武汉","西安","重庆","苏州"] for(def f : files){ - def city = f + def city = f.replace("-2","") def lastYear = DateUtils.add(DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd"), -365) def lastWeekend = DateUtils.getFirstDayOfWeek(DateUtils.parseFromTightYYYYMMDD(lastYear)) def districtPriceMap = CommonDatautils.queryAllDistrictPriceByWeekend(city, lastWeekend) + def datas = [] + datas << ["城市编码","区域编码","ID","小区名","Wgs85经度","Wgs84纬度","租售比","小区涨跌幅","物业类型"] ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\小区\\融合\\租售比\\"+f+".xlsx",{d-> + def regionCode = null if(d['E']){ def region = d['E'] def newRegion = RegionData.formatRegion(city, region) - if(newRegion){ + regionCode = getRegionCode(newRegion) def dist = CommonDatautils.findDistrict(city, newRegion, d['F'],"district") if(dist){ d['K']="完全一致" @@ -172,6 +176,9 @@ class MatchMapData { if(priceObj){ def markup = (nearDbo.avg_price - priceObj.avg_price)*100/priceObj.avg_price d['M'] = com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, markup) + }else{ +// FangjiaClientUtils.sendDistrictPriceCalculate(dist.city, dist.region, dist.name, 60); +// println dist.city+" "+ dist.region+ " "+ dist.name } } if(nearDbo && sqmetre){ @@ -185,11 +192,25 @@ class MatchMapData { } } + datas << [d['B'], regionCode, d['D'], d['F'], d['I'], d['H'], d['N'], d['M'], d['O']] + },0) + + ExcelUtils.write("D:\\数据\\建行\\房产估值\\小区\\融合\\租售比\\详情2\\"+city+".xlsx", datas, "数据") } } + def getRegionCode(def region){ + def spell = com.fangjia.core.util.DataUtil.hanyuQuanpin(region, " ") + def arrs = spell.split(" ") + def s = new StringBuffer() + for(def ar : arrs){ + s.append(ar.substring(0,1).toUpperCase()) + } + return s.toString(); + } + def findHouses(def city, def region, def cat, def startDate, def endDate, def name, def alias){ @@ -293,10 +314,10 @@ class MatchMapData { rets << ["建行小区id", "房价网小区id","城市","区域","楼盘名称","单价","月租金","面积","室","厅","卫","出租方式","朝向","楼屋","装修","发布时间"] ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\小区\\融合\\" + f + ".xlsx", { d -> def flag = d['K'] - if(flag && flag =="完全一致"){ + if(flag && flag =="完全一致" && !d['J']){ def obj = CommonDatautils.findDistrict(city, d['M'], d['N'], "district") if(obj){ - def houses = findHouses3(d['D'], obj._id.toString(), city, d['M'], "rent", 20210801, 20210901, d['N'], null); + def houses = findHouses3(d['D'], obj._id.toString(), city, d['M'], "rent", 20210801, 20211101, d['N'], null); if(houses){ rets.addAll(houses) } @@ -305,7 +326,7 @@ class MatchMapData { } },0) - ExcelUtils.write("D:\\数据\\建行\\房产估值\\小区\\融合\\租房\\"+city+"_rent.xlsx", rets, "数据") + ExcelUtils.write("D:\\数据\\建行\\房产估值\\小区\\融合\\租房2\\"+city+"_rent.xlsx", rets, "数据") } } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy index ee7114640..70c90b65f 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy @@ -1190,6 +1190,15 @@ class CommonDatautils { return obj; } + static def findSeaweeds(city, cat, name_cat){ + DBObject q = new BasicDBObject(); + q.put('city',city) + q.put('cat', cat) + q.put('status',0) + q.put('name_cat',name_cat) + SEAWEED_COLL.count(q) + } + static def findAllSeaweed(def cat , def city){ DBObject q = new BasicDBObject(); q.put('city',city) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy index ac634e9e9..e68350d78 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy @@ -38,7 +38,7 @@ class FangjiaClientUtils { } public static def sendDistrictPriceCalculate(def city, def region, def name, def count){ - def url = "http://192.168.0.19:38080/FangJiaDataService/districtPriceCalculate?category=sell&city="+city+"&count="+count+"&name="+name+"®ion="+region+"&retainHistory=true" + def url = "http://192.168.0.100:38080/FangJiaDataService/districtPriceCalculate?category=sell&city="+city+"&count="+count+"&name="+name+"®ion="+region+"&retainHistory=true" // def url = "http://192.168.10.19:8080/FangJiaDataService/districtPriceCalculate?category=sell&city="+city+"&count="+count+"&name="+name+"®ion="+region+"&retainHistory=true" def content = null; try{ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy index c160a713a..2bffdeb62 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy @@ -38,9 +38,10 @@ class Esf58Crawl extends BaseBatch{ def static useDistKeys = [] static def totalCount = new AtomicLong() //"福州":"fz|304","合肥":"hf|837","芜湖":"wuhu|2045","蚌埠":"bengbu|3470","阜阳":"fy|2325","淮南":"hn|2319","成都":"cd|102","上海":"sh|2", "北京":"bj|1","天津":"tj|18", - //"重庆":"cq|37","石家庄":"sjz|241","广州":"gz|3","深圳":"sz|4","东莞":"dg|413","佛山":"fs|222","杭州":"hz|79","武汉":"wh|158", + //"重庆":"cq|37","石家庄":"sjz|241","广州":"gz|3","深圳":"sz|4","东莞":"dg|413","佛山":"fs|222","杭州":"hz|79","武汉":"wh|158","青岛":"qd|122","南京":"nj|172", + //"嘉兴":"jx|497","大连":"dl|147","乌鲁木齐":"xj|984","太原":"ty|740","兰州":"lz|952","南昌":"nc|669", def cityList = [ - "青岛":"qd|122","南京":"nj|172","嘉兴":"jx|497","大连":"dl|147","乌鲁木齐":"xj|984","太原":"ty|740","兰州":"lz|952","南昌":"nc|669", + "沈阳":"sy|188","西安":"xa|483","苏州":"su|5","无锡":"wx|93","潍坊":"wf|362","常州":"cz|463", "南通":"nt|394","吉林":"jl|700","中山":"zs|771","台州":"tz|403","东营":"dy|623","三亚":"sanya|2422", "呼和浩特":"hu|811","济南":"jn|265","温州":"wz|330","咸阳":"xianyang|7453","安庆":"anqing|3251","宿州":"suzhou|3359","六安":"la|2328","唐山":"ts|276","商丘":"sq|1029","大同":"dt|6964","威海":"weihai|518","安阳":"ay|1096", "临汾":"linfen|5669","临沂":"linyi|505","九江":"jj|2247","淄博":"zb|385","盐城":"yancheng|613","烟台":"yt|228","信阳":"xy|8694","南充":"nanchong|2378","洛阳":"luoyang|556","南阳":"ny|592","厦门":"xm|606",