fix(deploy): use projects/fangjia-script/target/fangjia-script.jar for scp
This commit is contained in:
@@ -18,7 +18,24 @@
|
|||||||
"Bash(chmod +x /tmp/search_all.sh)",
|
"Bash(chmod +x /tmp/search_all.sh)",
|
||||||
"Bash(/tmp/search_all.sh)",
|
"Bash(/tmp/search_all.sh)",
|
||||||
"Bash(chmod +x /tmp/extract_classes.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 *)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -145,7 +145,7 @@ pipeline {
|
|||||||
scp -o StrictHostKeyChecking=no \
|
scp -o StrictHostKeyChecking=no \
|
||||||
-o HostKeyAlgorithms=+ssh-rsa \
|
-o HostKeyAlgorithms=+ssh-rsa \
|
||||||
-o PubkeyAcceptedKeyTypes=+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
|
${deployUser}@${cfg.deployHost}:/home/docker/fangjia-script/fangjia-script.jar
|
||||||
|
|
||||||
# 上传 groovy 脚本目录
|
# 上传 groovy 脚本目录
|
||||||
|
|||||||
+1
-2
@@ -4995,8 +4995,7 @@ class CommonDatautils {
|
|||||||
q.put("city", city)
|
q.put("city", city)
|
||||||
q.put("region", region)
|
q.put("region", region)
|
||||||
q.put("name", name)
|
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 dbcursor = thirdpartColl.find(q).sort(new BasicDBObject("s_date", -1))
|
||||||
def map = [:]
|
def map = [:]
|
||||||
for(def db : dbcursor){
|
for(def db : dbcursor){
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.fangjia.core.util.HttpRequest
|
|||||||
import com.fangjia.script.commData.CommonDatautils
|
import com.fangjia.script.commData.CommonDatautils
|
||||||
import com.fangjia.script.gj.EsUtils
|
import com.fangjia.script.gj.EsUtils
|
||||||
import com.fangjia.script.util.CommonUtils
|
import com.fangjia.script.util.CommonUtils
|
||||||
|
import com.fangjia.script.util.DbUtils
|
||||||
import com.fangjia.script.util.ElasticUtils
|
import com.fangjia.script.util.ElasticUtils
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
@@ -14,30 +15,55 @@ import com.mongodb.DBCollection
|
|||||||
import java.util.concurrent.atomic.AtomicInteger
|
import java.util.concurrent.atomic.AtomicInteger
|
||||||
|
|
||||||
class GongShu {
|
class GongShu {
|
||||||
|
static DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
|
||||||
|
|
||||||
static main(args) {
|
static main(args) {
|
||||||
def task = new GongShu();
|
def task = new GongShu();
|
||||||
task.run();
|
task.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
def run() {
|
def run() {
|
||||||
String path1 = "D:\\数据\\福州\\福州200个小区抽样价格核验202603.xlsx";
|
def data = [["ID","区域","小区名称","供数价格","贝壳成交价","安居客价格(挂牌价*0.9)","麦田价格(挂牌价*0.9)","房天下价格(挂牌价*0.9)","城市房产价格(挂牌价*0.9)","供数价格与贝壳成交价差异"]]
|
||||||
// String path1 = "D:\\数据\\福州\\价格比对_20240915.xlsx";
|
DbUtils.seaweed.find(DbUtils.buildSeaweedQuery("福州"), new BasicDBObject("region", 1).append("name", 1)).each {
|
||||||
String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx";
|
data << [it._id.toString(), it.region, it.name]
|
||||||
// String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx";
|
}
|
||||||
String path3 = "E:\\goojia\\file\\excel文件\\福州\\福州贝壳小区.xlsx";
|
for(def yearMonth in [202604,202605,202606, 202607]){
|
||||||
// String path2 = "E:\\goojia\\file\\excel文件\\福州\\1.xlsx";
|
// ExcelUtils.write("D:\\数据\\福州\\福州200个小区抽样价格核验${yearMonth}.xlsx", data, "sheet1")
|
||||||
// String path1 = "E:\\goojia\\file\\excel文件\\福州\\福州全部小区.xlsx";
|
// def query = new BasicDBObject()
|
||||||
// findID(path2)
|
// query.append("city", "福州")
|
||||||
// findDelDistrict(path2)
|
// query.append("date", yearMonth)
|
||||||
// findDistrictByAlias(path2)
|
// def stat = [:]
|
||||||
// match19UseMAP(path2)
|
// DISTRICT_SELL_STAT.find(query, new BasicDBObject("region", 1).append("district_name", 1).append("avg_price", 1)).each {
|
||||||
// addFjwPrice(path2)
|
// 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)
|
// futurePrice(path2)
|
||||||
// rePrice(path2)
|
// rePrice(path2)
|
||||||
}
|
}
|
||||||
@@ -319,7 +345,7 @@ class GongShu {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
//查找三方价格
|
//查找三方价格
|
||||||
def thirdPrice(path1) {
|
def thirdPrice(path1 ,yearMonth) {
|
||||||
def count = 0
|
def count = 0
|
||||||
ExcelUtils.multiThreadingModify( path1, { List d ->
|
ExcelUtils.multiThreadingModify( path1, { List d ->
|
||||||
count++
|
count++
|
||||||
@@ -329,7 +355,7 @@ class GongShu {
|
|||||||
def city = "福州"
|
def city = "福州"
|
||||||
def region = d['B']
|
def region = d['B']
|
||||||
def name = d['C']
|
def name = d['C']
|
||||||
def valusMap = CommonDatautils.findThirdPartyPrice(city, region, name, 202512, 202603)
|
def valusMap = CommonDatautils.findThirdPartyPrice(city, region, name, 202601, yearMonth)
|
||||||
if (valusMap) {
|
if (valusMap) {
|
||||||
def dataMap = valusMap.get(city + "##" + region + "##" + name)
|
def dataMap = valusMap.get(city + "##" + region + "##" + name)
|
||||||
if (dataMap.get("anjuke_esf_price")) {
|
if (dataMap.get("anjuke_esf_price")) {
|
||||||
|
|||||||
@@ -794,7 +794,7 @@ class OpenApiUtils {
|
|||||||
|
|
||||||
static def addrVerifyXiameng(city, address, type){
|
static def addrVerifyXiameng(city, address, type){
|
||||||
address = URLEncoder.encode(address, "utf-8");
|
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"
|
// def url = "http://localhost:8080/fangjia-open/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||||
if(city){
|
if(city){
|
||||||
url = url + "&city=${city}"
|
url = url + "&city=${city}"
|
||||||
|
|||||||
+48
-14
@@ -9,6 +9,7 @@ import com.fangjia.script.util.DateUtil
|
|||||||
import com.fangjia.script.util.DateUtils
|
import com.fangjia.script.util.DateUtils
|
||||||
import com.fangjia.script.util.DbUtils
|
import com.fangjia.script.util.DbUtils
|
||||||
import com.fangjia.script.util.ElasticUtils
|
import com.fangjia.script.util.ElasticUtils
|
||||||
|
import com.fangjia.script.util.ExcelRow
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
import com.fangjia.script.wenyan.taobao.BidRecordsParseBatch
|
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_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 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 DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "deal_price", "mongo.db.fangjia.com")
|
||||||
|
static String matchIdLabel = "AM"
|
||||||
static main(args) {
|
static main(args) {
|
||||||
runBatch(new HongXingMonthBatch(), args);
|
runBatch(new HongXingMonthBatch(), args);
|
||||||
}
|
}
|
||||||
@@ -36,10 +38,11 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
// createTestFile();
|
// createTestFile();
|
||||||
// mergeFile()
|
// mergeFile()
|
||||||
// mergeMatchId()
|
// mergeMatchId()
|
||||||
def fileName = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\宏信楼盘5月监测20260520交付.xlsx"
|
def fileName = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\宏信楼盘9月监测20260920交付.xlsx"
|
||||||
def removeAddrFile = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\20260520宏信.xlsx"
|
def removeAddrFile = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\20260920宏信.xlsx"
|
||||||
|
def addAddrData = ExcelUtils.read(removeAddrFile, 2, 1)
|
||||||
def removeAddrs = []
|
def removeAddrs = []
|
||||||
ExcelUtils.read(removeAddrFile, 0).each {List item->
|
ExcelUtils.read(removeAddrFile, 1).each {List item->
|
||||||
removeAddrs << item["C"]
|
removeAddrs << item["C"]
|
||||||
}
|
}
|
||||||
ExcelUtils.modify(fileName,{List item->
|
ExcelUtils.modify(fileName,{List item->
|
||||||
@@ -49,7 +52,7 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
def fixPriceAddrs = [:]
|
def fixPriceAddrs = [:]
|
||||||
ExcelUtils.read(removeAddrFile, 1).each {List item->
|
ExcelUtils.read(removeAddrFile, 0).each {List item->
|
||||||
if(item["A"] && item["B"]){
|
if(item["A"] && item["B"]){
|
||||||
fixPriceAddrs.put(item["A"],item["B"].toString().toDouble().toInteger())
|
fixPriceAddrs.put(item["A"],item["B"].toString().toDouble().toInteger())
|
||||||
}
|
}
|
||||||
@@ -57,7 +60,7 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
def stat = [:]
|
def stat = [:]
|
||||||
//获取上个月的交付价格
|
//获取上个月的交付价格
|
||||||
def lastMonthPriceRowId = "P" //上个月均价所在列号
|
def lastMonthPriceRowId = "R" //上个月均价所在列号
|
||||||
ExcelUtils.read(fileName).each{List item->
|
ExcelUtils.read(fileName).each{List item->
|
||||||
if(item[lastMonthPriceRowId]){
|
if(item[lastMonthPriceRowId]){
|
||||||
stat.put(item["C"], item[lastMonthPriceRowId])
|
stat.put(item["C"], item[lastMonthPriceRowId])
|
||||||
@@ -68,6 +71,20 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
def count = findCurMonthPrice(lastMonthStr)
|
def count = findCurMonthPrice(lastMonthStr)
|
||||||
if(count > 0){
|
if(count > 0){
|
||||||
def datas = ExcelUtils.read(fileName)
|
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 newDatas = createDatas(datas, lastMonthStr, fixPriceAddrs)
|
||||||
def curDateStr = DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
def curDateStr = DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
||||||
ExcelUtils.write(fileName, newDatas,"结果${curDateStr}")
|
ExcelUtils.write(fileName, newDatas,"结果${curDateStr}")
|
||||||
@@ -123,8 +140,8 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
|
|
||||||
def createDatas(datas, lastMonthStr, Map fixPriceAddrs){
|
def createDatas(datas, lastMonthStr, Map fixPriceAddrs){
|
||||||
def rows = []
|
def rows = []
|
||||||
rows << ["物业类型","名称","地址","期房/现房","处置状态","省份","城市","城市排名","面积","1月评估单价(元)","1月评估总价(元)","2月评估单价(元)","2月评估总价(元)","3月评估单价", "3月评估总价(元)","4月评估单价", "4月评估总价(元)","5月评估单价", "5月评估总价(元)"
|
rows << ["物业类型","名称","地址","期房/现房","处置状态","省份","城市","城市排名","面积","1月评估单价(元)","1月评估总价(元)","2月评估单价(元)","2月评估总价(元)","3月评估单价", "3月评估总价(元)","4月评估单价", "4月评估总价(元)","5月评估单价","5月评估总价(元)","6月评估单价", "6月评估总价(元)","7月评估单价", "7月评估总价(元)","8月评估单价", "8月评估总价(元)","9月评估单价", "9月评估总价(元)"
|
||||||
,"环比涨跌幅(%)","计算方式","定基涨跌幅(相比首月波动)","5月区域均价","5月区域均价涨跌幅(%)","4月楼盘所在区域价格的排名(仅针对住宅)","5月楼盘所在区域价格的排名(仅针对住宅)","楼盘所在区域排名变化(仅针对住宅)","近3个月内成交量","近6个月成交量","3个月挂牌量","匹配ID-新","备注","情况说明"]
|
,"环比涨跌幅(%)","计算方式","定基涨跌幅(相比首月波动)","9月区域均价","9月区域均价涨跌幅(%)","8月楼盘所在区域价格的排名(仅针对住宅)","9月楼盘所在区域价格的排名(仅针对住宅)","楼盘所在区域排名变化(仅针对住宅)","近3个月内成交量","近6个月成交量","3个月挂牌量","匹配ID-新","备注","情况说明"]
|
||||||
def index = 1
|
def index = 1
|
||||||
for(def d : datas){
|
for(def d : datas){
|
||||||
println d['B']
|
println d['B']
|
||||||
@@ -147,13 +164,21 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
row << d['O']
|
row << d['O']
|
||||||
row << d['P']
|
row << d['P']
|
||||||
row << d['Q']
|
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'] == "已处置"){
|
if(d['E'] == "已处置"){
|
||||||
rows << row
|
rows << row
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
def currMonthUnitPriceLabel = "R"
|
def currMonthUnitPriceLabel = "Z"
|
||||||
def preMonthUnitPriceLabel = "P"
|
def preMonthUnitPriceLabel = "X"
|
||||||
def matchIdLabel = "AE"
|
def matchIdLabel = "AM"
|
||||||
if(!["商铺","办公楼"].contains(d['A'])){
|
if(!["商铺","办公楼"].contains(d['A'])){
|
||||||
def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
|
def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
|
||||||
if(dist){
|
if(dist){
|
||||||
@@ -209,7 +234,6 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
row << ""
|
row << ""
|
||||||
row << ""
|
row << ""
|
||||||
row << ""
|
row << ""
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def regionPriceObj = findRegionPrice(dist.city, dist.region, lastMonthStr)
|
def regionPriceObj = findRegionPrice(dist.city, dist.region, lastMonthStr)
|
||||||
@@ -243,7 +267,7 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
row << findHouse(dist)
|
row << findHouse(dist)
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
println d[matchIdLabel] +" 未找到该id的楼盘"
|
println d[matchIdLabel] +" 未找到该id的楼盘:${d}"
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
|
def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
|
||||||
@@ -253,6 +277,13 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
if(d['A'] == "办公楼"){
|
if(d['A'] == "办公楼"){
|
||||||
cityMarkupObj = findRentOfficeMarkup(dist.city, null, lastMonthStr, "city")
|
cityMarkupObj = findRentOfficeMarkup(dist.city, null, lastMonthStr, "city")
|
||||||
regionMarkupObj = findSellOfficeMarkup(dist.city, dist.region, lastMonthStr, "district")
|
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){
|
if(cityMarkupObj){
|
||||||
println cityMarkupObj
|
println cityMarkupObj
|
||||||
cityMarkupObj.mom = cityMarkupObj.mom / 100
|
cityMarkupObj.mom = cityMarkupObj.mom / 100
|
||||||
@@ -267,6 +298,9 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
regionMarkupObj = findSellShopMarkup(dist.city, dist.region, lastMonthStr, "district")
|
regionMarkupObj = findSellShopMarkup(dist.city, dist.region, lastMonthStr, "district")
|
||||||
}
|
}
|
||||||
if(cityMarkupObj){
|
if(cityMarkupObj){
|
||||||
|
if(fixPriceAddrs.containsKey(d['C'])){
|
||||||
|
d[currMonthUnitPriceLabel] = fixPriceAddrs[d['c']]
|
||||||
|
}
|
||||||
if(d[currMonthUnitPriceLabel]){
|
if(d[currMonthUnitPriceLabel]){
|
||||||
def newAvgPrice = d[currMonthUnitPriceLabel]
|
def newAvgPrice = d[currMonthUnitPriceLabel]
|
||||||
row << DataUtil.getRound(newAvgPrice)
|
row << DataUtil.getRound(newAvgPrice)
|
||||||
@@ -347,8 +381,8 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
row << d[matchIdLabel]
|
row << d[matchIdLabel]
|
||||||
row << d['AF']
|
row << d['AN']
|
||||||
row << d['AG']
|
row << d['AO']
|
||||||
rows << row
|
rows << row
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +1,12 @@
|
|||||||
package com.fangjia.script.wenyan.temp
|
package com.fangjia.script.wenyan.temp
|
||||||
|
|
||||||
import com.fangjia.core.Constants
|
import com.fangjia.script.util.ElasticUtils
|
||||||
import com.fangjia.core.util.DataUtil
|
|
||||||
import com.fangjia.core.util.MongoUtils
|
|
||||||
import com.fangjia.script.util.DbUtils
|
|
||||||
import com.fangjia.script.util.ExcelUtils
|
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
|
ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Desktop\\估家基础数据统计.xlsx",{List item->
|
||||||
import java.util.regex.Pattern
|
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']
|
||||||
def school = MongoUtils.getDbCollection(Constants.FANGJIA_CRAWL_MONGO_URI, "fangjia_craw", "school2")
|
item['E'] = Math.max(item["D"], item["C"])
|
||||||
new File("D:\\数据\\学校数据").eachFile {File file->
|
println(doc)
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user