From 03a70e98a65870aa93a2f2e9e515b296ced4ea95 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Tue, 15 Jul 2025 20:41:10 +0800 Subject: [PATCH] update --- .../fuzhou/DistrictPriceExportBatch.groovy | 18 ++++++++++------ .../script/fuzhou/FzDataResultStat.groovy | 15 ++++++------- .../fangjia/script/gj/abc/SuzouPocTest.groovy | 21 ++++++++++++++++++- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy index c6a241b54..d6857d489 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy @@ -57,9 +57,9 @@ class DistrictPriceExportBatch extends BaseBatch{ } def sb = appendResult(headers, results) DataHandleUtils.outPutFile(fileName, sb, charset); -// FzFtpUtils.ftpUpload(fileName) -// //生成加密数据文件并上传 -// FzFtpUtils.uploadSha512Data2(fileName, dataCodeFileName, charset); + FzFtpUtils.ftpUpload(fileName) + //生成加密数据文件并上传 + FzFtpUtils.uploadSha512Data2(fileName, dataCodeFileName, charset); } def selectLastResultDatas(def rets){ @@ -73,6 +73,7 @@ class DistrictPriceExportBatch extends BaseBatch{ def appendResult(def headers, def ret){ + def sb = new StringBuffer(); // sb.append(headers.join("@|@")) // sb.append(System.getProperty("line.separator")); @@ -121,11 +122,16 @@ class DistrictPriceExportBatch extends BaseBatch{ def day = new Date().getDate() def startMDate = DateUtils.truncateDay(new Date()-1) def endMDate = DateUtils.truncateDay(new Date()) - if(day == 15){ + if(CommonDatautils.isWindow()){ districts = getFzDistricts(city, null, null) - }else{ - districts = getFzDistricts(city, startMDate, endMDate) + } else{ + if(day == 15){ + districts = getFzDistricts(city, null, null) + }else{ + districts = getFzDistricts(city, startMDate, endMDate) + } } + def curPriceMap = findFzDistrictSellStat("福州",curDate) def result = [] for(def rMap : districts){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/FzDataResultStat.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/FzDataResultStat.groovy index 8ebd96798..139a37980 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/FzDataResultStat.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/FzDataResultStat.groovy @@ -29,11 +29,11 @@ class FzDataResultStat { static main(args) { def task = new FzDataResultStat() - task.priceMarkupRun(); +// task.priceMarkupRun(); // task.regionPriceTrendRun() //// task.margeExcel() // task.saveCsvData() -// task.testNewPrice() + task.testNewPrice() } def margeExcel(){ @@ -119,7 +119,7 @@ class FzDataResultStat { index++ println row } - ExcelUtils.write("D:\\数据\\福州\\价格比对4_${curMonth}.xlsx", rows, "数据") + ExcelUtils.write("D:\\数据\\福州\\价格比对5_${curMonth}.xlsx", rows, "数据") def regions = ["鼓楼","仓山","台江","晋安","马尾","长乐"]; @@ -301,16 +301,13 @@ class FzDataResultStat { } def testNewPrice(){ - ExcelUtils.modify("D:\\数据\\福州\\价格比对_20240315 -价格入库.xlsx",{d-> + ExcelUtils.modify("D:\\数据\\福州\\福州200个小区抽样价格核验202507.xlsx",{d-> if(d['A']){ def q = new BasicDBObject() - q.put("city", d['A']) - q.put("region",d['B']) - q.put("name",d['C']) - q.put("month", 202402) + q.put("comm_id", d['A']) def obj = FZ_DISTRICT_STAT_COLL.findOne(q) if(obj){ - d['S'] = obj.avg_price + d['D'] = obj.avg_price } } }) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/abc/SuzouPocTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/abc/SuzouPocTest.groovy index b2c8548ad..2721a0641 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/abc/SuzouPocTest.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/abc/SuzouPocTest.groovy @@ -27,10 +27,29 @@ class SuzouPocTest { static main(args) { def task = new SuzouPocTest() // task.run() - task.newRun() +// task.newRun() + task.test() + } + + def test(){ + ExcelUtils.modify("D:\\数据\\上海联合产权交易所\\第1批拟处置房产清单(长城大厦、台山碧桂园).xlsx", { d -> + if(d['O']){ + def floorAdds = d['I'].split("/") + def ret1 = OpenApiClient.addressEvaluation(d['O'], null, d['D'], d['D'], d['K'], floorAdds[0], floorAdds[1]) + if (ret1) { + d['N'] = ret1.totalPrice + d['M'] = ret1.avgPrice + d['P'] = ret1.district + d['Q'] = ret1.name + } + } + + }); + } def newRun(){ + println("start:"+new Date().toString()) def filePath = "D:\\数据\\江苏农行\\押品填报表_测试数据样例-给公司.xls" newMatch(filePath)