Merge branch 'script_gj' into 'master'
Script gj See merge request !1183
This commit is contained in:
@@ -830,6 +830,25 @@ class OpenApiUtils {
|
||||
}
|
||||
|
||||
|
||||
static def addrVerifyShBank(city, address){
|
||||
address = URLEncoder.encode(address, "utf-8");
|
||||
// def url = "http://192.168.0.100:32080/FangJiaAddressService/cebEnterpriseVillageIdentify?address=${address}"
|
||||
def url = "http://localhost:8080/addrSvc/boscEnterpriseVillageIdentify?address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||
if(city){
|
||||
url = url + "&city=${city}"
|
||||
}
|
||||
String content = new HttpRequest().get(url, "utf-8");
|
||||
if(content){
|
||||
def doc = new JsonSlurper().parseText(content)
|
||||
if(doc && doc.code ==200 && doc.result){
|
||||
def dtos = doc.result
|
||||
return dtos
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
static def addrVerifyBase(city, address){
|
||||
address = URLEncoder.encode(address, "utf-8");
|
||||
def url = "http://192.168.0.100:32080/FangJiaAddressService/enterpriseVillageIdentify?address=${address}"
|
||||
|
||||
+2
-2
@@ -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("新疆维吾尔自治区","喀什地区","麦盖提县", "麦盖提镇", "是")
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.fangjia.script.gj.village
|
||||
|
||||
import com.fangjia.script.gj.OpenApiUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
|
||||
class ShBank {
|
||||
static main(args) {
|
||||
def task = new ShBank();
|
||||
task.run()
|
||||
}
|
||||
|
||||
def run(){
|
||||
ExcelUtils.multiThreadingModify("D:\\数据\\上海银行\\上海银行新逻辑的测试案例.xls",{ d->
|
||||
|
||||
if(!d['R'] && d['B']){
|
||||
def dto = OpenApiUtils.addrVerifyShBank(null, d['B'])
|
||||
if(dto){
|
||||
// def dto = jsonObj.result
|
||||
d['E'] = dto.addrArea //所属区域 农村区域 城市区域 县城城区(对公)
|
||||
d['F'] = dto.remark
|
||||
|
||||
d['G'] = dto.province
|
||||
d['H'] = dto.provinceCode
|
||||
d['I'] = dto.city
|
||||
d['J'] = dto.cityCode;
|
||||
d['K'] = dto.district
|
||||
d['L'] = dto.districtCode
|
||||
d['M'] = dto.town
|
||||
d['N'] = dto.townCode
|
||||
// d['N'] = dto.committee
|
||||
// d['O'] = dto.committeeCode
|
||||
// d['P'] = dto.typeCode
|
||||
// d['Q'] = dto.typeName
|
||||
d['O'] = dto.verifyFlag//涉农标识
|
||||
d['P'] = dto.addrVerify//地址是否有效信息
|
||||
d['Q'] = dto.countyLevelCity//是否为县级市
|
||||
d['R'] = dto.countyGov//是否为县政府
|
||||
d['S'] = dto.devDistrict//是否为开发区
|
||||
d['T'] = dto.devDistrictName//开发区
|
||||
d['U'] = dto.devLevel//开发区等级
|
||||
d['V']= dto.administrativeTowns;//是否市辖建制
|
||||
d['W'] = dto.prefectureLevelOrAbove ;// 是否为地级市以上行政区划
|
||||
d['X'] = dto.countyGovTown; //县政府所在镇
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
+55
-1
@@ -6,6 +6,7 @@ import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.district.FangjiaClientUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.OpenApiClient
|
||||
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
@@ -20,7 +21,9 @@ class TestEvaluation {
|
||||
// task.run();
|
||||
|
||||
// task.match()
|
||||
task.houseSimilar()
|
||||
// task.houseSimilar()
|
||||
|
||||
task.newAndOldMatch()
|
||||
}
|
||||
|
||||
def houseSimilar(){
|
||||
@@ -133,4 +136,55 @@ class TestEvaluation {
|
||||
println s
|
||||
}
|
||||
|
||||
def newAndOldMatch(){
|
||||
ExcelUtils.multiThreadingModify("D:\\数据\\估值\\地址估价-匹配(加写字楼-商铺).xlsx",{d->
|
||||
if(d['A']){
|
||||
def address = d['A']
|
||||
def city = '上海'
|
||||
if(!d['B']){
|
||||
def jsonObject = FangjiaClientUtils.newMatch(city, address, "property", false)
|
||||
if(jsonObject){
|
||||
d['B'] = jsonObject.get("id")
|
||||
d['C'] = jsonObject.get("city")
|
||||
d['D'] = jsonObject.get("district")
|
||||
d['E'] = jsonObject.get("name")
|
||||
d['F'] = jsonObject.get("propertyType")
|
||||
}else{
|
||||
jsonObject = FangjiaClientUtils.newMatch(city, address, "property", true)
|
||||
if(jsonObject){
|
||||
d['B'] = jsonObject.get("id")
|
||||
d['C'] = jsonObject.get("city")+"(地图)"
|
||||
d['D'] = jsonObject.get("district")
|
||||
d['E'] = jsonObject.get("name")
|
||||
d['F'] = jsonObject.get("propertyType")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!d['G']){
|
||||
def jsonObject2 = OpenApiClient.addressMatch(city, address, "shop", false, null, null)
|
||||
if(jsonObject2 != null && jsonObject2.precise!=-1) {
|
||||
d['G'] = jsonObject2.get("id")
|
||||
d['H'] = jsonObject2.get("city")
|
||||
d['I'] = jsonObject2.get("district")
|
||||
d['J'] = jsonObject2.get("name")
|
||||
d['K'] = jsonObject2.get("propertyType")
|
||||
}
|
||||
// else{
|
||||
// jsonObject2 = OpenApiClient.addressMatch(city, address, "property", true, null, null)
|
||||
// if(jsonObject2 != null && jsonObject2.precise!=-1) {
|
||||
// d['F'] = jsonObject2.get("id")
|
||||
// d['G'] = jsonObject2.get("city")+"(地图)"
|
||||
// d['H'] = jsonObject2.get("district")
|
||||
// d['I'] = jsonObject2.get("name")
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user