From cde3566aaeda455576d21dac9c73f19d3090f46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Wed, 7 Apr 2021 10:33:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8A=A5=E5=91=8A=E7=BB=93?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/controllers/PropertyController.java | 20 +- .../controllers/weixin/CcbRentController.java | 50 ++- .../open/model/weixin/EvaluationModel.java | 1 - .../model/weixin/PropertyEvaluationModel.java | 169 +++++++ .../src/main/webapp/ccbRent/detail.ftl | 420 ++++++++++++++++++ .../src/main/webapp/ccbRent/index.ftl | 10 +- .../src/main/webapp/ccbRent/report.ftl | 13 +- .../main/webapp/static/js/autoCompletion.js | 5 +- 8 files changed, 642 insertions(+), 46 deletions(-) create mode 100644 projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/PropertyEvaluationModel.java create mode 100644 projects/fangjia-open/src/main/webapp/ccbRent/detail.ftl 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 8da4f18e1..b38424544 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 @@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import com.fangjia.core.util.*; import com.fangjia.dal.*; import com.fangjia.dal.mongo.model.*; import com.fangjia.dal.seawater.dao.SeawaterDao; @@ -59,16 +60,6 @@ import org.sothis.web.mvc.annotation.Param; import org.springframework.web.multipart.MultipartFile; import com.fangjia.core.RegionData; -import com.fangjia.core.util.AnalyticsUtil; -import com.fangjia.core.util.CoordPoint; -import com.fangjia.core.util.CoordinateConversion; -import com.fangjia.core.util.DataUtil; -import com.fangjia.core.util.DateUtil; -import com.fangjia.core.util.GeoUtils; -import com.fangjia.core.util.GeocodeUtils; -import com.fangjia.core.util.HouseValidator; -import com.fangjia.core.util.LoggerFactory; -import com.fangjia.core.util.SecurityUtil; import com.fangjia.dal.common.DistrictKey; import com.fangjia.dal.common.ServerAreaData; import com.fangjia.dal.datastore.model.House; @@ -5051,8 +5042,13 @@ public class PropertyController { districtPriceMap.put("name", district.getName()); districtPriceMap.put("address", district.getAddress()); districtPriceMap.put("totalPrice", evaluation.getTotalPrice()); - districtPriceMap.put("cal_date", model.getCalDate()); - + districtPriceMap.put("totalPriceUpper", CNNMFilter.convert(String.valueOf(evaluation.getTotalPrice()))); + districtPriceMap.put("cal_date", DateUtil.formatByPattern(new Date(), "yyyy/MM/dd")); + districtPriceMap.put("direction", evaluation.getDirection()); + districtPriceMap.put("size", evaluation.getArea()); + districtPriceMap.put("floor", model.getFloor()); + districtPriceMap.put("height", model.getHeight()); + districtPriceMap.put("fitment", evaluation.getFitment()); Integer startPrice = (int)(evaluation.getTotalPrice() - evaluation.getTotalPrice()*0.2); Integer endPrice = (int)(evaluation.getTotalPrice() + evaluation.getTotalPrice()*0.2); diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/CcbRentController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/CcbRentController.java index 6bb6ab92b..d8d71bd8c 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/CcbRentController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/CcbRentController.java @@ -9,10 +9,9 @@ import com.fangjia.dal.SrQuery; import com.fangjia.dal.seaweed.model.District; import com.fangjia.open.compatible.model.JsonModel; import com.fangjia.open.controllers.PropertyController; -import com.fangjia.open.dto.CcbRentDto; -import com.fangjia.open.interceptors.Authority; import com.fangjia.open.model.BaseModel; -import com.fangjia.open.model.PropertyEvaluationModel; +import com.fangjia.open.model.weixin.EvaluationModel; +import com.fangjia.open.model.weixin.PropertyEvaluationModel; import com.fangjia.service.api.AutoCompleteBo; import com.fangjia.service.datastore.DistrictService; import org.apache.commons.lang.StringUtils; @@ -25,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -37,21 +37,46 @@ import java.util.Map; public class CcbRentController { private DistrictService districtService; - private PropertyController propertyController; public Object indexAction(BaseModel result) { return result; } - public Object reportAction(BaseModel result) { - JsonModel model = new JsonModel(); + public Object reportAction(EvaluationModel result, @Param(name = "address") String address, @Param(name = "totalPrice") String totalPrice) { + result.setLender(address); + result.setDealPrice(Double.valueOf(totalPrice)); return result; } - public Object evaluateRentAction(CcbRentDto ccbRentDto, HttpServletRequest request) throws IllegalAccessException { - PropertyEvaluationModel evaluationModel = new PropertyEvaluationModel(); - BeanUtils.copyProperties(ccbRentDto, evaluationModel); - return propertyController.evaluateRentAction(evaluationModel, request); + public Object detailAction(PropertyEvaluationModel result, @Param(name = "city") String city, @Param(name = "district") String district, + @Param(name = "name") String name, @Param(name = "address") String address, + @Param(name = "size") Double size, @Param(name = "floor") Integer floor, @Param(name = "height") Integer height, @Param(name = "room") Integer room, + @Param(name = "hall") Integer hall, @Param(name = "toilet") Integer toilet, @Param(name = "direction") String direction, @Param(name = "fitment") String fitment) { + result.setCityName("ÉϺ£"); + result.setDistrict("¾²°²"); + result.setName("³¡ÖÐСÇø"); + result.setAddress(""); + result.setSize(50.0); + result.setFloor(7); + result.setHeight(7); + result.setRoom(1); + result.setHall(1); + result.setToilet(1); + result.setDirection("1"); + + /* result.setCityName(city); + result.setDistrict(district); + result.setName(name); + result.setAddress(address); + result.setSize(size); + result.setFloor(floor); + result.setHeight(height); + result.setRoom(room); + result.setHall(hall); + result.setToilet(toilet); + result.setDirection(direction); + result.setFitment(fitment);*/ + return result; } /** @@ -118,9 +143,4 @@ public class CcbRentController { public void setDistrictService(DistrictService districtService) { this.districtService = districtService; } - - @Autowired - public void setPropertyController(PropertyController propertyController) { - this.propertyController = propertyController; - } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java index 9dfcc82a7..dcdb3e2c2 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java @@ -39,7 +39,6 @@ public class EvaluationModel extends BaseModel{ private Integer role; private String cardId; - public void setId(String id) { this.id = id; diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/PropertyEvaluationModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/PropertyEvaluationModel.java new file mode 100644 index 000000000..5be1763fa --- /dev/null +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/PropertyEvaluationModel.java @@ -0,0 +1,169 @@ +package com.fangjia.open.model.weixin; + +import com.fangjia.open.model.BaseModel; + +/** + * ½¨ÐÐ×ⷿ¹Àֵ + * + * @author shenjian + * @since 2021/4/7 + */ +public class PropertyEvaluationModel extends BaseModel { + + /** + * ³ÇÊÐ + */ + private String cityName; + + /** + * ÇøÓò(а汾¹À¼Û) + **/ + private String district; + + /** + * СÇøÃû(а汾) + */ + private String name; + /** + * µØַ + */ + private String address; + + /** + * Ãæ»ý + */ + private double size; + + /** + * ËùÔÚ¥²ã + */ + private Integer floor; + + /** + * ×Ü¥²ã + */ + private Integer height; + + /** + * ÊÒÊý + */ + private Integer room; + + /** + * ÌüÊý + */ + private Integer hall; + + /** + * ÎÀÊý + */ + private Integer toilet; + + /** + * ³¯Ïò + */ + private String direction; + + /** + * װÐÞÇé¿ö + */ + private String fitment; + + @Override + public String getCityName() { + return cityName; + } + + @Override + public void setCityName(String cityName) { + this.cityName = cityName; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public double getSize() { + return size; + } + + public void setSize(double size) { + this.size = size; + } + + public Integer getFloor() { + return floor; + } + + public void setFloor(Integer floor) { + this.floor = floor; + } + + public Integer getHeight() { + return height; + } + + public void setHeight(Integer height) { + this.height = height; + } + + public Integer getRoom() { + return room; + } + + public void setRoom(Integer room) { + this.room = room; + } + + public Integer getHall() { + return hall; + } + + public void setHall(Integer hall) { + this.hall = hall; + } + + public Integer getToilet() { + return toilet; + } + + public void setToilet(Integer toilet) { + this.toilet = toilet; + } + + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public String getFitment() { + return fitment; + } + + public void setFitment(String fitment) { + this.fitment = fitment; + } +} diff --git a/projects/fangjia-open/src/main/webapp/ccbRent/detail.ftl b/projects/fangjia-open/src/main/webapp/ccbRent/detail.ftl new file mode 100644 index 000000000..e8371b8b7 --- /dev/null +++ b/projects/fangjia-open/src/main/webapp/ccbRent/detail.ftl @@ -0,0 +1,420 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + + 租金报告中心 + + + + + + + + + + + + +
+
+ 估值报告 + 下载 +
+
+
1 评估申明
+
建设银行遵循中立、客观、公正的原则,通过周密细致的测算,评估求得分析对象的房地产市场参考。
+
+
+
2 评估时间
+
+
+ 评估结果
+ 楼盘名称:
+ 楼盘地址:
+ 租金估值(RMB):元/月
+ 大写(人民币):
+
+
+
+
3 报告有效期
+
本报告在市场无较大波动的情况下,该评估价格在报告出具起三个月内有效。
+
+
+
4 房产状况
+
+ 详细地址:
+ 楼盘名称:
+ 室号:
+ 朝向:
+ 建筑面积:平米
+ 所在楼层: 层 总层数
+ 电梯配套:
+ 装修情况:
+ 建筑年代:
+
+
+
+
5 历史租金
+
+
+
+
6 已租房源
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
城市区域小区名成交价面积室厅装修成交日期
上海浦东区永泰花苑***8220普通装修2020-07-29
上海浦东区永泰花苑***8220普通装修2020-07-29
+
+
+
+
7 样本参考
+
+ + + + + + + + + + + + + + + + + +
城市区域小区名租金面积室厅装修成交日期
暂无数据
+
+
+
+
8 周边同类小区租金
+
+ + + + + + + + + + + + + + + + +
城市区域小区名平米租金室厅
暂无数据
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/projects/fangjia-open/src/main/webapp/ccbRent/index.ftl b/projects/fangjia-open/src/main/webapp/ccbRent/index.ftl index c6c4bd82c..15dbe47fd 100644 --- a/projects/fangjia-open/src/main/webapp/ccbRent/index.ftl +++ b/projects/fangjia-open/src/main/webapp/ccbRent/index.ftl @@ -43,6 +43,7 @@
地址:
+
(必填项)
@@ -163,17 +164,14 @@ return } $.ajax({ + // 注意需要加.. url: '../property/evaluateRent', data:$("#evaluateForm").serialize(), dataType:"json", type:"post", success:function(data){ - debugger - if(data.success){ - if(data.msg){ - $.toast(data.msg); - } - location.href = "report?address=" + data.address + "&totalPrice=" + data.totalPrice + if(data.code == 200){ + window.location.href = "report?address=" + data.result.address + "&totalPrice=" + data.result.totalPrice }else{ $.toast(data.msg); } diff --git a/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl b/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl index c744a9c22..fd67bedf9 100644 --- a/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl +++ b/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl @@ -18,21 +18,18 @@ -
- 您评估的地址:永泰路630弄66号 - 租金:6500元/月 -
+ <返回
  • 您评估的地址:
    - +
    @@ -42,7 +39,7 @@
    租金:
    - +
@@ -58,11 +55,7 @@ diff --git a/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js b/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js index 3dbbf8f02..53627a5fc 100644 --- a/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js +++ b/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js @@ -31,7 +31,7 @@ $(function () { $("#searchSpan ul").empty().append(content) return } - var template = '
  • {1}
    {2}
  • ' + var template = '
  • {1}
    {2}
  • ' var content = "" $(data).each(function () { var district = this @@ -50,7 +50,8 @@ $(function () { if ($("#t").val() == "b") { location.href = "districtDetail?id=" + id+"&city="+city } else if ($("#t").val() == "c") { - $('#districtSearch').val(addr) + $('#districtSearch').val(name) + $('input[name="address"]').val(addr) $('input[name="district"]').val(region) $("#searchSpan ul").empty() } else {