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 d808deb30..f7b2eef7e 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; @@ -60,16 +61,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; @@ -5055,8 +5046,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 new file mode 100644 index 000000000..867a9d535 --- /dev/null +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/CcbRentController.java @@ -0,0 +1,119 @@ +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.model.BaseModel; +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; +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.HashMap; +import java.util.List; +import java.util.Map; + +/** + * ½¨ÉèÒøÐÐ×â½ð¿ØÖÆÀà + * + * @author shenjian + * @since 2021/4/6 + */ +public class CcbRentController { + + private DistrictService districtService; + + public Object indexAction(BaseModel result) { + return result; + } + + 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 detailAction(PropertyEvaluationModel result) { + return result; + } + + /** + * ·½·¨ͬ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; + } +} 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/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 new file mode 100644 index 000000000..99701b27e --- /dev/null +++ b/projects/fangjia-open/src/main/webapp/ccbRent/index.ftl @@ -0,0 +1,361 @@ +<#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..15209e55a --- /dev/null +++ b/projects/fangjia-open/src/main/webapp/ccbRent/report.ftl @@ -0,0 +1,72 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + + 租金报告中心 + + + + + + + + + + + + +
    +
    +
    +
    + <返回 +
      +
    • +
      +
      +
      您评估的地址:
      +
      + +
      +
      +
      +
    • +
    • +
      +
      +
      租金:
      +
      + +
      +
      +
      +
    • +
    +
    + +
    +
    +
    + + + + + + + + \ 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..53627a5fc 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,34 @@ $(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(name) + $('input[name="address"]').val(addr) + $('input[name="district"]').val(region) + $("#searchSpan ul").empty() } else { location.href = "../weiXinEvaluation/input?id=" + id } @@ -98,6 +111,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 }