From 7acd9402fa11acfc5e7e94da80fc522ef09b8346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Tue, 6 Apr 2021 12:13:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E9=93=B6=E8=A1=8C=E7=A7=9F=E9=87=91=E6=8A=A5=E5=91=8A=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/weixin/CcbRentController.java | 126 ++++++++ .../java/com/fangjia/open/dto/CcbRentDto.java | 145 +++++++++ .../src/main/webapp/ccbRent/index.ftl | 303 ++++++++++++++++++ .../src/main/webapp/ccbRent/report.ftl | 69 ++++ .../main/webapp/static/js/autoCompletion.js | 24 +- 5 files changed, 662 insertions(+), 5 deletions(-) create mode 100644 projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/CcbRentController.java create mode 100644 projects/fangjia-open/src/main/java/com/fangjia/open/dto/CcbRentDto.java create mode 100644 projects/fangjia-open/src/main/webapp/ccbRent/index.ftl create mode 100644 projects/fangjia-open/src/main/webapp/ccbRent/report.ftl 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 new file mode 100644 index 000000000..6bb6ab92b --- /dev/null +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/CcbRentController.java @@ -0,0 +1,126 @@ +package com.fangjia.open.controllers.weixin; + +import com.fangjia.core.util.BeanUtils; +import com.fangjia.core.util.DataUtil; +import com.fangjia.core.util.GeocodeUtils; +import com.fangjia.dal.QueryParam; +import com.fangjia.dal.SdQuery; +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.service.api.AutoCompleteBo; +import com.fangjia.service.datastore.DistrictService; +import org.apache.commons.lang.StringUtils; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.TermQuery; +import org.sothis.web.mvc.annotation.Param; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * ½¨ÉèÒøÐÐ×â½ð¿ØÖÆÀà + * + * @author shenjian + * @since 2021/4/6 + */ +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(); + return result; + } + + public Object evaluateRentAction(CcbRentDto ccbRentDto, HttpServletRequest request) throws IllegalAccessException { + PropertyEvaluationModel evaluationModel = new PropertyEvaluationModel(); + BeanUtils.copyProperties(ccbRentDto, evaluationModel); + return propertyController.evaluateRentAction(evaluationModel, request); + } + + /** + * ·½·¨ͬDistrictController#suggestAction + */ + public Object suggestAction(@Param(name = "city") String city, @Param(name = "cat") String cat, @Param(name = "keyword") String keyword, + @Param(name = "limit") Integer limit, @Param(name="lat")Double lat, @Param(name="lng")Double lng) { + JsonModel model = new JsonModel(); + if (limit == null || limit > 100 || limit <= 0) { + limit = 10; + } + System.out.println(cat + "#" + city + "#" + keyword + "#" + limit + "#" + lng + "#" + lat); + List suggestList = getDistrictByKeyword(cat, city, keyword, limit, lng, lat); + model.setJsonModel(suggestList); + return model; + } + + private List getDistrictByKeyword(String cat, String city, String keyword, int limit, final Double lng, final Double lat) { + + keyword = DataUtil.escapeSolr(keyword); + if (StringUtils.isBlank(keyword) || keyword.length() >= 30) { + return null; + } + + List params = new ArrayList(); + params.add(new QueryParam("city", city)); + params.add(new QueryParam("category", cat)); + params.add(new QueryParam("visible", 0)); + + + BooleanQuery srQuery1 = new BooleanQuery(); + BooleanQuery nameQuery = new BooleanQuery(); + // nameQuery.add(new TermQuery(new Term("district_name", keyword)), BooleanClause.Occur.SHOULD); + // nameQuery.add(new TermQuery(new Term("alias_std", keyword)), BooleanClause.Occur.SHOULD); + // nameQuery.add(new TermQuery(new Term("address", keyword)), BooleanClause.Occur.SHOULD); + // nameQuery.add(new TermQuery(new Term("addr_alias_std", keyword)), BooleanClause.Occur.SHOULD); + nameQuery.add(new TermQuery(new Term("keyword", keyword)), BooleanClause.Occur.SHOULD); + //nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), BooleanClause.Occur.SHOULD);//Õâ¸öÖØҪ£¬Òòseaweed²»֧³ÖģºýËÑË÷£¬µ±ÊäÈë"ÖÐԶÁ½"ÐèÓô˽øÐÐËÑË÷ + srQuery1.add(nameQuery, BooleanClause.Occur.SHOULD); + if(lat != null && lng != null && lat != 0 && lng != 0){ + Map geo = GeocodeUtils.geoconvBaiduToGoogle(lng, lat); + SdQuery sdQuery = new SdQuery(); + sdQuery.setPoint(geo.get("lat") + "," + geo.get("lng")); + sdQuery.setField("lat_lng"); + sdQuery.setDistance("500"); + params.add(new QueryParam(QueryParam.SD_PARAM_NAME, sdQuery)); + } + params.add(new QueryParam("$sr", new SrQuery(srQuery1))); + List districts = districtService.findAllByParams(params, 0, limit, new String[]{"region", "name", "address", "addrAlias","id"}); + List ret = new ArrayList(districts.size()); + for (District district : districts) { + AutoCompleteBo bo = new AutoCompleteBo(); + bo.setKeyword(district.getName()); + bo.setVal(district.getName()); + bo.setDesc(district.getAddress()); + bo.setRegion(district.getRegion()); + bo.setId(district.getId()); + ret.add(bo); + } + return ret; + } + + @Autowired + 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/dto/CcbRentDto.java b/projects/fangjia-open/src/main/java/com/fangjia/open/dto/CcbRentDto.java new file mode 100644 index 000000000..55ff07adc --- /dev/null +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/dto/CcbRentDto.java @@ -0,0 +1,145 @@ +package com.fangjia.open.dto; + +import groovy.transform.builder.Builder; + +import java.io.Serializable; + +/** + * ½¨ÐÐ×â½ðdto + * + * @author shenjian + * @since 2021/4/6 + */ +@Builder +public class CcbRentDto implements Serializable { + + private String city; + // ÇøÓò + private String district; + // СÇøÃû + private String name; + // Ãæ»ý + private Double size; + // °뾶 + private Integer radius; + // ÊÒ + private Integer room; + // Ìü + private Integer hall; + // ÎÀ + private Integer toilet; + // ËùÔÚ¥²ã + private Integer floor; + // ×Ü¥²ã + private Integer height; + // ³¯Ïò + private String direction; + // װÐÞÇé¿ö + private String fitment; + // µçÌÝÅäÌ× + private Boolean hasLift; + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + 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 Integer getRadius() { + return radius; + } + + public void setRadius(Integer radius) { + this.radius = radius; + } + + 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 Integer getFloor() { + return floor; + } + + public void setFloor(Integer floor) { + this.floor = floor; + } + + 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; + } + + public Boolean getHasLift() { + return hasLift; + } + + public void setHasLift(Boolean hasLift) { + this.hasLift = hasLift; + } + + public Double getSize() { + return size; + } + + public void setSize(Double size) { + this.size = size; + } + + public Integer getHeight() { + return height; + } + + public void setHeight(Integer height) { + this.height = height; + } +} diff --git a/projects/fangjia-open/src/main/webapp/ccbRent/index.ftl b/projects/fangjia-open/src/main/webapp/ccbRent/index.ftl new file mode 100644 index 000000000..c6c4bd82c --- /dev/null +++ b/projects/fangjia-open/src/main/webapp/ccbRent/index.ftl @@ -0,0 +1,303 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + + 租金评估 + + + + + + + + + + + +
+
+ +
+
+
+
    +
  • +
    +
    + + + + +
    城市:上海
    +
    +
    +
  • +
  • +
    +
    +
    地址:
    +
    + +
    +
    (必填项)
    +
    +
    +
    +
      +
      +
    • +
    • +
      +
      +
      面积:
      +
      + +
      +
      (必填项)
      +
      +
      +
    • +
    • +
      +
      +
      +
      户型:
      + + + +

      + 1室    0厅    0卫 +

      +
      +
      +
      +
    • +
    • +
      +
      +
      楼层:
      +
      + +
      +
      (必填项)
      +
      +
      +
    • +
    • +
      +
      +
      总楼层:
      +
      + +
      +
      (必填项)
      +
      +
      +
    • +
    + +
    继续填写,租金更加精准↓
    +
    收起
    +
    + + +
    +
    + + + + + + + + + + + \ No newline at end of file diff --git a/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl b/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl new file mode 100644 index 000000000..c744a9c22 --- /dev/null +++ b/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl @@ -0,0 +1,69 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + + 租金报告中心 + + + + + + + + + + + + +
    + 您评估的地址:永泰路630弄66号 + 租金:6500元/月 +
    +
    +
    +
    +
    +
      +
    • +
      +
      +
      您评估的地址:
      +
      + +
      +
      +
      +
    • +
    • +
      +
      +
      租金:
      +
      + +
      +
      +
      +
    • +
    +
    + +
    +
    + + + + + + + \ No newline at end of file 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 b41b4d00e..3dbbf8f02 100644 --- a/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js +++ b/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js @@ -1,10 +1,15 @@ /**小区搜索功能js*/ $(function () { - resumeHistory() + if ($("#t").val() != "c") { + resumeHistory() + } /**小区自动完成*/ $("#districtSearch").on('click input',function () { var city = $("#cityName").val() if($.trim($("#districtSearch").val()) == ""){ + if ($("#t").val() == "c") { + return false; + } resumeHistory() return; } @@ -21,26 +26,33 @@ $(function () { }, dataType: "json", success: function (data) { - if(data.length == 0){ + if(data && data.length == 0){ var content = '
  • 未搜索到小区
  • ' $("#searchSpan ul").empty().append(content) return } - var template = '
  • {1}
    {2}
  • ' + var template = '
  • {1}
    {2}
  • ' var content = "" $(data).each(function () { var district = this - content = content + template.template(district.id, district.keyword, district.desc) + content = content + template.template(district.id, district.keyword, district.desc, district.region) }) $("#searchSpan ul").empty().append(content).find("li>a.item-link").click(function () { var li = $(this).parent(); var addr = $(li).attr("data-addr"); var id = $(li).attr("data-id")+""; var name = $(li).attr("data-name"); + var region = $(li).attr("data-region"); var isCompany=$("#t").val(); - saveCookie(id, name, addr) + if ($("#t").val() != "c") { + saveCookie(id, name, addr) + } if ($("#t").val() == "b") { location.href = "districtDetail?id=" + id+"&city="+city + } else if ($("#t").val() == "c") { + $('#districtSearch').val(addr) + $('input[name="district"]').val(region) + $("#searchSpan ul").empty() } else { location.href = "../weiXinEvaluation/input?id=" + id } @@ -98,6 +110,8 @@ function resumeHistory() { var id = $(li).attr("data-id") if ($("#t").val() == "b") { location.href = "districtDetail?id=" + id+"&city="+city + } else if ($("#t").val() == "c") { + location.href = "../ccbRent/index?city="+city } else { location.href = "../weiXinEvaluation/input?id=" + id } 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 2/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E7=BB=93=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 { From a712d0765fd0860379849f208fa5bc0fdfad9726 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 3/3] =?UTF-8?q?=E8=B0=83=E9=80=9A=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E8=AF=84=E4=BC=B0=E7=BB=93=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 | 23 +- .../open/model/weixin/EvaluationModel.java | 1 - .../model/weixin/PropertyEvaluationModel.java | 169 +++++++ .../src/main/webapp/ccbRent/detail.ftl | 436 ++++++++++++++++++ .../src/main/webapp/ccbRent/index.ftl | 72 ++- .../src/main/webapp/ccbRent/report.ftl | 23 +- .../main/webapp/static/js/autoCompletion.js | 5 +- 8 files changed, 702 insertions(+), 47 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..867a9d535 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,19 @@ 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) { + return result; } /** @@ -118,9 +116,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..e1d2cab9f --- /dev/null +++ b/projects/fangjia-open/src/main/webapp/ccbRent/detail.ftl @@ -0,0 +1,436 @@ +<#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..99701b27e 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 @@
    地址:
    +
    (必填项)
    @@ -157,23 +158,75 @@ diff --git a/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl b/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl index c744a9c22..15209e55a 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 @@
      租金:
      - +
    @@ -52,17 +49,23 @@ +
    + 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 {