From 7a81af678622dcedf19892b6a18c6e3e82b8073c Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 27 Dec 2022 09:14:39 +0800 Subject: [PATCH] =?UTF-8?q?94-=E3=80=8B236?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/CcbFtpTestUtils.groovy | 2 +- .../DealAndThirdPriceDataProcess.groovy | 43 +++++++++++++++++-- .../ccbevaluation/ExportOracleDataTest.groovy | 2 +- .../ccbevaluation/GuiDingPriceBatch.groovy | 2 +- .../fangjia/script/ccbevaluation/Test.groovy | 33 ++++++++------ .../ronghe/ExportDistrictRongHe.groovy | 2 +- 6 files changed, 64 insertions(+), 20 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbFtpTestUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbFtpTestUtils.groovy index 81958589e..00ed6bf6e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbFtpTestUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbFtpTestUtils.groovy @@ -7,7 +7,7 @@ import org.apache.commons.codec.digest.DigestUtils class CcbFtpTestUtils { - static def ftpServer = "192.168.0.86"//45 + static def ftpServer = "192.168.0.45"//45 static def ftpPort = 17495 static def ftpUser = "ccb" static def ftpPassword = "ccb!@#" 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 e67f2a8cc..6b28570f1 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 @@ -25,8 +25,9 @@ class DealPriceDataProcess { def task = new DealPriceDataProcess() // task.process()//运当成交pe值不好时行,拉升成交价格及删除pe太大数据 // task.addLianJiaPrice(); - task.deleteThirdPartyData() +// task.deleteThirdPartyData() // task.delDealByPe() + task.delDealData() } def delDealByPe(){ @@ -370,20 +371,33 @@ class DealPriceDataProcess { def deleteThirdPartyData(){ - def citys = CcbCommonUtils.citys_92 - def month = 202210 + def citys = CcbCommonUtils.citys_all + def month = 202211 def rows = [] def cityCodeDatas = CcbCommonUtils.findCityCodeValue() + def set = new HashSet() for(def city : citys) { - def rets = findPeGteThirdParty(city, 202211) + def rets = findPeGteThirdParty(city, 202212) def total = 0 println city +" "+rets.size() + if(rets){ + set.add(city) + } for(def m : rets){ def cityId = cityCodeDatas.get(city) def sql = "delete from BIGDATA_THIRD_PARTY_PRICE_GJ where cityid='${cityId}' and commid='${m.commid}' and price_date=${month} and community_price=${m.price}" sqlInstance236.executeUpdate(sql) } } + println set.toString() + } + + def findThirdCount(sqlInstance236, sql){ + def count = 0 + sqlInstance236.eachRow(sql,{r-> + count = r.count() + }); + return count } def findPeGteThirdParty(cityName, yearmonth){ @@ -398,4 +412,25 @@ class DealPriceDataProcess { return rets } + def delDealData(){ + ExcelUtils.modify("D:\\数据\\建行\\房产估值\\成交\\杭州成交删除12-23.xlsx", { d -> + if(d['A']){ + def count = delDealDataByid(d['A'],d['K'].toString().toDouble(), d['H'].toString().toDouble().toInteger()) + println d['B']+" "+count + } + }) + } + + def delDealDataByid(commid, area, price){ + def sql = "select count(*) as count from bigdata_deal_gj where commid='${commid}' and buildarea=${area} and DEALUNITPRICE=${price} " + + "and dealdate>=TO_DATE('2022-11-01','yyyy-MM-dd')" +// sqlInstance236.executeUpdate(sql) + def count = 0 + sqlInstance236.eachRow(sql,{r-> + count = r.count + }); + return count + } + + } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleDataTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleDataTest.groovy index a368aeb87..c4d5579f4 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleDataTest.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleDataTest.groovy @@ -14,7 +14,7 @@ import java.sql.ResultSet class ExportOracleDataTest { - def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.94:1521:orcl", + def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl", "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") def cityCodeMap = CcbCommonUtils.findCityCodeValue() diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/GuiDingPriceBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/GuiDingPriceBatch.groovy index 0882eba51..537e09d1e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/GuiDingPriceBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/GuiDingPriceBatch.groovy @@ -47,7 +47,7 @@ class GuiDingPriceBatch extends BaseBatch{ def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) //添加自己库中的人工指导价 - def prices = CcbCommonUtils.findPersonPrice(city, "2022-11-25", "2022-12-19") + def prices = CcbCommonUtils.findPersonPrice(city, "2022-11-25", "2022-12-24") // def prices = CcbCommonUtils.findPersonPrice(city, "2022-01-01", "2022-11-22") if(prices){ def distMap = getDistrictMap(city) 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 b7afc9818..14a238118 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 @@ -1087,6 +1087,15 @@ def findThirdCommCount(cityid, sqlInstance){ //} +def fileName = "D:\\数据\\建行\\房产估值\\指导价\\国信达价格-杭州.xlsx" +ExcelUtils.multiThreadingModify(fileName, { d -> + def dist = CommonDatautils.findDistrictById(d['A']) + if(dist){ + d['C'] = dist.city + d['D'] = dist.region + d['E'] = dist.name + } +}) //def fileName = "D:\\数据\\建行\\房产估值\\指导价\\0922入库数据.xlsx" //def datas = ExcelUtils.read(fileName, 0, 1) @@ -1149,18 +1158,18 @@ def findThirdCommCount(cityid, sqlInstance){ -ExcelUtils.modify("D:\\数据\\建行\\二期\\付.xlsx",{d-> - def obj = CommonDatautils.findDistrict(d['D'],d['L'], d['K'], "district") - if(obj){ - def count = findGuidedPrice(sqlInstance236, obj._id.toString()) - if(count){ - d['M'] = "存在" - } - d['N'] = obj.name_cat - d['O'] = obj.estate_type2 - } - -}) +//ExcelUtils.modify("D:\\数据\\建行\\二期\\付.xlsx",{d-> +// def obj = CommonDatautils.findDistrict(d['D'],d['L'], d['K'], "district") +// if(obj){ +// def count = findGuidedPrice(sqlInstance236, obj._id.toString()) +// if(count){ +// d['M'] = "存在" +// } +// d['N'] = obj.name_cat +// d['O'] = obj.estate_type2 +// } +// +//}) def findGuidedPrice(sqlInstance, id){ def count = 0 diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/ExportDistrictRongHe.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/ExportDistrictRongHe.groovy index a16f783fb..2a16ad76e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/ExportDistrictRongHe.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/ExportDistrictRongHe.groovy @@ -530,7 +530,7 @@ class ExportDistrictRongHe extends BaseBatch{ for(def city : citys) { def cityCode = cityCodeMap.get(city) - if(curDate.toString().endsWith("28")){ + if(curDate.toString().endsWith("10")){ if(new_dists){ def newstr = "('"+new_dists.join("','")+"')" def sql1 = "select CITYID, DEALID, CITYNAME, DISTID, DISTNAME, STREET, STREETNO, COMMID, COMMNAME, BUILDID, BUILDNO, BUILDNAME, UNITID, UNITNO, UNITNAME, HOUSEID, ADDRESS, BUILDYEAR, PROPTYPE, PROPYEARS, PERIODNUM, FLOORNUM, FLOORTYPE, FLOORCNT, BUILDTYPE, BUILDSTRU, BUILDAREA, LIVINGAREA, HOUSESTYLE, ROOMCNT, LIVINGROOMCNT, KITCHENCNT, BATHROOMCNT, HOUSEUSE, HOUSESTRU, HOUSEASPECT, FITMENT, EVALUATENO, DEALUNITPRICE, DEALTOTALPRICE, DECLAREPRICE, EVALUATEPRICE, CONTRACTNO, to_char(DEALDATE,'yyyy-mm-dd') as DEALDATE, DEALTYPE, PAYTYPE, DEALPERIOD, IFELEVATOR, COMPAREAGARDEN, COMPAREATERRACE, COMPAREABALCONY, COMPAREABAYWINDOW, COMPAREAATTIC, COMPAREAGARAGE, COMPAREABASEMENT, COMPAREAOTHER, DATASOURCE, AGENCYID, AGENCYNAME, REMARK, CREATETIME, UPDATETIME, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME1,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME1,SOURCECODE,WORKDATE from BIGDATA_DEAL_GJ " +