Merge branch 'script_gj' into 'master'

update

See merge request !794
This commit is contained in:
2024-01-19 15:49:22 +08:00
6 changed files with 35 additions and 22 deletions
@@ -338,7 +338,7 @@ class OpenApiUtils {
lat2 = null
lng2 = null
}
println "√百度地图:【"+ret.get("city")+"-"+ret.get("area")+"-"+ret.get("name")+"-"+address+"】" +" DB:【"+city+"-"+region+"-"+name+"】"
println "√百度地图:【"+ret.get("city")+"-"+ret.get("area")+"-"+ret.get("name")+" "+map.estateType+"-"+address+"】" +" DB:【"+city+"-"+region+"-"+name+"】"
}
// }else{
@@ -405,6 +405,7 @@ class OpenApiUtils {
bean.address = loc.addr.replace("[]","")
bean.city = baiduCity
bean.region = baiduRegion
bean.township = loc.admin_info.town_name
def locArrs = BaiduCoordinateConverter.bdMercator2Latlng(loc.diPointX/100.0, loc.diPointY/100.0)
if(locArrs){
def gmap = GeocodeUtils.geoconvBaiduToGoogle(locArrs[0], locArrs[1])
@@ -412,8 +413,9 @@ class OpenApiUtils {
bean.lat = gmap.get("lat")
}
bean.estateType = loc.std_tag
bean.score = score1 + score2
rets << bean;
println "√百度搜索地图:【"+baiduCity+"-"+baiduRegion+"-"+loc.name+"-"+ loc.addr.replace("[]","")+"】" +" 搜索:【"+address+"】(score:"+score1+"#"+score2+")"
println "√百度搜索地图:【"+baiduCity+"-"+baiduRegion+"-"+loc.name+"-"+ loc.addr.replace("[]","")+" "+bean.estateType+"】" +" 搜索:【"+address+"】(score:"+score1+"#"+score2+")"
}else{
println "X 百度搜索地图:【"+loc.get("area_name")+"-"+loc.get("area_name")+"-"+loc.get("name")+"-"+loc.get("addr")+"】" +" 搜索:【"+address+"】"
}
@@ -445,6 +447,8 @@ class OpenApiUtils {
bean.address = loc.addr.replace("[]","")
bean.city = baiduCity
bean.region = baiduRegion
bean.township = loc.admin_info.town_name
bean.score = 1
def gmap = GeocodeUtils.geoconvBaiduToGoogle(lng2, lat2)
def lng = gmap.get("lng")
def lat = gmap.get("lat")
@@ -474,14 +478,16 @@ class OpenApiUtils {
bean.address = loc.addr.replace("[]","")
bean.city = baiduCity
bean.region = baiduRegion
bean.township = loc.admin_info.town_name
def gmap = GeocodeUtils.geoconvBaiduToGoogle(bean.lng2, bean.lat2)
bean.lng = gmap.get("lng")
bean.lat = gmap.get("lat")
if(result.get("detail_info")){
bean.estateType = result.get("detail_info").get("tag")
}
bean.score = score1 + score2
rets << bean;
println "√百度搜索地图:【"+baiduCity+"-"+baiduRegion+"-"+newName+"-"+ loc.addr.replace("[]","")+"】" +" 搜索:【"+address+"】(score:"+score1+"#"+score2+")"
println "√百度搜索地图:【"+baiduCity+"-"+baiduRegion+"-"+newName+"-"+bean.estateType+"-"+ loc.addr.replace("[]","")+"】" +" 搜索:【"+address+"】(score:"+score1+"#"+score2+")"
}else{
println "X 百度搜索地图:【"+loc.get("area_name")+"-"+loc.get("area_name")+"-"+loc.get("name")+"-"+loc.get("addr")+"】" +" 搜索:【"+address+"】"
}
@@ -32,7 +32,7 @@ class SuzouPocTest {
def newRun(){
println("start:"+new Date().toString())
def filePath = "D:\\数据\\江苏农行\\江苏农1500条-test.xlsx"
def filePath = "D:\\数据\\江苏农行\\押品填报表_测试数据样例-给公司.xls"
newMatch(filePath)
addEvalutePrice(filePath)
addLation(filePath)
@@ -44,7 +44,7 @@ class SuzouPocTest {
def newMatch(filePath){
ExcelUtils.multiThreadingModify(filePath, { d ->
if(d['G']){
if(d['G'] && !d['J']){
def city = d['B']
def address = d['E']
def name = d['G']
@@ -81,7 +81,7 @@ class SuzouPocTest {
}
jsonObject = FangjiaClientUtils.newMatch(city, newAddr, "property", true)
}
if(!jsonObject){
if(!jsonObject.containsKey("result")){
//老匹配
jsonObject = OpenApiClient.addressMatch(city, address, null, false, region, name)
if(jsonObject && jsonObject.credit>0){
@@ -195,7 +195,7 @@ class SuzouPocTest {
for (def s : list) {
def priceObj = CommonDatautils.findDistrictPrice(s.city, s.region, s.name)
if (priceObj) {
prices << priceObj.avg_price
prices << priceObj.avg_price_2b
}
}
if (prices) {
@@ -228,8 +228,8 @@ class FangjiaClientUtils {
def url = null;
try {
address = address.replace("{","").replace("\\","")
// def url = "http://192.168.0.100:32080/FangJiaNlpService/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}"
url = "http://192.168.0.19:31080/FangJiaNlpService/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}"
url = "http://192.168.0.100:32080/FangJiaNlpService/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}"
// url = "http://192.168.0.19:31080/FangJiaNlpService/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}"
if(city){
url = url + "&city="+URLEncoder.encode(city,"UTF-8")
@@ -10,7 +10,7 @@ def codeMap = ["
//def region = "东城区"
//def rets = OpenApiUtils.searchBaiDuMap(name, region, codeMap.get("北京").toInteger());
filePath = "D:\\数据\\涉农\\无经纬度居委_5.xlsx"
filePath = "D:\\数据\\涉农\\居委(包含不准-5万).xlsx"
ExcelUtils.multiThreadingModify(filePath, {d->
if(!d['N']){
@@ -24,7 +24,7 @@ ExcelUtils.multiThreadingModify(filePath, {d->
}
if(code){
def rets = OpenApiUtils.searchBaiDuMap(name, region, code.toInteger());
// rets = sortResult(rets)
rets = sortResult(rets)
println name +" "+rets.size()
for(def r : rets){
@@ -41,6 +41,13 @@ ExcelUtils.multiThreadingModify(filePath, {d->
stopFlag = true
}
}
}else if(bdname.contains(newName)){
if(r.township && bdname.contains(r.township)){
bdname = bdname.substring(bdname.indexOf(r.township)+r.township.length())
if(bdname && bdname == newName){
stopFlag = true
}
}
}
if(stopFlag){
d['N'] = DataUtil.getRound(6, r.lng)
@@ -68,11 +75,11 @@ def sortResult(rets){
def a1 = a.estateType
def b1 = b.estateType
def a1_score = a.score
if(a1.contains("政府机构")){
if(a1 && a1.contains("政府机构")){
a1_score = a1_score +1
}
def b1_score = b.score
if(b1.contains("政府机构")){
if(b1 && b1.contains("政府机构")){
b1_score = b1_score +1
}
return b1_score.compareTo(a1_score)
@@ -15,13 +15,13 @@ DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "commun
def filePath = "D:\\数据\\涉农\\县.xlsx"
ExcelUtils.multiThreadingModify(filePath, { row ->
// if(!row['D']){
// if(!row['I']){
// def rets = EsSearchUtils.findPois(row['B'], row['C'], row['C']+"人民政府")
// if(rets){
// def obj = findOneByName(rets, row['C']+"人民政府")
// if(obj){
// row['D'] = obj.lng
// row['E'] = obj.lat
// row['I'] = obj.lng
// row['J'] = obj.lat
// println row['C'] + " "+obj
// }
// }
@@ -34,19 +34,19 @@ ExcelUtils.multiThreadingModify(filePath, { row ->
// row['F'] = township
// }
if(row['F'] && !row['K']){
if(row['F'] && !row['G']){
def q = new BasicDBObject()
q.put("city_name", row['B'])
q.put("area_name", row['C'])
def streetName = row['I']
def streetName = row['F']
q.put("street_name", streetName)
def count = COMMUNITY_CONN.count(q);
row['K'] = count
row['G'] = count
// row['H'] = streetName
}
// def gaodeMap = getTownshipInfo(row['D']+","+row['E'])
// if(gaodeMap && gaodeMap.township){
// row['I'] = gaodeMap.township
// row['H'] = gaodeMap.township
// }
})
@@ -59,14 +59,14 @@ class SuggestionDataSynch extends BaseBatch{
def run() {
//"三明","宁德","泉州","厦门","福州","漳州","南平","龙岩","莆田","重庆"
def citys = ["湘潭","张家界","邵阳","南京","苏州","无锡","扬州","常州","徐州","镇江","南通","泰州","连云港","盐城","淮安","宿迁"]//CommonDatautils.findAllCity()
def citys = CommonDatautils.findAllCity()
def index = 0
fullCityMap = queryFullNameCity()
mcaDistMap = queryDistNameCity()
for (def c : citys) {
def allRets = []
if(["上海","北京","广州","深圳","成都","杭州","天津","西安","南京","沈阳","重庆","武汉","石家庄","福州","宁波","贵阳","怀化","郴州","益阳","永州","娄底","湘西","长沙","常德","株洲","岳阳","衡阳"].contains(c)){
if(["上海","北京","广州","深圳","成都","杭州","天津","西安","南京","沈阳","重庆","武汉","石家庄","福州","宁波","贵阳","怀化","郴州","益阳","永州","娄底","湘西","长沙","常德","株洲","岳阳","衡阳","湘潭","张家界","邵阳","南京","苏州","无锡","扬州","常州","徐州","镇江","南通","泰州","连云港","盐城","淮安","宿迁"].contains(c)){
continue;
}
index++