diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/CommercialController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/CommercialController.java index 5e5eb15ec..4d40799bc 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/CommercialController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/CommercialController.java @@ -116,12 +116,12 @@ public class CommercialController { if(mav.model()!=null){ return mav; } - Double ratio = getUserPriceRatio(request); + Double ratio = null;//getUserPriceRatio(request); JSONObject json = locationEvaluateApi(model, AvmUrls.SHOPSELL_EVALUATE); if (json != null) { if (json.containsKey("msg") && "成功".equals(json.getString("msg"))) { - if (json.containsKey("unitPrice") && json.containsKey("lng")) { + if (json.containsKey("unitPrice") && json.containsKey("location")) { if(json.get("unitPrice") != null){ int unitPrice = (Integer) json.get("unitPrice"); @@ -138,8 +138,9 @@ public class CommercialController { model.setMaxPrice(model.getMaxPrice()); } } - Double lng = json.getDouble("lng"); - Double lat = json.getDouble("lat"); + JSONObject locObj = json.getJSONObject("location"); + Double lng = locObj.getDouble("lon"); + Double lat = locObj.getDouble("lat"); List houseSelf = dealSampleService.querySampleByLocation(lng, lat, model.getMinPrice(), model.getMaxPrice(), "shop_sell", 5); List dtos = createSample(houseSelf, "sell", ratio, lng, lat); mav.setModel(BasicModel.buildOKModel().setResult(dtos)); @@ -147,10 +148,9 @@ public class CommercialController { BasicModel.markNoDataRequest(); } } + } else{ + mav.setModel(BasicModel.buildOKModel().setResult(null)); } -// else{ -// mav.setModel(BasicModel.buildServerErrorModel().setMsg(json.getString("msg"))); -// } } else { mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); } @@ -363,11 +363,11 @@ public class CommercialController { if(mav.model()!=null){ return mav; } - Double ratio = getUserPriceRatio(request); + Double ratio = null;//getUserPriceRatio(request); JSONObject json = locationEvaluateApi(model, AvmUrls.SHOPRENT_EVALUATE); if (json != null) { if (json.containsKey("msg") && "成功".equals(json.getString("msg"))) { - if (json.containsKey("unitPrice") && json.containsKey("lng")) { + if (json.containsKey("unitPrice") && json.containsKey("location")) { Double minPrice = null; Double maxPrice = null; @@ -384,8 +384,9 @@ public class CommercialController { minPrice = model.getMaxPrice().doubleValue(); } } - Double lng = json.getDouble("lng"); - Double lat = json.getDouble("lat"); + JSONObject locObj = json.getJSONObject("location"); + Double lng = locObj.getDouble("lon"); + Double lat = locObj.getDouble("lat"); List houseSelf = dealSampleService.querySampleByLocation(lng, lat, DataUtil.getDoubleRound(2, minPrice), DataUtil.getDoubleRound(2, maxPrice), "shop_rent", 5); List dtos = createSample(houseSelf, "rent", ratio, lng, lat); @@ -395,10 +396,9 @@ public class CommercialController { BasicModel.markNoDataRequest(); } } + }else{ + mav.setModel(BasicModel.buildOKModel().setResult(null)); } -// else { -// mav.setModel(BasicModel.buildServerErrorModel().setMsg(json.getString("msg"))); -// } } else { mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/OfficeController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/OfficeController.java index b76f21324..735ee7e85 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/OfficeController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/OfficeController.java @@ -815,7 +815,7 @@ public class OfficeController { } /* 先到CPDB库中查找写字楼 */ District district = null; - Double ratio = getUserPriceRatio(request); + Double ratio = null;//getUserPriceRatio(request); if(StringUtils.isNotBlank(model.getDistrict()) && StringUtils.isNotBlank(model.getName())) { district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(), "office"); diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/OfficeSellController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/OfficeSellController.java index c03b3bdb4..453ffc120 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/OfficeSellController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/OfficeSellController.java @@ -546,7 +546,7 @@ public class OfficeSellController { return mav; } - Double ratio = getUserPriceRatio(request); + Double ratio = null;//getUserPriceRatio(request); /* 先到CPDB库中查找写字楼 */ District district = null; diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java index 012150c4e..8903c3645 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java @@ -6659,7 +6659,7 @@ public class PropertyController { } else { pager.setPageSize(5); } - Double ratio = getUserPriceRatio(request); + Double ratio = null;//getUserPriceRatio(request); Double minPrice = null; Double maxPrice = null;