国信所需接口封装

This commit is contained in:
majintao
2024-08-30 15:48:47 +08:00
parent b3de1ae4c8
commit d21c97d31c
@@ -80,13 +80,13 @@ public class AddrSvcController {
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("address", model.getAddress());
params.put("addressAssessment","true");
params.put("addressAssessment", "true");
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/formatNinelevel", params, "UTF-8");
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
BasicModel basicModel = new BasicModel(code == 0 ? 200 : 0, msg);
if (json.containsKey("result")) {
JSONObject result = json.getJSONObject("result");
result.remove("formatAddress");
@@ -127,7 +127,7 @@ public class AddrSvcController {
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
BasicModel basicModel = new BasicModel(code == 0 ? 200 : 0, msg);
if (json.containsKey("result")) {
DistrictIdentifyDto districtIdentifyDto = CommonDtoUtils.transformV(DistrictIdentifyDto.class, json.get("result"));
JSONObject result = json.getJSONObject("result");
@@ -284,7 +284,7 @@ public class AddrSvcController {
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", model.getCity());
params.put("region", model.getRegion());
params.put("district", model.getRegion());
params.put("keywords", model.getKeywords());
params.put("page", "0");
params.put("offset", String.valueOf(model.getMax() == 0 ? 10 : (model.getMax() > 100 ? 100 : model.getMax())));
@@ -297,7 +297,7 @@ public class AddrSvcController {
if (json.containsKey("result")) {
JSONArray jsonArray = json.getJSONArray("result");
if (jsonArray.size() > 0) {
basicModel.setResult(CommonDtoUtils.transformListV(DistrictDto.class,jsonArray));
basicModel.setResult(CommonDtoUtils.transformListV(DistrictDto.class, jsonArray));
}
}
mav.setModel(basicModel);
@@ -969,6 +969,7 @@ public class AddrSvcController {
* @param model
* @return
*/
@Deprecated
public Object addressAssociationAction(AddressModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
@@ -1111,6 +1112,7 @@ public class AddrSvcController {
/**
* 区域级行政区划查询接口
*
* @param model
* @return
*/
@@ -1160,6 +1162,7 @@ public class AddrSvcController {
}
return mav;
}
public Object listTownshipAction(AddressModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
HttpRequest request = new HttpRequest();