Merge branch 'script_gj' into 'master'

Script gj

See merge request !1155
This commit is contained in:
2025-08-15 15:40:18 +08:00
13 changed files with 205 additions and 102 deletions
@@ -31,26 +31,60 @@ class DataMigration {
public static final DBCollection STA = MongoUtils.getCollectionByName("fangjia_stat", "district_stat", "mongo.db.fangjia.com");
public static final DBCollection UN_RELATION = MongoUtils.getCollectionByName("fangjia", "un_relation", "mongo.db.fangjia.com");
static final DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "deal_price", "mongo.db.fangjia.com")
public static DBCollection COMMAND_COLL = MongoUtils.getCollectionByName("fangjia_log", "calc_command", "192.168.0.42", 52002)
static main(args) {
DBCursor cursor = DEAL_PRICE_COLL.find().batchSize(2000).addOption(Bytes.QUERYOPTION_NOTIMEOUT);
DBObject dbo
int i =0
while(cursor.hasNext()){
i++
dbo = cursor.next()
if(dbo.get("total_price") instanceof Double){
dbo.put("total_price", dbo.get("total_price").toString().toDouble().toInteger())
dbo.put("c_date",new Date())
DEAL_PRICE_COLL.save(dbo);
}
if(i%10000==0){
println i
DBCursor cursor = COMMAND_COLL.find().addOption(Bytes.QUERYOPTION_NOTIMEOUT);
def list = []
for(def o : cursor){
def key = o.city +"##"+o.region+"##"+o.name
if(!list.contains(key)){
list << key
def q = new BasicDBObject("city", o.city).append("region", o.region).append("district_name", o.name)
DBCursor dealpriceCursor = DEAL_PRICE_COLL.find(q)
for(def dl : dealpriceCursor){
if(dl.get("hall")){
if(dl.get("hall") instanceof String){
println dl._id.toString() +" hall 为字符串"
def dbo = new BasicDBObject()
dbo.put("hall", dl.get("hall").toString().toInteger())
DEAL_PRICE_COLL.update(new BasicDBObject("_id", dl._id), new BasicDBObject('$set', dbo))
}
}else{
if(!dl.get("area")){
println dl._id.toString() +" 面积为空"
DEAL_PRICE_COLL.remove(new BasicDBObject("_id", dl._id))
}
}
}
}
}
// DBCursor cursor = DEAL_PRICE_COLL.find().batchSize(2000).addOption(Bytes.QUERYOPTION_NOTIMEOUT);
// DBObject dbo
// int i =0
// while(cursor.hasNext()){
// i++
// dbo = cursor.next()
// if(dbo.get("total_price") instanceof Double){
// dbo.put("total_price", dbo.get("total_price").toString().toDouble().toInteger())
// dbo.put("c_date",new Date())
// DEAL_PRICE_COLL.save(dbo);
// }
//
// if(i%10000==0){
// println i
// }
// }
}
// migration();
@@ -29,7 +29,7 @@ public class MonthlyDistrictStatCalcBatch extends BaseBatch {
@Override
void process(Object args) {
List<String> cities = [];
def allCity = ["广州","深圳","临沂"]//CommonUtils.findAllCity()
def allCity = CommonUtils.findAllCity()
def keys = new BasicDBObject("city", 1).append("name", 1).append("region", 1).append("estate_type2", 1)
cities.addAll(allCity)
@@ -38,7 +38,7 @@ public class MonthlyDistrictStatCalcBatch extends BaseBatch {
districts.addAll DbUtils.seaweed.find(new BasicDBObject("city", city).append("cat", "district").append("visible", 0), keys).batchSize(2000).toList()
println(city)
}
ExecutorService executorService = Executors.newFixedThreadPool(1)
ExecutorService executorService = Executors.newFixedThreadPool(30)
districts.each {BasicDBObject district->
executorService.submit(new Calculator(district))
}
@@ -92,14 +92,14 @@ class Calculator extends Thread{
def monDate = getMomDate(date)
def yoyDate = getYoyDate(date)
BasicDBObject monDbo = statMap.get(monDate)
if(monDbo != null && monDbo.avg_price_2b != 0) {
trend.mom = DataUtil.roundDouble(((trend.avg_price_2b - monDbo.avg_price_2b)/(double)monDbo.avg_price_2b),4)
if(monDbo != null && monDbo.avg_price != 0) {
trend.mom = DataUtil.roundDouble(((trend.avg_price - monDbo.avg_price)/(double)monDbo.avg_price),4)
}else{
trend.mom = 0d
}
BasicDBObject yoyDbo = statMap.get(yoyDate)
if(yoyDbo != null && yoyDbo.avg_price != 0){
trend.yoy = DataUtil.roundDouble(((trend.avg_price_2b - yoyDbo.avg_price_2b)/(double)yoyDbo.avg_price_2b),4)
trend.yoy = DataUtil.roundDouble(((trend.avg_price - yoyDbo.avg_price)/(double)yoyDbo.avg_price),4)
}else{
trend.yoy = 0d
}
@@ -1,6 +1,6 @@
package com.fangjia.script.ccbevaluation
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
@@ -9,7 +9,7 @@ import com.mongodb.DBCollection
* 深圳公众号成交数据录入
*/
def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\2025年5月深圳成交明细.xlsx", 0, 1)
def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\深圳6月份成交数据.xlsx", 0, 1)
def lineUrl = "mongodb://developer:G00IDCDEV12385@mongo.db.fangjia.com:28017";
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
@@ -73,18 +73,18 @@ for(def d : datas){
}
map.area = d['F'].replace("平","").toString().toDouble()
map.total_price = (int)(d['G'].replace("万","").toString().toDouble().toInteger()*10000)
map.avg_price = (int)(d['H'].replace("元/平","").toString().toDouble())
map.area = d['F'].toString().toDouble()
map.total_price = (int)(d['G'].toString().toDouble().toInteger()*10000)
map.avg_price = (int)(d['H'].toString().toDouble())
if(d['I']){
map.sell_price = (int)(d['I'].replace("万","").toString().toDouble()*10000)
map.sell_price = (int)(d['I'].toString().toDouble()*10000)
}
map.trade_date = d['J']
// def trade_date = d['J']
// if(trade_date){
// map.trade_date = DateUtils.parseFromTightByPattern(trade_date,'yyyy/MM/dd')
// }
// map.trade_date = d['J']
def trade_date = d['J']
if(trade_date){
map.trade_date = DateUtils.parseFromTightByPattern(trade_date,'yyyy/MM/dd')
}
// else{
// def trade_date1 = DateUtils.getRandomDate("2024-03-01", "2024-03-31")
// map.trade_date = DateUtils.parseFromTightByPattern(trade_date1, "yyyy-MM-dd")
@@ -103,7 +103,7 @@ class CityInfoAnaBatch extends BaseBatch {
// 当期周末
Date weekend = DateUtil.getFirstDayOfWeek(new Date());
//周日开始跑,需要跑加上7天,周一跑不需要
weekend = DateUtil.add(weekend, 7)
// weekend = DateUtil.add(weekend, 7)
Date laseWeekend = DateUtil.getFirstDayOfWeek(weekend);
println "开始分析:" + DateUtil.formatToTightYYYYMMDDhhmmss(weekend)
DBObject cityQuery = new BasicDBObject('status', new BasicDBObject('$in', [0, 2]))
@@ -43,6 +43,13 @@ class DistrictSellStatBatch extends BaseBatch {
@Override
void process(Object args) {
// def months = DateUtils.getMonthList(202206)
// months = months[0..(months.size()-2)]
// println months
// for(def month : months){
// def curDate = DateUtils.parseFromTightByPattern(month.toString()+"01", "yyyyMMdd")
// calcMonthlyPrice(curDate)
// }
calcMonthlyPrice()
}
@@ -63,21 +70,24 @@ class DistrictSellStatBatch extends BaseBatch {
return calendar.getTime().format("yyyyMM").toInteger()
}
def calcMonthlyPrice(){
def calcMonthlyPrice(curDate){
//只有福州使用tob价格,改为所有城市都使用2B价格,除人工指导价除外
def citys = CommonUtils.findAllCity()
if(!curDate){
curDate = new Date()
}
def citys = ["福州"]//CommonUtils.findAllCity()
def keys = new BasicDBObject("city", 1).append("name", 1).append("region", 1).append("estate_type2", 1).append("status", 1)
def lastMonthWeekend = DateUtils.truncateDay(DateUtils.getLastSundayInWeekOfLastMonth(new Date()))
def lastMonthWeekend = DateUtils.truncateDay(DateUtils.getLastSundayInWeekOfLastMonth(curDate))
def curMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
def curMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(curDate, "yyyyMM"), -1, "yyyyMM"));
def monDate = getMomDate(curMonth)
def yoyDate = getYoyDate(curMonth)
def day = new Date().getDate()
def startMDate = DateUtils.truncateDay(new Date()-7)
def endMDate = DateUtils.truncateDay(new Date())
def startMDate = DateUtils.truncateDay(curDate-7)
def endMDate = DateUtils.truncateDay(curDate)
def index = 0
for(def city : citys){
@@ -85,7 +95,7 @@ class DistrictSellStatBatch extends BaseBatch {
index++
def districts = []
if(city == "福州"){
if(day == 2){
if(day == 12){
districts = FZ_DIST_COLL.find(new BasicDBObject("city", city), keys).toList()
}else{
districts = FZ_DIST_COLL.find(new BasicDBObject("city", city).append("m_date", new BasicDBObject('$gte',startMDate).append('$lt', endMDate)), keys).toList()
@@ -101,10 +111,10 @@ class DistrictSellStatBatch extends BaseBatch {
}
}
println index+" "+city +" "+districts.size()+" "+ (new Date()).toString()
println index+" "+city +" "+districts.size()+" "+ curDate.toString()
def startDate = DateUtils.getFirstDayOfMonth(new Date(), -1);
def endDate = DateUtils.getLastDayOfMonth(new Date(), -1);
def startDate = DateUtils.getFirstDayOfMonth(curDate, -1);
def endDate = DateUtils.getLastDayOfMonth(curDate, -1);
if(districts.size()>0){
def weekendPriceMap = findPriceMap(city, startDate, endDate)//上个月小区均价
def curMonthlyPriceMap = findMonthlyPrice(city, curMonth)//当月小区月均价
@@ -141,13 +151,13 @@ class DistrictSellStatBatch extends BaseBatch {
final CountDownLatch latch = new CountDownLatch(districts.size())
def rets = new CopyOnWriteArrayList()
districts.each{dist->
for(def i=0;i<districts.size();i++){
def dist = districts[i]
fixedThreadPool.execute(new Runnable() {
void run() {
try {
totalCount.addAndGet(1)
def type = dist.estate_type2=="别墅"?"别墅":"小区"
def key = dist.region +"##" + dist.name+"##"+ type
def key = dist.region +"##" + dist.name
def weekendPriceObj = weekendPriceMap.get(key)
if(weekendPriceObj){
@@ -169,8 +179,8 @@ class DistrictSellStatBatch extends BaseBatch {
if(weekendPriceObj.value_type!=1){
if(dist.city == "福州"){
if(Math.abs(mom)*100>3){
def randMarkup = nextDouble(0, 3)
if(Math.abs(mom)*100>8){
def randMarkup = nextDouble(5, 8)
if(mom < 0){
mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4)
}else{
@@ -192,7 +202,7 @@ class DistrictSellStatBatch extends BaseBatch {
}
double yoy = 0d
if(lastYearPriceObj){
if(lastYearPriceObj && lastYearPriceObj.avg_price>0){
yoy = DataUtil.roundDouble(((curPrice - lastYearPriceObj.avg_price)/(double)lastYearPriceObj.avg_price),4)
}
@@ -215,7 +225,7 @@ class DistrictSellStatBatch extends BaseBatch {
q.put("commid", dist._id.toString())
DISTRICT_SELL_STAT.update(q , new BasicDBObject('$set', data),true,false)
// DISTRICT_SELL_STAT.update(new BasicDBObject("_id", curPriceObj._id) , new BasicDBObject('$set', data),true,false)
println "[update]"+totalCount.get()+" "+ dist.city+" "+dist.name
println curMonth+" [update]"+totalCount.get()+" "+ dist.city+" "+dist.name
}
}else{
def data = new BasicDBObject()
@@ -232,7 +242,7 @@ class DistrictSellStatBatch extends BaseBatch {
data.put("mom", mom)
data.put("yoy", yoy)
DISTRICT_SELL_STAT.save(data)
println "[save]"+totalCount.get()+" "+ dist.city+" "+dist.name
println curMonth+" [save]"+totalCount.get()+" "+ dist.city+" "+dist.name
}
}
@@ -265,18 +275,18 @@ class DistrictSellStatBatch extends BaseBatch {
def findPriceMap(city, startDate, endDate){
def q = new BasicDBObject()
q.put("city", city)
// q.put("district_name","金福花园")
// q.put("district_name","长春铺")
q.put("weekend", new BasicDBObject('$lte', endDate).append('$gte', startDate))
def dbcursor = DISTRICT_STAT.find(q).sort(new BasicDBObject().append("weekend", -1))
def priceMap = [:]
for(def d : dbcursor){
if(!priceMap.containsKey(d.region +"##"+d.district_name+"##"+d.estate_type)){
if(!priceMap.containsKey(d.region +"##"+d.district_name)){
if(city == "福州"){
if(d.avg_price_2b && d.value_type!=1){
d.avg_price = d.avg_price_2b
}
}
priceMap.put(d.region +"##"+d.district_name+"##"+d.estate_type, d)
priceMap.put(d.region +"##"+d.district_name, d)
}
}
return priceMap
@@ -289,11 +299,7 @@ class DistrictSellStatBatch extends BaseBatch {
def dbcursor = DISTRICT_SELL_STAT.find(q)
def priceMap = [:]
for(def d : dbcursor){
if(d.estate_type=="别墅"){
priceMap.put(d.region +"##"+d.district_name+"##别墅", d)
}else{
priceMap.put(d.region +"##"+d.district_name+"##小区", d)
}
priceMap.put(d.region +"##"+d.district_name, d)
}
return priceMap
@@ -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(){
@@ -82,7 +82,7 @@ class FzDataResultStat {
}
// List<String> list2 = FileUtils.readLines(new File("D:\\数据\\福州\\FJW_DISTRICT_STAT_${lastMonth}.csv"))
def list2 = findFzDistrictStat(Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -4, "yyyyMM")))
def list2 = findFzDistrictStat(Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -2, "yyyyMM")))
def map2 = [:]
for(def obj : list2) {
def key = obj.city + "##" + obj.region + "##" + obj.name
@@ -119,7 +119,7 @@ class FzDataResultStat {
index++
println row
}
ExcelUtils.write("D:\\数据\\福州\\价格比对5_${curMonth}.xlsx", rows, "数据")
ExcelUtils.write("D:\\数据\\福州\\价格比对_${curMonth}.xlsx", rows, "数据")
def regions = ["鼓楼","仓山","台江","晋安","马尾","长乐"];
@@ -17,6 +17,7 @@ import org.apache.commons.io.FileUtils
import org.bson.types.ObjectId
DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "mongo.db.fangjia.com")
DBCollection dist_stat_coll = MongoUtils.getCollectionByName("fangjia_stat", "district_stat", "mongo.db.fangjia.com")
import com.fangjia.core.util.HttpRequest
@@ -117,15 +118,15 @@ import com.fangjia.core.util.HttpRequest
def findThirdPrice(city, region, name, AVERAGE_STATISTICS){
def q = new BasicDBObject()
q.put("city", city)
q.put("region", region)
q.put("name", name)
q.put("s_date", 202304)
return AVERAGE_STATISTICS.findOne(q)
}
//
//def findThirdPrice(city, region, name, AVERAGE_STATISTICS){
// def q = new BasicDBObject()
// q.put("city", city)
// q.put("region", region)
// q.put("name", name)
// q.put("s_date", 202304)
// return AVERAGE_STATISTICS.findOne(q)
//}
//DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
//def datas = FileUtils.readLines("D:\\数据\\其它\\FJW_COMM_20221015.csv")
@@ -236,25 +237,32 @@ def findThirdPrice(city, region, name, AVERAGE_STATISTICS){
//},0)
def files = CommonDatautils.getAllFiles("D:\\数据\\福州\\原始数据")
if(files){
for(def filepath : files){
def filename = filepath.getPath()
def rets = read(filename);
def date = filename.substring(filename.toString().lastIndexOf("_")+1, filename.toString().indexOf("."))
println date +" "+rets.size()
//def files = CommonDatautils.getAllFiles("D:\\数据\\福州\\原始数据")
//if(files){
// for(def filepath : files){
// def filename = filepath.getPath()
// def rets = read(filename);
// def date = filename.substring(filename.toString().lastIndexOf("_")+1, filename.toString().indexOf("."))
// println date +" "+rets.size()
// }
//}
//
//
//def read(path){
// File file = new File(path);
// def rets = []
// file.eachLine{it->
// rets << it
// }
// return rets;
//}
ExcelUtils.multiThreadingModify("D:\\数据\\福州\\福州价格比对.xlsx",{d->
def obj = dist_stat_coll.findOne(new BasicDBObject("city", d['B']).append("region",d['C']).append("district_name",d['D']).append("weekend",DateUtils.parseFromTightYYYYMMDD("2025-06-29")))
if(obj){
d['H'] = obj.avg_price_2b
}
}
def read(path){
File file = new File(path);
def rets = []
file.eachLine{it->
rets << it
}
return rets;
}
})
@@ -14,7 +14,7 @@ import com.mongodb.DBCollection
//福州第三方均价统计,发送钉钉消息
//def datas = ExcelUtils.read("d:\\数据\\福州\\福州4月2.xlsx",0,1)
//def datas = CsvUtils.read("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202105.csv");
def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202403.csv")
def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202506.csv")
def count0 = 0
def count1 = 0
def count2 = 0
@@ -189,7 +189,7 @@ class AddDevShapeData {
def run(){
def directoryPath = 'D:\\数据\\数据建设\\开发区外包\\623西安'
def directoryPath = 'D:\\数据\\数据建设\\开发区外包\\0812'
def dir = new File(directoryPath)
if (dir.isDirectory()) {
dir.eachFileRecurse(FileType.FILES) { file ->
@@ -300,7 +300,7 @@ class AddDevShapeData {
areaMap.count = coordinates.size()
def areas = []
if(name.contains("陕西蓝田工业园")){
// if(name.contains("陕西蓝田工业园")){
for(def pointList : coordinates){
index ++
def gaode_coordinates = []
@@ -343,7 +343,7 @@ class AddDevShapeData {
}
areaMap.area_info = areas.join("\n")
}
// }
}else{
println file +" 有多个"
@@ -33,8 +33,8 @@ class DevUpdateTestBatch {
static main(args) {
def task = new DevUpdateTestBatch()
def path = "D:\\数据\\数据建设\\开发区\\开发区-园区.xlsx"//开发区-园区.xlsx
task.addDev(path)
// task.addDevAddress(path)
// task.addDev(path)
task.addDevAddress(path)
//
// task.updateHasGov("新疆维吾尔自治区","喀什地区","麦盖提县", "麦盖提镇", "是")
@@ -26,14 +26,16 @@ class SynchAdministrativeMappingDataBatch extends BaseBatch{
@Override
public void process(Object args) {
def indexName = "administrative_mapping"
def retMap = synchAdminiMappingTo100()
synchAdminiMappingTo100()
def retMap = getAdminiMappingTo100()
synchToEs(retMap, "192.168.0.89", indexName)
synchToEs(retMap, "192.168.0.52", indexName)
println(" 运行完成")
}
def synchAdminiMappingTo100(city){
def synchAdminiMappingTo100(){
//删除旧的,再同步新的
ADMINISTRATIVE_MAPPING_COLL_100.remove(new BasicDBObject())
@@ -45,7 +47,7 @@ class SynchAdministrativeMappingDataBatch extends BaseBatch{
for(def d : dbcursor){
datas << d
retMap.put(d._id.toString(), d)
if (datas.size() >= 2000) {
if (datas.size() >=1000) {
ADMINISTRATIVE_MAPPING_COLL_100.insert(datas);
datas.clear();
}
@@ -59,6 +61,23 @@ class SynchAdministrativeMappingDataBatch extends BaseBatch{
return retMap;
}
def getAdminiMappingTo100(){
def q = new BasicDBObject()
def dbcursor = ADMINISTRATIVE_MAPPING_COLL.find(q).batchSize(2000)
def datas = []
def retMap = [:]
for(def d : dbcursor){
datas << d
retMap.put(d._id.toString(), d)
if(retMap.size()%10000==0){
print "."
}
}
return retMap;
}
def synchToEs(retMap, host, indexName){
QueryBuilder queryBuilder = QueryBuilders.boolQuery()
// queryBuilder.must(QueryBuilders.termQuery("street", "喀拉玛盖镇"))
@@ -20,7 +20,11 @@ import java.util.concurrent.atomic.AtomicLong
class AddPriceTest {
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(50)
<<<<<<< HEAD
//
=======
>>>>>>> f1e97d18c2798cdeb33724a417ee98085c9aea04
// def pgsqlInstance = Sql.newInstance("jdbc:postgresql://192.168.0.236:5432/warehouse",
// "postgres", "postgres", "org.postgresql.Driver")
@@ -36,6 +40,9 @@ class AddPriceTest {
task.run();
}
def run(){
<<<<<<< HEAD
def filePath = "D:\\数据\\福州\\福州价格比对.xlsx"
=======
// def districts = CommonDatautils.findAllDistrictsFromMg("西安","district", ["_id","city","region", "name", "lng","lat", "build_date", "household_count"])
// def rets = []
// rets << ["id","城市","区域","名称","经度","纬度","户数","建成年代","价格","可信度"]
@@ -44,6 +51,7 @@ class AddPriceTest {
// }
// ExcelUtils.write("d:\\数据\\数据建设\\西安楼盘.xlsx", rets, "西安")
def filePath = "d:\\数据\\数据建设\\西安楼盘.xlsx"
>>>>>>> f1e97d18c2798cdeb33724a417ee98085c9aea04
// addGXDPrice(filePath)
addCcbPrice(filePath)
// addThirdPrice(filePath)
@@ -231,12 +239,18 @@ class AddPriceTest {
//// d['AM'] = map.credit_value
// }
def newPriceMap = findNewFjwAvgPrice(d['A'], cityId)
def newPriceMap = findNewFjwAvgPrice2(d['A'], cityId, 202506)
if(newPriceMap){
d['I'] = newPriceMap.avg_price
<<<<<<< HEAD
// d['H'] = newPriceMap.month
// d['H'] = map.calc_type
// d['AM'] = map.credit_value
=======
d['K'] = newPriceMap.month
d['L'] = newPriceMap.calc_type
d['J'] = newPriceMap.credit_value
>>>>>>> f1e97d18c2798cdeb33724a417ee98085c9aea04
}
}
}, 1)
@@ -282,6 +296,27 @@ class AddPriceTest {
return map
}
def findNewFjwAvgPrice2(def commid, def cityid, def sdate){
def sql = "SELECT gujia_bds_clc_avprc,gujia_bds_clmtd,gujiabds_clc_yrmo_val,gujia_bds_cfdc_dgr from price_stat.avm_community_base_price where urbn_id='${cityid}' and gujia_bds_id='${commid}' and gujiabds_clc_yrmo_val=${sdate}"
def map = [:]
pgsqlInstance235.eachRow(sql, { r ->
map.avg_price = r.gujia_bds_clc_avprc
map.type = r.gujia_bds_clmtd
map.month = r.gujiabds_clc_yrmo_val
map.credit_value = r.gujia_bds_cfdc_dgr
if(r.gujia_bds_clmtd == 1){
map.calc_type = "人工估值"
}else if(r.gujia_bds_clmtd == 2){
map.calc_type = "样本计算"
}else if(r.gujia_bds_clmtd == 3){
map.calc_type = "神经网络"
}
})
return map
}
def addThirdPrice(filepath){
ExcelUtils.multiThreadingModify(filepath, { d ->
if (!d['X']) {
@@ -296,7 +296,8 @@ class AddressUtil {
}
public static void main(String[] args){
def addr = AddressUtil.formatAddress("福州", "北三环路201号琴亭信和小区")
AddressUtil.initCityMap()
// def addr = AddressUtil.formatAddress("福州", "北三环路201号琴亭信和小区")
}
}