From d21c97d31cd3842b1dc84f3a4d7162febea98fa6 Mon Sep 17 00:00:00 2001 From: majintao Date: Fri, 30 Aug 2024 15:48:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E4=BF=A1=E6=89=80=E9=9C=80=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/open/controllers/AddrSvcController.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java index 6f0117e55..39602ef5d 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java @@ -80,13 +80,13 @@ public class AddrSvcController { Map params = new HashMap(); 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 params = new HashMap(); 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();