+38
@@ -1861,6 +1861,44 @@ public class AddressController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招商证券POC测试接口封装
|
||||||
|
*/
|
||||||
|
public Object cmbTestAction(AddesssMatchModel model) {
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
if (StringUtils.isBlank(model.getAddress())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
HttpRequest request = new HttpRequest();
|
||||||
|
JSONObject json = null;
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
|
||||||
|
params.put("address", model.getAddress());
|
||||||
|
try{
|
||||||
|
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/cmbTest", params, "UTF-8");
|
||||||
|
} catch(Exception e){
|
||||||
|
try {
|
||||||
|
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/cmbTest", params, "UTF-8");
|
||||||
|
} catch(Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (json != null) {
|
||||||
|
int code = json.getInt("status");
|
||||||
|
String msg = json.getString("msg");
|
||||||
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
|
if(json.containsKey("result")){
|
||||||
|
basicModel.setResult(json.get("result"));
|
||||||
|
}
|
||||||
|
mav.setModel(basicModel);
|
||||||
|
} else {
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 五级地址标准化接口
|
* 五级地址标准化接口
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user