From 9e729f53664623b5fdc988d46016b15211a49427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E8=89=B3?= Date: Wed, 30 Sep 2026 21:19:31 +0800 Subject: [PATCH] fix(deploy): use projects/fangjia-script/target/fangjia-script.jar for scp --- .claude/settings.local.json | 19 +++++- Jenkinsfile | 2 +- .../script/commData/CommonDatautils.groovy | 3 +- .../com/fangjia/script/fuzhou/GongShu.groovy | 64 +++++++++++++------ .../com/fangjia/script/gj/OpenApiUtils.groovy | 2 +- .../gj/hongxing/HongXingMonthBatch.groovy | 62 ++++++++++++++---- .../com/fangjia/script/wenyan/temp/Abc.groovy | 47 +++----------- 7 files changed, 122 insertions(+), 77 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index ffc24f4fe..2e5092b58 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -18,7 +18,24 @@ "Bash(chmod +x /tmp/search_all.sh)", "Bash(/tmp/search_all.sh)", "Bash(chmod +x /tmp/extract_classes.sh)", - "Bash(/tmp/extract_classes.sh)" + "Bash(/tmp/extract_classes.sh)", + "Bash(curl -s -m 10 -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":200}}}}')", + "Bash(curl -s -m 15 -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":300}}}}' -o /tmp/es_types.json)", + "Bash(echo \"exit=$?\")", + "Bash(curl -s -m 15 -v -u elastic:elasticsearch \"http://192.168.0.89:9200/\")", + "Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":300}}}}' -o /tmp/es_types.json)", + "Bash(python -c ' *)", + "Bash(curl -s -m 30 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":3000}}}}' -o /tmp/es_types_all.json)", + "Bash(curl -s -m 60 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":3000}}}}' -o es_types_all.json)", + "Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search?size=1\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"small_type\":\"小学\"}}}')", + "Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search?size=1\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"small_type\":\"小学\"}}}' -o /tmp/es_doc.json)", + "Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search?size=2\" -o /tmp/es_doc.json)", + "Bash(python -X utf8 -c ' *)", + "Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search?size=2\" -o es_doc.json)", + "Bash(python -X utf8 -)", + "Bash(awk 'NR>=351 && NR<=630' \"projects\\\\fangjia-open\\\\src\\\\main\\\\java\\\\com\\\\fangjia\\\\open\\\\controllers\\\\PropertyController.java\")", + "Bash(awk 'NR>=351 && NR<=560 && / };/{print NR\": \"$0; exit}' \"projects\\\\fangjia-open\\\\src\\\\main\\\\java\\\\com\\\\fangjia\\\\open\\\\controllers\\\\PropertyController.java\")", + "Bash(mvn compile *)" ] } } diff --git a/Jenkinsfile b/Jenkinsfile index cf78b84ba..04a1692c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -145,7 +145,7 @@ pipeline { scp -o StrictHostKeyChecking=no \ -o HostKeyAlgorithms=+ssh-rsa \ -o PubkeyAcceptedKeyTypes=+ssh-rsa \ - deliverables/${buildDir}/target/fangjia-script.jar \ + projects/fangjia-script/target/fangjia-script.jar \ ${deployUser}@${cfg.deployHost}:/home/docker/fangjia-script/fangjia-script.jar # 上传 groovy 脚本目录 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 e3bab56b0..98900c43f 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 @@ -4995,8 +4995,7 @@ class CommonDatautils { q.put("city", city) q.put("region", region) q.put("name", name) - q.put("s_date", new BasicDBObject('$gte', startDate).append('$lte',endDate)) - + q.put("s_date", new BasicDBObject('$gte', startDate).append('$lte', endDate)) def dbcursor = thirdpartColl.find(q).sort(new BasicDBObject("s_date", -1)) def map = [:] for(def db : dbcursor){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/GongShu.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/GongShu.groovy index b877c5e6e..3239d0678 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/GongShu.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/GongShu.groovy @@ -5,6 +5,7 @@ import com.fangjia.core.util.HttpRequest import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.gj.EsUtils 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.fangjia.script.util.MongoUtils @@ -14,30 +15,55 @@ import com.mongodb.DBCollection import java.util.concurrent.atomic.AtomicInteger class GongShu { + static DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com") + static main(args) { def task = new GongShu(); task.run(); } def run() { - String path1 = "D:\\数据\\福州\\福州200个小区抽样价格核验202603.xlsx"; -// String path1 = "D:\\数据\\福州\\价格比对_20240915.xlsx"; - String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx"; -// String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx"; - String path3 = "E:\\goojia\\file\\excel文件\\福州\\福州贝壳小区.xlsx"; -// String path2 = "E:\\goojia\\file\\excel文件\\福州\\1.xlsx"; -// String path1 = "E:\\goojia\\file\\excel文件\\福州\\福州全部小区.xlsx"; -// findID(path2) -// findDelDistrict(path2) -// findDistrictByAlias(path2) -// match19UseMAP(path2) -// addFjwPrice(path2) + def data = [["ID","区域","小区名称","供数价格","贝壳成交价","安居客价格(挂牌价*0.9)","麦田价格(挂牌价*0.9)","房天下价格(挂牌价*0.9)","城市房产价格(挂牌价*0.9)","供数价格与贝壳成交价差异"]] + DbUtils.seaweed.find(DbUtils.buildSeaweedQuery("福州"), new BasicDBObject("region", 1).append("name", 1)).each { + data << [it._id.toString(), it.region, it.name] + } + for(def yearMonth in [202604,202605,202606, 202607]){ +// ExcelUtils.write("D:\\数据\\福州\\福州200个小区抽样价格核验${yearMonth}.xlsx", data, "sheet1") +// def query = new BasicDBObject() +// query.append("city", "福州") +// query.append("date", yearMonth) +// def stat = [:] +// DISTRICT_SELL_STAT.find(query, new BasicDBObject("region", 1).append("district_name", 1).append("avg_price", 1)).each { +// stat.put("${it.region}_${it.district_name}".toString(), it.avg_price) +// } +// ExcelUtils.multiThreadingModify("D:\\数据\\福州\\福州200个小区抽样价格核验${yearMonth}.xlsx",{List item-> +// item["D"] = stat.get("${item['B']}_${item['C']}".toString(), null) +// }) + priceAvg("D:\\数据\\福州\\福州200个小区抽样价格核验${yearMonth}.xlsx") + } -// match(path2, path1) -// match2(path3, path1) -// houseCase(path2) - thirdPrice(path1) - priceAvg(path1) + + + + +// String path1 = "D:\\福州200个小区抽样价格核验202604.xlsx"; +//// String path1 = "D:\\数据\\福州\\价格比对_20240915.xlsx"; +// String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx"; +//// String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx"; +// String path3 = "E:\\goojia\\file\\excel文件\\福州\\福州贝壳小区.xlsx"; +//// String path2 = "E:\\goojia\\file\\excel文件\\福州\\1.xlsx"; +//// String path1 = "E:\\goojia\\file\\excel文件\\福州\\福州全部小区.xlsx"; +//// findID(path2) +//// findDelDistrict(path2) +//// findDistrictByAlias(path2) +//// match19UseMAP(path2) +//// addFjwPrice(path2) +// +//// match(path2, path1) +//// match2(path3, path1) +//// houseCase(path2) +// thirdPrice(path1) +// priceAvg(path1) // futurePrice(path2) // rePrice(path2) } @@ -319,7 +345,7 @@ class GongShu { }) } //查找三方价格 - def thirdPrice(path1) { + def thirdPrice(path1 ,yearMonth) { def count = 0 ExcelUtils.multiThreadingModify( path1, { List d -> count++ @@ -329,7 +355,7 @@ class GongShu { def city = "福州" def region = d['B'] def name = d['C'] - def valusMap = CommonDatautils.findThirdPartyPrice(city, region, name, 202512, 202603) + def valusMap = CommonDatautils.findThirdPartyPrice(city, region, name, 202601, yearMonth) if (valusMap) { def dataMap = valusMap.get(city + "##" + region + "##" + name) if (dataMap.get("anjuke_esf_price")) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/OpenApiUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/OpenApiUtils.groovy index 5c82bb23b..2b842ee0f 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/OpenApiUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/OpenApiUtils.groovy @@ -794,7 +794,7 @@ class OpenApiUtils { static def addrVerifyXiameng(city, address, type){ address = URLEncoder.encode(address, "utf-8"); - def url = "http://192.168.0.80:32080/FangJiaAddressService/v7/villageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB" + def url = "http://192.168.0.80:32080/FangJiaAddressService/v7/villageIdentify?address=${address}&ai=1&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB" // def url = "http://localhost:8080/fangjia-open/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB" if(city){ url = url + "&city=${city}" diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/hongxing/HongXingMonthBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/hongxing/HongXingMonthBatch.groovy index 3d38d1996..04e984278 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/hongxing/HongXingMonthBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/hongxing/HongXingMonthBatch.groovy @@ -9,6 +9,7 @@ import com.fangjia.script.util.DateUtil import com.fangjia.script.util.DateUtils import com.fangjia.script.util.DbUtils import com.fangjia.script.util.ElasticUtils +import com.fangjia.script.util.ExcelRow import com.fangjia.script.util.ExcelUtils import com.fangjia.script.util.MongoUtils import com.fangjia.script.wenyan.taobao.BidRecordsParseBatch @@ -26,6 +27,7 @@ class HongXingMonthBatch extends BaseBatch{ static DBCollection OFFICE_RENT_STAT = MongoUtils.getCollectionByName("fangjia_stat", "office_rent_stat", "mongo.db.fangjia.com") static DBCollection OFFICE_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "office_sell_stat", "mongo.db.fangjia.com") static DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "deal_price", "mongo.db.fangjia.com") + static String matchIdLabel = "AM" static main(args) { runBatch(new HongXingMonthBatch(), args); } @@ -36,10 +38,11 @@ class HongXingMonthBatch extends BaseBatch{ // createTestFile(); // mergeFile() // mergeMatchId() - def fileName = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\宏信楼盘5月监测20260520交付.xlsx" - def removeAddrFile = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\20260520宏信.xlsx" + def fileName = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\宏信楼盘9月监测20260920交付.xlsx" + def removeAddrFile = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\20260920宏信.xlsx" + def addAddrData = ExcelUtils.read(removeAddrFile, 2, 1) def removeAddrs = [] - ExcelUtils.read(removeAddrFile, 0).each {List item-> + ExcelUtils.read(removeAddrFile, 1).each {List item-> removeAddrs << item["C"] } ExcelUtils.modify(fileName,{List item-> @@ -49,7 +52,7 @@ class HongXingMonthBatch extends BaseBatch{ } }) def fixPriceAddrs = [:] - ExcelUtils.read(removeAddrFile, 1).each {List item-> + ExcelUtils.read(removeAddrFile, 0).each {List item-> if(item["A"] && item["B"]){ fixPriceAddrs.put(item["A"],item["B"].toString().toDouble().toInteger()) } @@ -57,7 +60,7 @@ class HongXingMonthBatch extends BaseBatch{ } def stat = [:] //获取上个月的交付价格 - def lastMonthPriceRowId = "P" //上个月均价所在列号 + def lastMonthPriceRowId = "R" //上个月均价所在列号 ExcelUtils.read(fileName).each{List item-> if(item[lastMonthPriceRowId]){ stat.put(item["C"], item[lastMonthPriceRowId]) @@ -68,6 +71,20 @@ class HongXingMonthBatch extends BaseBatch{ def count = findCurMonthPrice(lastMonthStr) if(count > 0){ def datas = ExcelUtils.read(fileName) + for(def item in addAddrData){ + def buffer = new ExcelRow() + buffer['C'] = item["A"] + buffer['I'] = item["B"] + buffer[matchIdLabel] = item["D"] + buffer["F"] = item["E"] + buffer["G"] = item["F"] + buffer['A'] = item["G"] + buffer["B"] = item["H"] + datas.add(buffer) + if(item["A"] && item["C"]){ + fixPriceAddrs.put(item["A"],item["C"].toString().toDouble().toInteger()) + } + } def newDatas = createDatas(datas, lastMonthStr, fixPriceAddrs) def curDateStr = DateUtils.formatDateByPattern(new Date(),"yyyyMMdd") ExcelUtils.write(fileName, newDatas,"结果${curDateStr}") @@ -123,8 +140,8 @@ class HongXingMonthBatch extends BaseBatch{ def createDatas(datas, lastMonthStr, Map fixPriceAddrs){ def rows = [] - rows << ["物业类型","名称","地址","期房/现房","处置状态","省份","城市","城市排名","面积","1月评估单价(元)","1月评估总价(元)","2月评估单价(元)","2月评估总价(元)","3月评估单价", "3月评估总价(元)","4月评估单价", "4月评估总价(元)","5月评估单价", "5月评估总价(元)" - ,"环比涨跌幅(%)","计算方式","定基涨跌幅(相比首月波动)","5月区域均价","5月区域均价涨跌幅(%)","4月楼盘所在区域价格的排名(仅针对住宅)","5月楼盘所在区域价格的排名(仅针对住宅)","楼盘所在区域排名变化(仅针对住宅)","近3个月内成交量","近6个月成交量","3个月挂牌量","匹配ID-新","备注","情况说明"] + rows << ["物业类型","名称","地址","期房/现房","处置状态","省份","城市","城市排名","面积","1月评估单价(元)","1月评估总价(元)","2月评估单价(元)","2月评估总价(元)","3月评估单价", "3月评估总价(元)","4月评估单价", "4月评估总价(元)","5月评估单价","5月评估总价(元)","6月评估单价", "6月评估总价(元)","7月评估单价", "7月评估总价(元)","8月评估单价", "8月评估总价(元)","9月评估单价", "9月评估总价(元)" + ,"环比涨跌幅(%)","计算方式","定基涨跌幅(相比首月波动)","9月区域均价","9月区域均价涨跌幅(%)","8月楼盘所在区域价格的排名(仅针对住宅)","9月楼盘所在区域价格的排名(仅针对住宅)","楼盘所在区域排名变化(仅针对住宅)","近3个月内成交量","近6个月成交量","3个月挂牌量","匹配ID-新","备注","情况说明"] def index = 1 for(def d : datas){ println d['B'] @@ -147,13 +164,21 @@ class HongXingMonthBatch extends BaseBatch{ row << d['O'] row << d['P'] row << d['Q'] + row << d['R'] + row << d['S'] + row << d['T'] + row << d['U'] + row << d['V'] + row << d['W'] + row << d['X'] + row << d['Y'] if(d['E'] == "已处置"){ rows << row continue } - def currMonthUnitPriceLabel = "R" - def preMonthUnitPriceLabel = "P" - def matchIdLabel = "AE" + def currMonthUnitPriceLabel = "Z" + def preMonthUnitPriceLabel = "X" + def matchIdLabel = "AM" if(!["商铺","办公楼"].contains(d['A'])){ def dist = CommonDatautils.findDistrictById(d[matchIdLabel]) if(dist){ @@ -209,7 +234,6 @@ class HongXingMonthBatch extends BaseBatch{ row << "" row << "" row << "" - } def regionPriceObj = findRegionPrice(dist.city, dist.region, lastMonthStr) @@ -243,7 +267,7 @@ class HongXingMonthBatch extends BaseBatch{ row << findHouse(dist) }else{ - println d[matchIdLabel] +" 未找到该id的楼盘" + println d[matchIdLabel] +" 未找到该id的楼盘:${d}" } }else{ def dist = CommonDatautils.findDistrictById(d[matchIdLabel]) @@ -253,6 +277,13 @@ class HongXingMonthBatch extends BaseBatch{ if(d['A'] == "办公楼"){ cityMarkupObj = findRentOfficeMarkup(dist.city, null, lastMonthStr, "city") regionMarkupObj = findSellOfficeMarkup(dist.city, dist.region, lastMonthStr, "district") + println(dist.city) + if(cityMarkupObj.mom == null){ + def lastMonthPreStr = com.fangjia.core.util.DateUtil.add(com.fangjia.core.util.DateUtil.parseDate(lastMonthStr, "yyyyMM"), Calendar.MONTH, -1).format("yyyyMM") + def cityMarkupObjPre = findRentOfficeMarkup(dist.city, null, lastMonthPreStr, "city") + cityMarkupObj.mom = DataUtil.getRound(2, (cityMarkupObj.avg_price - cityMarkupObjPre.avg_price)*100/cityMarkupObjPre.avg_price) + println(cityMarkupObj) + } if(cityMarkupObj){ println cityMarkupObj cityMarkupObj.mom = cityMarkupObj.mom / 100 @@ -267,6 +298,9 @@ class HongXingMonthBatch extends BaseBatch{ regionMarkupObj = findSellShopMarkup(dist.city, dist.region, lastMonthStr, "district") } if(cityMarkupObj){ + if(fixPriceAddrs.containsKey(d['C'])){ + d[currMonthUnitPriceLabel] = fixPriceAddrs[d['c']] + } if(d[currMonthUnitPriceLabel]){ def newAvgPrice = d[currMonthUnitPriceLabel] row << DataUtil.getRound(newAvgPrice) @@ -347,8 +381,8 @@ class HongXingMonthBatch extends BaseBatch{ } } row << d[matchIdLabel] - row << d['AF'] - row << d['AG'] + row << d['AN'] + row << d['AO'] rows << row } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Abc.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Abc.groovy index 73e920763..da4e82264 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Abc.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Abc.groovy @@ -1,43 +1,12 @@ package com.fangjia.script.wenyan.temp -import com.fangjia.core.Constants -import com.fangjia.core.util.DataUtil -import com.fangjia.core.util.MongoUtils -import com.fangjia.script.util.DbUtils +import com.fangjia.script.util.ElasticUtils import com.fangjia.script.util.ExcelUtils -import com.fangjia.script.util.OpenApiClient -import com.mongodb.BasicDBObject -import net.sf.json.JSONObject -import java.util.regex.Matcher -import java.util.regex.Pattern - -def school = MongoUtils.getDbCollection(Constants.FANGJIA_CRAWL_MONGO_URI, "fangjia_craw", "school2") -new File("D:\\数据\\学校数据").eachFile {File file-> - ExcelUtils.read(file.getAbsolutePath(), 0).each {List item-> - BasicDBObject dbo = new BasicDBObject() - dbo.city = item["A"] - dbo.region = item["B"] - dbo.name = item["C"] - dbo.address = item["E"] - dbo.attribute = item["G"] - dbo.property = item["H"] - dbo.category = "小学" - dbo.location = [DataUtil.roundDouble(item["I"], 6), DataUtil.roundDouble(item["J"], 6)] - school.insert(dbo) - println(dbo) - } - ExcelUtils.read(file.getAbsolutePath(), 1).each {List item-> - BasicDBObject dbo = new BasicDBObject() - dbo.city = item["A"] - dbo.region = item["B"] - dbo.name = item["C"] - dbo.address = item["E"] - dbo.attribute = item["G"] - dbo.property = item["H"] - dbo.category = "中学" - dbo.location = [item["I"], item["J"]] - school.save(dbo) - println(item) - } -} \ No newline at end of file +ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Desktop\\估家基础数据统计.xlsx",{List item-> + ElasticUtils.executeSqlQuery("select count(*) as cnt FROM didata_map_poi_single_new_45 where city like '${item['B']}%' and small_type='商务写字楼'",{Map doc-> + item["D"] = doc['cnt'] + item['E'] = Math.max(item["D"], item["C"]) + println(doc) + }) +}) \ No newline at end of file