This commit is contained in:
mjt
2024-04-09 15:57:06 +08:00
6 changed files with 137 additions and 99 deletions
@@ -52,7 +52,7 @@ class GuiDingPriceBatch extends BaseBatch{
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
//添加自己库中的人工指导价 //添加自己库中的人工指导价
def prices = CcbCommonUtils.findPersonPrice(city, "2024-01-10", "2024-01-28") def prices = CcbCommonUtils.findPersonPrice(city, "2024-03-27", "2024-04-10")
// def prices = CcbCommonUtils.findPersonPrice(city, "2022-01-01", "2022-11-22") // def prices = CcbCommonUtils.findPersonPrice(city, "2022-01-01", "2022-11-22")
if(prices){ if(prices){
def distMap = getDistrictMap(city) def distMap = getDistrictMap(city)
@@ -7,6 +7,7 @@ import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.common.DataHandleUtils import com.fangjia.script.common.DataHandleUtils
import com.fangjia.script.gj.ccb.CcbCodeUtils import com.fangjia.script.gj.ccb.CcbCodeUtils
import com.fangjia.script.gj.ccb.FileUtils import com.fangjia.script.gj.ccb.FileUtils
import com.fangjia.script.gj.district.FangjiaClientUtils
import com.fangjia.script.linxsh.util.AddressUtil import com.fangjia.script.linxsh.util.AddressUtil
import com.fangjia.script.looplineinfo.InsidePolygon import com.fangjia.script.looplineinfo.InsidePolygon
import com.fangjia.script.looplineinfo.Point import com.fangjia.script.looplineinfo.Point
@@ -1288,34 +1289,70 @@ def findAvgPrice(def commid, def pgsqlInstance, def cityid){
def fileName = "D:\\数据\\建行\\房产估值\\指导价\\20240127.xlsx" //def fileName = "D:\\数据\\建行\\房产估值\\指导价\\20240127.xlsx"
//
ExcelUtils.multiThreadingModify(fileName, {d-> //ExcelUtils.multiThreadingModify(fileName, {d->
if(d['A']){ // if(d['A']){
// def region = RegionData.formatRegion(d['B'], d['C']) //// def region = RegionData.formatRegion(d['B'], d['C'])
// if(region){ //// if(region){
// def dist = CommonDatautils.findDistrict(d['B'], region, d['E'], "district") //// def dist = CommonDatautils.findDistrict(d['B'], region, d['E'], "district")
//// if(dist){
//// d['G'] = dist.region
//// d['H'] = dist._id.toString()
//// }
//// }
// if(!d['I']){
// def dist = CommonDatautils.findDistrictById(d['C'])
// if(dist){ // if(dist){
// d['G'] = dist.region // d['F'] = dist.region
// d['H'] = dist._id.toString() //// d['H'] = dist.name
// d['G'] = dist.status
//// if(d['A']=="天门" || d['A']=="迪庆"){
//// def val = d['E'].toString().toDouble().toInteger() + RandomUtil.random(-200,200)
//// d['K'] = val.toInteger()
//// }
// } // }
// } // }
if(!d['I']){ // }
def dist = CommonDatautils.findDistrictById(d['C']) //},0)
if(dist){
d['F'] = dist.region def fileName = "D:\\数据\\建行\\房产估值\\指导价\\2024-04-08修改人工指导价.xlsx"
// d['H'] = dist.name ExcelUtils.multiThreadingModify(fileName, { d ->
d['G'] = dist.status if(d['B'] && !d['D']){
// if(d['A']=="天门" || d['A']=="迪庆"){ def jsonObject = FangjiaClientUtils.newMatch(d['A'], d['B'], "property", "district")
// def val = d['E'].toString().toDouble().toInteger() + RandomUtil.random(-200,200) if(jsonObject != null && jsonObject.credit>0) {
// d['K'] = val.toInteger() d['D'] = jsonObject.get("city")
// } d['E'] = jsonObject.get("district")
d['F'] = jsonObject.get("name")
def dbo = CommonDatautils.findDistrictById(jsonObject.get("id"))
if(dbo){
d['G'] = dbo.status
d['H'] = dbo.name_cat
d['I'] = dbo.estate_type2
d['J'] = "接口匹配"
} }
} }
// def objs = CommonDatautils.findDistrictList(d['A'],null, d['B'], "district")
// if(!objs){
// objs = CommonDatautils.findDistrictByAlias(d['A'], null, d['B'], "district")
// }
// if(objs && objs.size()==1){
// def o = objs[0]
// if(o){
// d['D'] = o.city
// d['E'] = o.region
// d['F'] = o.name
// d['G'] = o.status
// d['H'] = o.name_cat
// d['I'] = o.estate_type2
// d['J'] = "别名"
// }
// }
} }
},0) })
//def fileName = "D:\\数据\\建行\\建行成交\\咸阳成交.xlsx" //def fileName = "D:\\数据\\建行\\建行成交\\咸阳成交.xlsx"
//ExcelUtils.multiThreadingModify(fileName, { d -> //ExcelUtils.multiThreadingModify(fileName, { d ->
@@ -4,17 +4,15 @@ import com.fangjia.script.BaseBatch
import com.fangjia.script.BatchOwner import com.fangjia.script.BatchOwner
import com.fangjia.script.Watcher import com.fangjia.script.Watcher
import com.fangjia.script.ccbevaluation.CcbCommonUtils import com.fangjia.script.ccbevaluation.CcbCommonUtils
import com.fangjia.script.ccbevaluation.CcbFtpTestUtils
import com.fangjia.script.ccbevaluation.CcbFtpUtils import com.fangjia.script.ccbevaluation.CcbFtpUtils
import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.gj.ccb.FileUtils import com.fangjia.script.gj.ccb.FileUtils
import com.fangjia.script.util.DateUtils import com.fangjia.script.util.DateUtils
import com.jcraft.jsch.ChannelSftp
import groovy.sql.Sql import groovy.sql.Sql
import java.sql.ResultSet /**
import java.sql.ResultSetMetaData * 建行融合数据导出
*/
@BatchOwner(Watcher.GaoJuan) @BatchOwner(Watcher.GaoJuan)
class ExportDistrictRongHe extends BaseBatch{ class ExportDistrictRongHe extends BaseBatch{
@@ -283,7 +283,12 @@ class DistrictSellStatBatch extends BaseBatch {
def dbcursor = DISTRICT_SELL_STAT.find(q) def dbcursor = DISTRICT_SELL_STAT.find(q)
def priceMap = [:] def priceMap = [:]
for(def d : dbcursor){ for(def d : dbcursor){
priceMap.put(d.region +"##"+d.district_name, d) if(d.estate_type=="别墅"){
priceMap.put(d.region +"##"+d.district_name+"##别墅", d)
}else{
priceMap.put(d.region +"##"+d.district_name+"##小区", d)
}
} }
return priceMap return priceMap
} }
@@ -18,77 +18,75 @@ DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "commun
//def s = getTownshipInfo("118.702988,39.740979") //def s = getTownshipInfo("118.702988,39.740979")
def filePath = "D:\\数据\\涉农\\县政府(最终).xlsx" def filePath = "D:\\数据\\涉农\\县政府(最终).xlsx"
//ExcelUtils.multiThreadingModify(filePath, { row -> ExcelUtils.modify(filePath, { row ->
//// if(!row['I']){ // if(!row['I']){
//// def rets = EsSearchUtils.findPois(row['B'], row['C'], row['C']+"人民政府") // def rets = EsSearchUtils.findPois(row['B'], row['C'], row['C']+"人民政府")
//// if(rets){ // if(rets){
//// def obj = findOneByName(rets, row['C']+"人民政府") // def obj = findOneByName(rets, row['C']+"人民政府")
//// if(obj){ // if(obj){
//// row['I'] = obj.lng // row['I'] = obj.lng
//// row['J'] = obj.lat // row['J'] = obj.lat
//// println row['C'] + " "+obj // println row['C'] + " "+obj
//// } // }
//// } // }
//// } // }
//
//// if(row['D'] && !row['F']){ if(row['D'] && !row['F']){
//// def townMap = findTownRange(row['B'], TOWN_POLYLINECOLL) def townMap = findTownRange(row['B'], TOWN_POLYLINECOLL)
//// def map = ["lon":row['D'], "lat":row['E']] def map = ["lon":row['D'], "lat":row['E']]
//// def township = InsidePolygon.isInArea2(map.lon, map.lat, townMap) def township = InsidePolygon.isInArea2(map.lon, map.lat, townMap)
//// row['F'] = township row['F'] = township
//// } }
//
//// if(row['F'] && !row['J']){ // if(row['F'] && !row['J']){
//// def q = new BasicDBObject() // def q = new BasicDBObject()
//// q.put("city_name", row['B']) // q.put("city_name", row['B'])
//// q.put("area_name", row['C']) // q.put("area_name", row['C'])
//// def streetName = row['F'] // def streetName = row['F']
//// q.put("street_name", streetName) // q.put("street_name", streetName)
//// def count = COMMUNITY_CONN.count(q); // def count = COMMUNITY_CONN.count(q);
//// row['J'] = count // row['J'] = count
////// row['H'] = streetName //// row['H'] = streetName
//// } // }
//// if(!row['H']){ // if(!row['H']){
//// def gaodeMap = getTownshipInfo(row['D']+","+row['E']) // def gaodeMap = getTownshipInfo(row['D']+","+row['E'])
//// if(gaodeMap && gaodeMap.township){ // if(gaodeMap && gaodeMap.township){
//// row['H'] = gaodeMap.township // row['H'] = gaodeMap.township
//// } // }
//// } // }
//
//// if(row['J'] && row['J'].toString().toDouble()>0){ // if(row['J'] && row['J'].toString().toDouble()>0){
//// def up_query = new BasicDBObject() // def up_query = new BasicDBObject()
//// up_query.put("city_name", row['B']) // up_query.put("city_name", row['B'])
//// up_query.put("area_name", row['C']) // up_query.put("area_name", row['C'])
//// up_query.put("street_name", row['F']) // up_query.put("street_name", row['F'])
//// def udata = new BasicDBObject() // def udata = new BasicDBObject()
//// udata.put("has_gov", "是") // udata.put("has_gov", "是")
//// COMMUNITY_CONN.update(up_query, new BasicDBObject('$set', udata), false, true) // COMMUNITY_CONN.update(up_query, new BasicDBObject('$set', udata), false, true)
//// } // }
// })
//
//})
def objs = COMMUNITY_CONN.find(new BasicDBObject()).setOptions(Bytes.QUERYOPTION_NOTIMEOUT); //def objs = COMMUNITY_CONN.find(new BasicDBObject()).setOptions(Bytes.QUERYOPTION_NOTIMEOUT);
for(def d : objs){ //for(def d : objs){
if(!d.name_pinyin){ // if(!d.name_pinyin){
if(d.name){ // if(d.name){
println d._id // println d._id
def py1 = com.fangjia.core.util.DataUtil.hanyuQuanpin(d.name, " ") // def py1 = com.fangjia.core.util.DataUtil.hanyuQuanpin(d.name, " ")
def udata = new BasicDBObject() // def udata = new BasicDBObject()
udata.put("name_pinyin", py1) // udata.put("name_pinyin", py1)
if(d.location){ // if(d.location){
def lon = DataHandleUtils.getDoubleRound(6, d.location.lon) // def lon = DataHandleUtils.getDoubleRound(6, d.location.lon)
def lat = DataHandleUtils.getDoubleRound(6, d.location.lat) // def lat = DataHandleUtils.getDoubleRound(6, d.location.lat)
udata.put("location", ["lat":lat, "lon":lon]) // udata.put("location", ["lat":lat, "lon":lon])
} // }
//
def q = new BasicDBObject() // def q = new BasicDBObject()
q.put("_id", d._id) // q.put("_id", d._id)
COMMUNITY_CONN.update(q, new BasicDBObject('$set', udata), false, true) // COMMUNITY_CONN.update(q, new BasicDBObject('$set', udata), false, true)
} // }
} // }
} //}
def getTownshipInfo(def glocation){ def getTownshipInfo(def glocation){
@@ -284,7 +284,7 @@ class InsidePolygon {
if(flag){ if(flag){
def arrs = key.split("##") def arrs = key.split("##")
name = arrs[1]; name = arrs[1];
break; // break;
} }
} }
if(flag){ if(flag){