This commit is contained in:
2022-10-25 13:45:44 +08:00
parent eaf35c26ac
commit 17f7722530
5 changed files with 57 additions and 18 deletions
@@ -58,7 +58,7 @@ class BigdataDealBatch extends BaseBatch{
public void process(Object args) {
//def weekend = DateUtils.parseFromTightByPattern("2021-07-25","yyyy-MM-dd")//DateUtils.getFirstDayOfWeek(new Date())
// def citys = CcbCommonUtils.citys;
def citys = CcbCommonUtils.getRunningCitys(args)
def citys = ["上海"]//CcbCommonUtils.getRunningCitys(args)
if(args && args.size()>=2){
curDate = args[1].toString().toInteger()
}
@@ -36,7 +36,7 @@ class GuiDingPriceBatch extends BaseBatch{
@Override
public void process(Object args) {
def citys = CcbCommonUtils.citys;
def citys = CcbCommonUtils.getRunningCitys(args)
def rows = []
for (def city : citys) {
@@ -44,7 +44,7 @@ class GuiDingPriceBatch extends BaseBatch{
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
//添加自己库中的人工指导价
def prices = CcbCommonUtils.findPersonPrice(city, "2022-09-22", "2022-09-23")
def prices = CcbCommonUtils.findPersonPrice(city, "2022-10-21", "2022-10-22")
if(prices){
def distMap = getDistrictMap(city)
def rets = createCityDatas(cityCodeDatas, distCodeMap, distMap, prices)
@@ -1001,10 +1001,10 @@ def DBCollection youda_esfhouse_coll = MongoUtils.getCollectionByName2("business
//def fileName = "D:\\数据\\建行\\房产估值\\指导价\\录入人工查价_0922_300.xlsx"
def fileName = "D:\\数据\\建行\\房产估值\\指导价\\人工指导价录入_1020.xlsx"
//ExcelUtils.multiThreadingModify(fileName, {d->
// if(d['A']){
ExcelUtils.multiThreadingModify(fileName, {d->
if(d['A']){
// def region = RegionData.formatRegion(d['A'], d['B'])
// if(region){
// def dist = CommonDatautils.findDistrict(d['A'], region, d['C'], "district")
@@ -1013,18 +1013,18 @@ def DBCollection youda_esfhouse_coll = MongoUtils.getCollectionByName2("business
// d['F'] = dist._id.toString()
// }
// }
//// if(!d['Q']){
//// def dist = CommonDatautils.findDistrictById(d['A'])
//////
//// if(dist){
//// d['H'] = dist.region
////// d['G'] = dist.name
//// d['I'] = dist.status
//// }
//// }
if(!d['F']){
def dist = CommonDatautils.findDistrictById(d['A'])
//
// }
//},0)
if(dist){
// d['H'] = dist.region
// d['G'] = dist.name
d['F'] = dist.status
}
}
}
},0)
@@ -29,7 +29,30 @@ class DataMatch {
// task.run3()
// println task.findAddress("昌州街道棠香路")
task.run2MatchV2( "D:\\数据\\重庆农商行\\估值1-V2.xlsx")
// task.run2MatchV2( "D:\\数据\\重庆农商行\\估值1-V2.xlsx")
task.fzWeiyuanshuMatch("D:\\数据\\福州\\商品住房楼盘评估指导参考价情况表_匹配.xlsx")
}
def fzWeiyuanshuMatch(fileName){
ExcelUtils.modify(fileName,{d->
if(!d['K'] && d['C']){
def arr = OpenApiClient.search("福州", d['G'], d['C'])
if(arr){
d['H'] = arr.city
d['I'] = arr.district
d['J'] = arr.name
}
}
// def results = null
// if(!d['K'] && d['C']){
// results = OpenApiClient.addressMatch("福州",d['C'], "property", false, "长乐", null)
// }
// if(results && results.precise>=0){
// d['L'] = results.district
// d['M'] = results.name
// }
},0)
}
def run1(){
@@ -52,6 +52,22 @@ public class OpenApiClient {
return false
}
public static def search(def city, def district, def name){
Map<String, String> params = new HashMap<String, String>()
params.put("city", city);
params.put("keyword", name);
params.put("district", district)
params.put("token", TOKEN);
String content = new HttpRequest().get("http://open.fangjia.com/property/search", params, "utf-8")
JSONObject jsonObj = JSONObject.fromObject(content)
JSONArray array = jsonObj.get("result")
def matchObj = null
if(array){
matchObj = array[0]
}
return matchObj
}
public static List searchDistrict(double lng, double lat, int r, String city) {
DecimalFormat format = new DecimalFormat("#.0000000000");
try {