diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/OpenApiUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/OpenApiUtils.groovy index 7343a106d..f6f47f7c6 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/OpenApiUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/OpenApiUtils.groovy @@ -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+"】" } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/abc/SuzouPocTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/abc/SuzouPocTest.groovy index bc770b173..b2c8548ad 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/abc/SuzouPocTest.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/abc/SuzouPocTest.groovy @@ -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) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy index 0f6684bdc..837c41b27 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy @@ -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") diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/communityLocation.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/communityLocation.groovy index 2fe850969..d8fdcf40c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/communityLocation.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/communityLocation.groovy @@ -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) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/govLocation.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/govLocation.groovy index d0877a9a0..99352aedd 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/govLocation.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/govLocation.groovy @@ -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 // } }) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/SuggestionDataSynch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/SuggestionDataSynch.groovy index 036522286..25930543d 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/SuggestionDataSynch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/SuggestionDataSynch.groovy @@ -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++