This commit is contained in:
2025-08-15 10:09:03 +08:00
parent 06c96352cf
commit fa074d9ce0
2 changed files with 32 additions and 30 deletions
@@ -87,17 +87,14 @@ class NewPoiData {
}
def calcuteDistance(){
ExcelUtils.multiThreadingModify("d:\\数据\\写字楼测试-1118-新增.xlsx", { d ->
if(d['F']){
if(d['A'].contains("北京")){
def distance = GeoHelper.GetDistance(d['F'].toString().toDouble(), d['E'].toString().toDouble(), 39.996743, 116.481075)
d['K'] = distance
}else if(d['A'].contains("烟台")){
def distance = GeoHelper.GetDistance(d['F'].toString().toDouble(), d['E'].toString().toDouble(), 37.459645, 121.438616)
d['K'] = distance
}
ExcelUtils.multiThreadingModify("C:\\Users\\JLKJ0001\\Downloads\\商铺出租信息.xlsx", { d ->
if(d['I']){
def arrs = d['I'].split(",")
def distance = GeoHelper.GetDistance(arrs[1].toString().toDouble(),arrs[0].toDouble(), 22.512276,113.939156)
d['X'] = distance
println distance
}
}, 1)
}, 0)
}
@@ -2,7 +2,6 @@ package com.fangjia.script.gj.poc
import com.fangjia.script.ccbevaluation.CcbCommonUtils
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.DateUtil
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
@@ -15,7 +14,6 @@ import java.util.concurrent.CountDownLatch
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicLong
/**
* 价格对比,第三方,成交,建行价格,自已家价格
*/
@@ -23,8 +21,8 @@ class AddPriceTest {
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(50)
def pgsqlInstance = Sql.newInstance("jdbc:postgresql://192.168.0.236:5432/warehouse",
"postgres", "postgres", "org.postgresql.Driver")
// def pgsqlInstance = Sql.newInstance("jdbc:postgresql://192.168.0.236:5432/warehouse",
// "postgres", "postgres", "org.postgresql.Driver")
//235为房价网内部计算均价的库
def pgsqlInstance235 = Sql.newInstance("jdbc:postgresql://192.168.0.235:5433/fangjia?stringtype=unspecified",
@@ -38,15 +36,22 @@ class AddPriceTest {
task.run();
}
def run(){
def filePath = "D:\\数据\\价格\\惠州.xlsx"
// def districts = CommonDatautils.findAllDistrictsFromMg("西安","district", ["_id","city","region", "name", "lng","lat", "build_date", "household_count"])
// def rets = []
// rets << ["id","城市","区域","名称","经度","纬度","户数","建成年代","价格","可信度"]
// for(def d : districts){
// rets << [d._id.toString(), d.city, d.region,d.name,d.lng/10000000000.0, d.lat/10000000000.0, d.household_count, d.build_date]
// }
// ExcelUtils.write("d:\\数据\\数据建设\\西安楼盘.xlsx", rets, "西安")
def filePath = "d:\\数据\\数据建设\\西安楼盘.xlsx"
// addGXDPrice(filePath)
// addCcbPrice(filePath)
addCcbPrice(filePath)
// addThirdPrice(filePath)
// addFjwPrice(filePath)
// exportPkPrice()
// addRegion()
// addTradePrice(filePath)
addThirdSamplePrice("D:\\数据\\建行\\房产估值\\指导价\\级联、国信达价格导入_0313.xlsx")
// addThirdSamplePrice("D:\\数据\\建行\\房产估值\\指导价\\级联、国信达价格导入_0313.xlsx")
}
@@ -216,25 +221,25 @@ class AddPriceTest {
def addCcbPrice(filepath){
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
ExcelUtils.multiThreadingModify(filepath,{ d->
if(d['A']){
if(d['B']){
def cityId = cityCodeDataMap.get(d['B'])
def map = findAvgPrice(d['A'], cityId)
if(map){
d['I'] = map.avg_price
d['J'] = map.month
// d['H'] = map.calc_type
// d['AM'] = map.credit_value
}
// def map = findAvgPrice(d['A'], cityId)
// if(map){
// d['I'] = map.avg_price
// d['J'] = map.month
//// d['H'] = map.calc_type
//// d['AM'] = map.credit_value
// }
def newPriceMap = findNewFjwAvgPrice(d['A'], cityId)
if(newPriceMap){
d['G'] = newPriceMap.avg_price
d['H'] = newPriceMap.month
d['H'] = map.calc_type
// d['AM'] = map.credit_value
d['I'] = newPriceMap.avg_price
d['K'] = newPriceMap.month
d['L'] = newPriceMap.calc_type
d['J'] = newPriceMap.credit_value
}
}
})
}, 1)
}