Merge branch 'open_gj'
This commit is contained in:
@@ -312,25 +312,6 @@ public class DataUtil {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密图片url
|
||||
*
|
||||
* @param u
|
||||
* @param s
|
||||
* @param t
|
||||
* @return
|
||||
*/
|
||||
public static String encodePicUrl(String u, String s, String t) {
|
||||
if (StringUtils.isBlank(u)) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
try {
|
||||
return SecurityUtil.encode("u=" + URLEncoder.encode(u, "UTF-8") + "&s=" + s + "&t=" + t);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return SecurityUtil.encode("u=" + u + "&s=" + s + "&t=" + t);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 把字符串以16进制数值显示出来
|
||||
*
|
||||
@@ -1805,6 +1786,25 @@ public class DataUtil {
|
||||
return b2.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密图片url
|
||||
*
|
||||
* @param u
|
||||
* @param s
|
||||
* @param t
|
||||
* @return
|
||||
*/
|
||||
public static String encodePicUrl(String u, String s, String t) {
|
||||
if (StringUtils.isBlank(u)) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
try {
|
||||
return SecurityUtil.encode("u=" + URLEncoder.encode(u, "UTF-8") + "&s=" + s + "&t=" + t);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return SecurityUtil.encode("u=" + u + "&s=" + s + "&t=" + t);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(getFirstChar("文裕花园"));
|
||||
System.out.println(getFirstChar("文怡花园"));
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<dependency>
|
||||
<groupId>org.sothis</groupId>
|
||||
<artifactId>sothis-core</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDao;
|
||||
import com.fangjia.dal.mongo.model.DistrictRoomSqmetreRent;
|
||||
|
||||
|
||||
public interface DistrictRoomSqmetreRentDao extends MongoDao<DistrictRoomSqmetreRent> {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.model.DistrictRoomSqmetreRent;
|
||||
import com.fangjia.dal.mongo.model.bkoff.DistrictRentCoverage;
|
||||
|
||||
public class DistrictRoomSqmetreRentDaoImpl extends MongoDaoImpl<DistrictRoomSqmetreRent> implements DistrictRoomSqmetreRentDao{
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDao;
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.model.RentDealPrice;
|
||||
|
||||
public interface RentDealPriceDao extends MongoDao<RentDealPrice> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.model.RentDealPrice;
|
||||
|
||||
public class RentDealPriceDaoImpl extends MongoDaoImpl<RentDealPrice> implements RentDealPriceDao{
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package com.fangjia.dal.mongo.model;
|
||||
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "fangjia.district_room_sqmetre_rent")
|
||||
public class DistrictRoomSqmetreRent implements MongoEntity {
|
||||
|
||||
private String id;
|
||||
private String city;
|
||||
private String region;
|
||||
private String block;
|
||||
private String districtName;
|
||||
private int avgPrice;
|
||||
private String estateType;
|
||||
private Integer houseType;
|
||||
private int markup;
|
||||
private Date creationDate;
|
||||
private int sDate;
|
||||
|
||||
@Override
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@Column(name = "_id", unique = true, nullable = false)
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Column(name = "city")
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
@Column(name = "region")
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
@Column(name = "block")
|
||||
public String getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
public void setBlock(String block) {
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
@Column(name = "district_name")
|
||||
public String getDistrictName() {
|
||||
return districtName;
|
||||
}
|
||||
|
||||
public void setDistrictName(String districtName) {
|
||||
this.districtName = districtName;
|
||||
}
|
||||
|
||||
@Column(name = "avg_price")
|
||||
public int getAvgPrice() {
|
||||
return avgPrice;
|
||||
}
|
||||
|
||||
public void setAvgPrice(int avgPrice) {
|
||||
this.avgPrice = avgPrice;
|
||||
}
|
||||
|
||||
@Column(name = "estate_type")
|
||||
public String getEstateType() {
|
||||
return estateType;
|
||||
}
|
||||
|
||||
public void setEstateType(String estateType) {
|
||||
this.estateType = estateType;
|
||||
}
|
||||
|
||||
@Column(name = "house_type")
|
||||
public Integer getHouseType() {
|
||||
return houseType;
|
||||
}
|
||||
|
||||
public void setHouseType(Integer houseType) {
|
||||
this.houseType = houseType;
|
||||
}
|
||||
|
||||
@Column(name = "markup")
|
||||
public int getMarkup() {
|
||||
return markup;
|
||||
}
|
||||
|
||||
public void setMarkup(int markup) {
|
||||
this.markup = markup;
|
||||
}
|
||||
|
||||
@Column(name = "c_date")
|
||||
public Date getCreationDate() {
|
||||
return creationDate;
|
||||
}
|
||||
|
||||
public void setCreationDate(Date creationDate) {
|
||||
this.creationDate = creationDate;
|
||||
}
|
||||
|
||||
@Column(name = "s_date")
|
||||
public int getsDate() {
|
||||
return sDate;
|
||||
}
|
||||
|
||||
public void setsDate(int sDate) {
|
||||
this.sDate = sDate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package com.fangjia.dal.mongo.model;
|
||||
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "fangjia.rent_deal_price")
|
||||
public class RentDealPrice implements MongoEntity {
|
||||
|
||||
private String id;
|
||||
private String city;
|
||||
private String region;
|
||||
private String districtName;
|
||||
private Double area;
|
||||
private Integer totalPrice;
|
||||
private Integer avgPrice;
|
||||
private String source;
|
||||
private Integer room;
|
||||
private Integer hall;
|
||||
private Integer toilet;
|
||||
private String fitment;
|
||||
private String url;
|
||||
private String direction;
|
||||
private Integer height;
|
||||
private Date modificationDate;
|
||||
private Date tradeDate;
|
||||
private Date createDate;
|
||||
|
||||
|
||||
@Override
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@Column(name = "_id", unique = true, nullable = false)
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@Column(name = "city")
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
@Column(name = "region")
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
@Column(name = "district_name")
|
||||
public String getDistrictName() {
|
||||
return districtName;
|
||||
}
|
||||
|
||||
public void setDistrictName(String districtName) {
|
||||
this.districtName = districtName;
|
||||
}
|
||||
|
||||
@Column(name = "area")
|
||||
public Double getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(Double area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
@Column(name = "total_price")
|
||||
public Integer getTotalPrice() {
|
||||
return totalPrice;
|
||||
}
|
||||
|
||||
public void setTotalPrice(Integer totalPrice) {
|
||||
this.totalPrice = totalPrice;
|
||||
}
|
||||
|
||||
@Column(name = "avg_price")
|
||||
public Integer getAvgPrice() {
|
||||
return avgPrice;
|
||||
}
|
||||
|
||||
public void setAvgPrice(Integer avgPrice) {
|
||||
this.avgPrice = avgPrice;
|
||||
}
|
||||
|
||||
@Column(name = "source")
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
@Column(name = "room")
|
||||
public Integer getRoom() {
|
||||
return room;
|
||||
}
|
||||
|
||||
public void setRoom(Integer room) {
|
||||
this.room = room;
|
||||
}
|
||||
|
||||
@Column(name = "hall")
|
||||
public Integer getHall() {
|
||||
return hall;
|
||||
}
|
||||
|
||||
public void setHall(Integer hall) {
|
||||
this.hall = hall;
|
||||
}
|
||||
|
||||
@Column(name = "toilet")
|
||||
public Integer getToilet() {
|
||||
return toilet;
|
||||
}
|
||||
|
||||
public void setToilet(Integer toilet) {
|
||||
this.toilet = toilet;
|
||||
}
|
||||
|
||||
@Column(name = "fitment")
|
||||
public String getFitment() {
|
||||
return fitment;
|
||||
}
|
||||
|
||||
public void setFitment(String fitment) {
|
||||
this.fitment = fitment;
|
||||
}
|
||||
|
||||
@Column(name = "url")
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Column(name = "direction")
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
|
||||
public void setDirection(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
@Column(name = "height")
|
||||
public Integer getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(Integer height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
|
||||
@Column(name = "trade_date")
|
||||
public Date getTradeDate() {
|
||||
return tradeDate;
|
||||
}
|
||||
|
||||
public void setTradeDate(Date tradeDate) {
|
||||
this.tradeDate = tradeDate;
|
||||
}
|
||||
|
||||
@Column(name = "create_date")
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
@Column(name = "m_date")
|
||||
public Date getModificationDate() {
|
||||
return modificationDate;
|
||||
}
|
||||
|
||||
public void setModificationDate(Date modificationDate) {
|
||||
this.modificationDate = modificationDate;
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,10 @@ public interface SeawaterDao extends com.fangjia.dal.SeawaterDao<Seawater> {
|
||||
Integer room, String root,String table);
|
||||
|
||||
Seawater findByIdFromEs(String id,String table);
|
||||
|
||||
List<Seawater> findSeawatersFromEs(String category, String city, String region, String name,
|
||||
List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate, Integer room, String root,
|
||||
String sort, boolean order, int start, int limit, String[] keys,String table);
|
||||
|
||||
|
||||
List<Seawater> findSeawatersFromEs(String category, String city, String region, String name, List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate,
|
||||
Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root, String sort, boolean order, int start, int limit , String table);
|
||||
|
||||
List<Seawater> findHouses(String city, String region, List<String> alias, Integer minPrice, Integer maxPrice, Integer limit);
|
||||
|
||||
|
||||
+39
-9
@@ -29,7 +29,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
@Override
|
||||
public Seawater findByIdFromEs(String id,String table) {
|
||||
Seawater seawater = null;
|
||||
List<JSONObject> jsonList = queryList(id,null,null,null,null,null,null,null,null,null,null,null,false,-1,-1,table);
|
||||
List<JSONObject> jsonList = queryList(id,null,null,null,null,null,null,null,null, null, null, null, null, null,null,null,false,-1,-1,table);
|
||||
if(jsonList == null){
|
||||
return null;
|
||||
}else{
|
||||
@@ -42,11 +42,9 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Seawater> findSeawatersFromEs(String category, String city, String region, String name,
|
||||
List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate, Integer room, String root,
|
||||
String sort, boolean order, int start, int limit, String[] keys,String table) {
|
||||
public List<Seawater> findSeawatersFromEs(String category, String city, String region, String name, List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root, String sort, boolean order, int start, int limit, String table) {
|
||||
List<Seawater> seawaterList= new ArrayList<Seawater>();
|
||||
List<JSONObject> jsonList = queryList(null,category,city,region,name,alias,regionAlias,startDate,endDate,room,root,sort,order,start,limit,table);
|
||||
List<JSONObject> jsonList = queryList(null,category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,sort,order,start,limit,table);
|
||||
if(jsonList == null){
|
||||
return null;
|
||||
}else{
|
||||
@@ -55,6 +53,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
return seawaterList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Seawater> findHouses(String city, String region, List<String> alias, Integer minPrice, Integer maxPrice, Integer limit) {
|
||||
JSONObject reqBody = new JSONObject();
|
||||
@@ -200,7 +199,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
}
|
||||
|
||||
private JSONObject query(String id,String category, String city, String region, String name, List<String> alias,
|
||||
List<String> regionAlias, Integer startDate, Integer endDate, Integer room, String root,String sort, boolean order, int start, int limit,String table){
|
||||
List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root,String sort, boolean order, int start, int limit,String table){
|
||||
long time1 = System.currentTimeMillis();
|
||||
JSONObject reqBody = new JSONObject();
|
||||
JSONObject q = new JSONObject();
|
||||
@@ -287,6 +286,37 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
temp.put("range", param);
|
||||
jsonList.add(temp);
|
||||
}
|
||||
|
||||
|
||||
if(startArea != null || endArea != null){
|
||||
JSONObject param = new JSONObject();
|
||||
JSONObject temp = new JSONObject();
|
||||
JSONObject temp2 = new JSONObject();
|
||||
if(startArea != null){
|
||||
temp2.put("gte", startArea);
|
||||
}
|
||||
if(endArea != null){
|
||||
temp2.put("lte", endArea);
|
||||
}
|
||||
param.put("area", temp2);
|
||||
temp.put("range", param);
|
||||
jsonList.add(temp);
|
||||
}
|
||||
|
||||
if(startPrice != null || endPrice != null){
|
||||
JSONObject param = new JSONObject();
|
||||
JSONObject temp = new JSONObject();
|
||||
JSONObject temp2 = new JSONObject();
|
||||
if(startPrice != null){
|
||||
temp2.put("gte", startPrice);
|
||||
}
|
||||
if(endPrice != null){
|
||||
temp2.put("lte", endPrice);
|
||||
}
|
||||
param.put("total_price", temp2);
|
||||
temp.put("range", param);
|
||||
jsonList.add(temp);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(sort)){
|
||||
JSONObject jsonOrder = new JSONObject();
|
||||
@@ -331,8 +361,8 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
}
|
||||
|
||||
private List<JSONObject> queryList(String id,String category, String city, String region, String name, List<String> alias,
|
||||
List<String> regionAlias, Integer startDate, Integer endDate, Integer room, String root,String sort, boolean order, int start, int limit,String table){
|
||||
JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate,room,root,sort,order,start,limit,table);
|
||||
List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root,String sort, boolean order, int start, int limit,String table){
|
||||
JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,sort,order,start,limit,table);
|
||||
if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("hits")){
|
||||
return null;
|
||||
}
|
||||
@@ -347,7 +377,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
|
||||
private int queryCount(String id,String category, String city, String region, String name, List<String> alias,
|
||||
List<String> regionAlias, Integer startDate, Integer endDate, Integer room, String root,String sort, boolean order, int start, int limit,String table){
|
||||
JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate,room,root,sort,order,start,limit,table);
|
||||
JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate,null, null, null, null, room,root,sort,order,start,limit,table);
|
||||
if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("total")){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -147,5 +147,23 @@
|
||||
<version>1.0.0</version>
|
||||
<classifier>jdk18</classifier>
|
||||
</dependency>
|
||||
<!-- html转pdf -->
|
||||
<dependency>
|
||||
<groupId>org.xhtmlrenderer</groupId>
|
||||
<artifactId>core-renderer</artifactId>
|
||||
<version>R8</version>
|
||||
</dependency>
|
||||
<!-- 绘制折线图等 -->
|
||||
<dependency>
|
||||
<groupId>org.jfree</groupId>
|
||||
<artifactId>jfreechart</artifactId>
|
||||
<version>1.5.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sothis</groupId>
|
||||
<artifactId>sothis-core</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
+332
-41
@@ -28,11 +28,16 @@ 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;
|
||||
import com.fangjia.dal.seawater.model.Seawater;
|
||||
import com.fangjia.open.dto.*;
|
||||
import com.fangjia.service.district.*;
|
||||
import com.fangjia.service.mongo.fangjia.*;
|
||||
import com.fangjia.service.open.*;
|
||||
import com.fangjia.service.util.DistrictScoreUtil;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@@ -56,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;
|
||||
@@ -81,21 +76,6 @@ import com.fangjia.dal.sql.model.FjtEvaluation;
|
||||
import com.fangjia.dal.sql.model.User;
|
||||
import com.fangjia.open.APIConstant;
|
||||
import com.fangjia.open.FangjiaApiUtil;
|
||||
import com.fangjia.open.dto.AroundDto;
|
||||
import com.fangjia.open.dto.BuildingDto;
|
||||
import com.fangjia.open.dto.DistrictAnalysisDto;
|
||||
import com.fangjia.open.dto.DistrictInfoDto;
|
||||
import com.fangjia.open.dto.FloorPlanDto;
|
||||
import com.fangjia.open.dto.HouseAuctionDetailDto;
|
||||
import com.fangjia.open.dto.HouseAuctionDto;
|
||||
import com.fangjia.open.dto.HouseDealPriceDetailDto;
|
||||
import com.fangjia.open.dto.HouseDealPriceDto;
|
||||
import com.fangjia.open.dto.HouseEvaluateNumDto;
|
||||
import com.fangjia.open.dto.PropertyDto;
|
||||
import com.fangjia.open.dto.RoomDto;
|
||||
import com.fangjia.open.dto.StationDto;
|
||||
import com.fangjia.open.dto.UnitNumberDto;
|
||||
import com.fangjia.open.dto.UniversalDto;
|
||||
import com.fangjia.open.interceptors.AuthenticationBean;
|
||||
import com.fangjia.open.interceptors.Authority;
|
||||
import com.fangjia.open.interceptors.Role;
|
||||
@@ -137,24 +117,9 @@ import com.fangjia.service.datastore.FieldFilterService;
|
||||
import com.fangjia.service.datastore.HouseService;
|
||||
import com.fangjia.service.datastore.NoHouseDistrictService;
|
||||
import com.fangjia.service.datastore.OpenApiLogService;
|
||||
import com.fangjia.service.district.DistrictStatRentService;
|
||||
import com.fangjia.service.district.DistrictStatService;
|
||||
import com.fangjia.service.mongo.bkoff.HouseAuctionService;
|
||||
import com.fangjia.service.mongo.bkoff.HouseLoudongService;
|
||||
import com.fangjia.service.mongo.bkoff.LoudongService;
|
||||
import com.fangjia.service.mongo.fangjia.AddressMatchLogService;
|
||||
import com.fangjia.service.mongo.fangjia.AverageAnalyService;
|
||||
import com.fangjia.service.mongo.fangjia.AverageStatisticsService;
|
||||
import com.fangjia.service.mongo.fangjia.BatchEvaluateService;
|
||||
import com.fangjia.service.mongo.fangjia.BizShopService;
|
||||
import com.fangjia.service.mongo.fangjia.BusStationService;
|
||||
import com.fangjia.service.mongo.fangjia.CityHotService;
|
||||
import com.fangjia.service.mongo.fangjia.DealPriceService;
|
||||
import com.fangjia.service.mongo.fangjia.DistrictAttentionRankService;
|
||||
import com.fangjia.service.mongo.fangjia.DistrictHotService;
|
||||
import com.fangjia.service.mongo.fangjia.DistrictHouseResourceStatService;
|
||||
import com.fangjia.service.mongo.fangjia.NetworkPriceService;
|
||||
import com.fangjia.service.mongo.fangjia.ServerAreaService;
|
||||
import com.fangjia.service.sql.ApiUserService;
|
||||
import com.fangjia.service.sql.FjtEvaluationService;
|
||||
import com.fangjia.service.sql.UserService;
|
||||
@@ -166,7 +131,7 @@ import com.google.common.collect.Sets;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBObject;
|
||||
|
||||
@Authority(role = Role.USER)
|
||||
//@Authority(role = Role.USER)
|
||||
public class PropertyController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PropertyController.class);
|
||||
@@ -208,6 +173,8 @@ public class PropertyController {
|
||||
private FangjiaOfficialAreaService fangjiaOfficialAreaService;
|
||||
private RegionAnaDataService regionAnaDataService;
|
||||
private SeawaterDao seawaterDao;
|
||||
private SeawaterService seawaterService;
|
||||
private SqmetreRentService sqmetreRentService;
|
||||
|
||||
private FileDao fileDao = FileDao.getInstance();
|
||||
private static final int DEFAULT_PAGE_SIZE = 20;
|
||||
@@ -217,6 +184,10 @@ public class PropertyController {
|
||||
|
||||
private AutoCompleteService autoCompleteService;
|
||||
|
||||
|
||||
private DistrictRoomSqmetreRentService districtRoomSqmetreRentService;
|
||||
private RentDealPriceService rentDealPriceService;
|
||||
|
||||
private static final int EVALUATE_SHOW_DETAIL = 1;
|
||||
private static final Map<String, String> PROPERTY_TYPES = new HashMap<String, String>() {
|
||||
{
|
||||
@@ -4987,6 +4958,310 @@ public class PropertyController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
/***
|
||||
* 小区租金估值报告
|
||||
* @param model
|
||||
* @param request
|
||||
* @return
|
||||
* @throws NumberFormatException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
public Object rentReportAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
|
||||
|| StringUtils.isBlank(model.getDistrict()) || model.getSize() <= 0) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市,区域,小区名,面积(size)为必填项"));
|
||||
return mav;
|
||||
}
|
||||
if (model.getCity().endsWith("市")) {
|
||||
model.setCity(model.getCity().replaceAll("市$", ""));
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||
Date calDate = null;
|
||||
try {
|
||||
calDate = org.apache.commons.lang.time.DateUtils.parseDate(request.getParameter("calDate"), new String[] { "yyyy-MM-dd" });
|
||||
} catch (ParseException e) {
|
||||
|
||||
}
|
||||
if (calDate == null) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("calDate:数据类型不合法"));
|
||||
return mav;
|
||||
} else {
|
||||
model.setCalDate(calDate);
|
||||
}
|
||||
}
|
||||
/* 先到CPDB库中查找小区 */
|
||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
|
||||
"district");
|
||||
if (district == null) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||
return mav;
|
||||
}
|
||||
model.setName(district.getName());
|
||||
|
||||
|
||||
if (model.getMaxFloor() != null && (model.getMaxFloor() <= 0 || model.getMaxFloor() > 59)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("maxFloor取值非法,正确范围[1,60)"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
if (model.getFloor() != null && (model.getFloor() <= 0 || model.getFloor() > 59)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("floor取值非法,正确范围[1,60)"));
|
||||
return mav;
|
||||
}
|
||||
if (model.getMaxFloor() != null && model.getFloor() != null && model.getFloor() > model.getMaxFloor()) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("所在楼层不能大于总楼层"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
model.setRegion(district.getRegion());
|
||||
model.setDistrictName(district.getName());
|
||||
if (StringUtils.isBlank(model.getPropertyType())) {
|
||||
if (district.getEstateType2() != null && district.getEstateType2().contains("别墅")) {
|
||||
model.setPropertyType("1");
|
||||
}
|
||||
}
|
||||
|
||||
if (model.getCalDate() != null) {
|
||||
if (new Date().before(model.getCalDate())) {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||
} else {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(model.getCalDate()));
|
||||
}
|
||||
} else {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||
}
|
||||
|
||||
Evaluation evaluation = buildEvaluation(model, request);
|
||||
evaluation.setSource("api_property_evaluate_rent");
|
||||
evaluation = evaluationService.evaluateRent(district, evaluation, model.getCalDate());
|
||||
|
||||
|
||||
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0) {
|
||||
evaluation.setAvgPrice((int)(evaluation.getTotalPrice()/evaluation.getArea()));
|
||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||
districtPriceMap.put("city", district.getCity());
|
||||
districtPriceMap.put("district", district.getRegion());
|
||||
districtPriceMap.put("name", district.getName());
|
||||
districtPriceMap.put("address", district.getAddress());
|
||||
districtPriceMap.put("totalPrice", evaluation.getTotalPrice());
|
||||
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);
|
||||
|
||||
//周边相似小区
|
||||
if (null == model.getRadius()) {// 设置默认值
|
||||
model.setRadius(1000);
|
||||
}
|
||||
String[] fields = { "city", "region", "name", "estateType2", "id","finishBuildingDate"};
|
||||
List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
|
||||
//按条件过滤相似小区
|
||||
Integer buildYear = null;
|
||||
List<District> districts = null;
|
||||
if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
|
||||
buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||
if(buildYear!=null){
|
||||
districts = new ArrayList<District>();
|
||||
int startYear = buildYear -7;
|
||||
int endYear = buildYear + 7;
|
||||
for(District dist : allDistricts){
|
||||
if(StringUtils.isNotBlank(dist.getFinishBuildingDate())){
|
||||
int simlarDistYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||
if(simlarDistYear>=startYear && simlarDistYear<=endYear && StringUtils.isNotBlank(district.getEstateType2()) && StringUtils.isNotBlank(dist.getEstateType2()) && district.getEstateType2().equals(dist.getEstateType2())){
|
||||
districts.add(dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//相似房源
|
||||
Double startArea = model.getSize() - model.getSize()*0.1;
|
||||
Double endArea = model.getSize() + model.getSize()*0.1;
|
||||
Integer startDate = Integer.parseInt(org.apache.tools.ant.util.DateUtils.format(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||
List<Seawater> houses = seawaterService.findSeawatersFromEs2("rent", district.getCity(), district.getRegion(), district.getName(), null, null, startDate, null,
|
||||
startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
||||
//无评估小区房源用周边相似小区的房源
|
||||
if(null == houses || houses.size()==0){
|
||||
for (District dist : districts) {
|
||||
houses = seawaterService.findSeawatersFromEs2("rent", dist.getCity(), dist.getRegion(), dist.getName(), null, null, startDate, null,
|
||||
startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
||||
if(houses!=null && houses.size()>0){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
districtPriceMap.put("houses", houses);
|
||||
|
||||
//周边相似小区租金
|
||||
Integer room = null;
|
||||
if(model.getRoom()!=0){
|
||||
room = model.getRoom();
|
||||
}else{
|
||||
room = houseService.getDistrictRoomType((float)model.getSize());
|
||||
}
|
||||
if (null != districts) {
|
||||
if (null != room) {
|
||||
List<DistrictHouseDtao> dtos = new ArrayList<DistrictHouseDtao>();
|
||||
Date weekend = DateUtil.getFirstDayOfWeek(new Date());
|
||||
for (District dist : districts) {
|
||||
|
||||
List<DistrictRoomSqmetreRent> districtRoomSqmetreRents = districtRoomSqmetreRentService.findDistrictRoomSqmetreRents(dist, 1, room);
|
||||
|
||||
///List<DistrictStatRent> districtStatRents = districtStatRentService.findLatestDistrictStatRent(dist, 1, room);
|
||||
if (null != districtRoomSqmetreRents && districtRoomSqmetreRents.size() > 0) {
|
||||
DistrictRoomSqmetreRent districtRoomSqmetreRent = districtRoomSqmetreRents.get(0);
|
||||
if (districtRoomSqmetreRent.getAvgPrice() > 0) {
|
||||
|
||||
int startSqPrice = (int)(evaluation.getAvgPrice() - evaluation.getAvgPrice()*0.1);
|
||||
int endSqPrice = (int)(evaluation.getAvgPrice() + evaluation.getAvgPrice()*0.1);
|
||||
// SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(dist.getCity(), dist.getRegion(), dist.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
||||
if(districtRoomSqmetreRent.getAvgPrice()>=startSqPrice && districtRoomSqmetreRent.getAvgPrice()<=endSqPrice){
|
||||
DistrictHouseDtao dto = new DistrictHouseDtao();
|
||||
dto.setCity(dist.getCity());
|
||||
dto.setRegion(dist.getRegion());
|
||||
dto.setDistrictName(dist.getName());
|
||||
dto.setSqAvgPrice(districtRoomSqmetreRent.getAvgPrice());
|
||||
dto.setRoom(room);
|
||||
dtos.add(dto);
|
||||
if(dtos.size()>=5){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
districtPriceMap.put("districts", dtos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//近一年户型租金走势
|
||||
Map<String, Object> trendsMap = districtRoomSqmetreRentService.getRentTrends(district.getCity(), district.getRegion(), district.getName(), room, -12);
|
||||
// Map<String, Object> trendsMap = districtStatRentService.getRentTrend(district.getCity(), district.getRegion(), district.getDistrictName(), -12);
|
||||
districtPriceMap.put("trends", trendsMap);
|
||||
|
||||
|
||||
//成交的租房房源
|
||||
List<RentDealPrice> rentTrades = rentDealPriceService.getRentDealPrices(district.getCity(), district.getRegion(), district.getName(), 5);
|
||||
districtPriceMap.put("trades", rentTrades);
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
||||
return mav;
|
||||
} else {
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的租金估价").markNoData());
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Object evaluateRentAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
|
||||
|| StringUtils.isBlank(model.getDistrict()) || model.getSize() <= 0) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市,区域,小区名,面积(size)为必填项"));
|
||||
return mav;
|
||||
}
|
||||
if (model.getCity().endsWith("市")) {
|
||||
model.setCity(model.getCity().replaceAll("市$", ""));
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||
Date calDate = null;
|
||||
try {
|
||||
calDate = org.apache.commons.lang.time.DateUtils.parseDate(request.getParameter("calDate"), new String[] { "yyyy-MM-dd" });
|
||||
} catch (ParseException e) {
|
||||
|
||||
}
|
||||
if (calDate == null) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("calDate:数据类型不合法"));
|
||||
return mav;
|
||||
} else {
|
||||
model.setCalDate(calDate);
|
||||
}
|
||||
}
|
||||
/* 先到CPDB库中查找小区 */
|
||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
|
||||
"district");
|
||||
if (district == null) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||
return mav;
|
||||
}
|
||||
model.setName(district.getName());
|
||||
|
||||
|
||||
if (model.getMaxFloor() != null && (model.getMaxFloor() <= 0 || model.getMaxFloor() > 59)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("maxFloor取值非法,正确范围[1,60)"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
if (model.getFloor() != null && (model.getFloor() <= 0 || model.getFloor() > 59)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("floor取值非法,正确范围[1,60)"));
|
||||
return mav;
|
||||
}
|
||||
if (model.getMaxFloor() != null && model.getFloor() != null && model.getFloor() > model.getMaxFloor()) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("所在楼层不能大于总楼层"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
model.setRegion(district.getRegion());
|
||||
model.setDistrictName(district.getName());
|
||||
if (StringUtils.isBlank(model.getPropertyType())) {
|
||||
if (district.getEstateType2() != null && district.getEstateType2().contains("别墅")) {
|
||||
model.setPropertyType("1");
|
||||
}
|
||||
}
|
||||
|
||||
if (model.getCalDate() != null) {
|
||||
if (new Date().before(model.getCalDate())) {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||
} else {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(model.getCalDate()));
|
||||
}
|
||||
} else {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||
}
|
||||
|
||||
Evaluation evaluation = buildEvaluation(model, request);
|
||||
evaluation.setSource("api_property_evaluate_rent");
|
||||
evaluation = evaluationService.evaluateRent(district, evaluation, model.getCalDate());
|
||||
|
||||
|
||||
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0) {
|
||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||
districtPriceMap.put("city", district.getCity());
|
||||
districtPriceMap.put("district", district.getRegion());
|
||||
districtPriceMap.put("name", district.getName());
|
||||
districtPriceMap.put("address", district.getAddress());
|
||||
districtPriceMap.put("totalPrice", evaluation.getTotalPrice());
|
||||
districtPriceMap.put("cal_date", model.getCalDate());
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
||||
return mav;
|
||||
} else {
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的租金估价").markNoData());
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setHouseLoudongService(HouseLoudongService houseLoudongService) {
|
||||
this.houseLoudongService = houseLoudongService;
|
||||
}
|
||||
@@ -5159,4 +5434,20 @@ public class PropertyController {
|
||||
public void setRegionAnaDataService(RegionAnaDataService regionAnaDataService) {
|
||||
this.regionAnaDataService = regionAnaDataService;
|
||||
}
|
||||
|
||||
public void setSeawaterService(SeawaterService seawaterService) {
|
||||
this.seawaterService = seawaterService;
|
||||
}
|
||||
|
||||
public void setSqmetreRentService(SqmetreRentService sqmetreRentService) {
|
||||
this.sqmetreRentService = sqmetreRentService;
|
||||
}
|
||||
|
||||
public void setDistrictRoomSqmetreRentService(DistrictRoomSqmetreRentService districtRoomSqmetreRentService) {
|
||||
this.districtRoomSqmetreRentService = districtRoomSqmetreRentService;
|
||||
}
|
||||
|
||||
public void setRentDealPriceService(RentDealPriceService rentDealPriceService) {
|
||||
this.rentDealPriceService = rentDealPriceService;
|
||||
}
|
||||
}
|
||||
|
||||
+108
-44
@@ -1,5 +1,6 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
@@ -7,6 +8,16 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fangjia.dal.mongo.model.*;
|
||||
import com.fangjia.dal.mongo.open.model.ApiUserAuthority;
|
||||
import com.fangjia.dal.seawater.model.Seawater;
|
||||
import com.fangjia.open.dto.DistrictDto;
|
||||
import com.fangjia.open.dto.DistrictHouseDtao;
|
||||
import com.fangjia.open.model.PropertyEvaluationModel;
|
||||
import com.fangjia.open.util.CommonUtils;
|
||||
import com.fangjia.service.datastore.EvaluationService;
|
||||
import com.fangjia.service.datastore.HouseService;
|
||||
import com.fangjia.service.mongo.fangjia.SeawaterService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.tools.ant.util.DateUtils;
|
||||
|
||||
@@ -15,9 +26,6 @@ import com.fangjia.core.util.DateUtil;
|
||||
import com.fangjia.dal.common.DistrictKey;
|
||||
import com.fangjia.dal.common.ServerAreaData;
|
||||
import com.fangjia.dal.mongo.fangjia.model.ServerArea;
|
||||
import com.fangjia.dal.mongo.model.DistrictStatRent;
|
||||
import com.fangjia.dal.mongo.model.RegionStatRent;
|
||||
import com.fangjia.dal.mongo.model.SqmetreRent;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.open.HttpCode;
|
||||
import com.fangjia.open.OpenHttpCodeEnum;
|
||||
@@ -35,6 +43,8 @@ import com.fangjia.service.district.DistrictStatService;
|
||||
import com.fangjia.service.district.RegionStatRentService;
|
||||
import com.fangjia.service.district.SqmetreRentService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
//@Authority(role = Role.USER)
|
||||
public class RentController {
|
||||
|
||||
@@ -43,6 +53,9 @@ public class RentController {
|
||||
private DistrictStatRentService districtStatRentService;
|
||||
private DistrictStatService districtStatService;
|
||||
private RegionStatRentService regionStatRentService;
|
||||
private EvaluationService evaluationService;
|
||||
private SeawaterService seawaterService;
|
||||
private HouseService houseService;
|
||||
//³ÇÊÐÆ½Ã××â½ð
|
||||
public Object cityRentAction(RentModel rentModel){
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
@@ -298,49 +311,93 @@ public class RentController {
|
||||
}else if(rentModel.getType() == 4){ //Á½Äê
|
||||
type = -24;
|
||||
}
|
||||
List<Date> dates = DateUtil.getLastDayBetweenDates(DateUtil.addMonthToDate(new Date(),type), new Date());
|
||||
|
||||
List<String> times = new ArrayList<String>();
|
||||
for(Date date : dates){
|
||||
times.add(DateUtils.format(date, "yyyy-MM"));
|
||||
}
|
||||
|
||||
List<DistrictStatRentBo> districtRents = districtStatRentService.findDistrictStatRentsByParams(rentModel.getCity(), rentModel.getDistrict(), rentModel.getName(), null, dates.get(0), dates.get(dates.size()-1), null, null, null, null, true);
|
||||
Map<String, Map<String, Integer>> distMap = null;
|
||||
List<Integer> rooms = null;
|
||||
|
||||
if(null != districtRents){
|
||||
distMap = new HashMap<String, Map<String, Integer>>();
|
||||
rooms = new ArrayList<Integer>();
|
||||
for(DistrictStatRentBo rent : districtRents){
|
||||
|
||||
DistrictStatRent distRent = rent.getDistrictStatRent();
|
||||
if(null == distRent){
|
||||
distRent = rent.getVillaDistrictStatRent();
|
||||
}
|
||||
|
||||
Map<String, Integer> priceMap = distMap.get(distRent.getHouseType().toString());
|
||||
if(null == priceMap){
|
||||
rooms.add(distRent.getHouseType());
|
||||
priceMap = new HashMap<String, Integer>();
|
||||
distMap.put(distRent.getHouseType().toString(), priceMap);
|
||||
}
|
||||
|
||||
priceMap.put(DateUtils.format(distRent.getEndMonthDate(), "yyyy-MM"), distRent.getAvgPrice());
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(rooms);
|
||||
|
||||
Map<String, Object> retMap = new HashMap<String, Object>();
|
||||
retMap.put("times", times);
|
||||
retMap.put("distMap", distMap);
|
||||
retMap.put("rooms", rooms);
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(retMap));
|
||||
Map<String, Object> trendsMap = districtStatRentService.getRentTrend(rentModel.getCity(), rentModel.getDistrict(), rentModel.getName(), type);
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(trendsMap));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// public Object evaluateRentAction(RentModel model, HttpServletRequest request){
|
||||
// RestfulModelAndView mav = new RestfulModelAndView();
|
||||
//
|
||||
// if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
|
||||
// || StringUtils.isBlank(model.getDistrict()) || model.getSize() <= 0) {
|
||||
// mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市,区域,小区名,面积(size)为必填项"));
|
||||
// return mav;
|
||||
// }
|
||||
//
|
||||
// District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),"district");
|
||||
// if (null == district) {
|
||||
// mav.setModel(BasicModel.buildBadRequestModel("小区不存在"));
|
||||
// return mav;
|
||||
// }
|
||||
//
|
||||
// Double startArea = model.getSize() - model.getSize()*0.1;
|
||||
// Double endArea = model.getSize() + model.getSize()*0.1;
|
||||
//
|
||||
// Integer startDate = Integer.parseInt(DateUtils.format(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||
//
|
||||
// //相似房源
|
||||
// List<Seawater> houses = seawaterService.findSeawatersFromEs2("rent", district.getCity(), district.getRegion(), district.getName(), null, null, startDate, null,
|
||||
// startArea, endArea, null, null, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
||||
// Map<String, Object> retMap = new HashMap<String, Object>();
|
||||
// retMap.put("houses", houses);
|
||||
//
|
||||
// if (null == model.getRadius()) {// 设置默认值
|
||||
// model.setRadius(2000);
|
||||
// }
|
||||
//
|
||||
// //相近小区
|
||||
// List<District> districts = districtService.findNearestDistrict(district, model.getRadius(), 50);
|
||||
// if (null != districts) {
|
||||
// Integer room = null;
|
||||
// if(model.getHouseType()!=null){
|
||||
// room = model.getHouseType();
|
||||
// }else{
|
||||
// room = houseService.getDistrictRoomType(model.getSize());
|
||||
// }
|
||||
//
|
||||
// if (null != room) {
|
||||
// List<DistrictHouseDtao> dtos = new ArrayList<DistrictHouseDtao>();
|
||||
// List<Integer> prices = new ArrayList<Integer>();
|
||||
// Date weekend = DateUtil.getFirstDayOfWeek(new Date());
|
||||
// for (District dist : districts) {
|
||||
// List<DistrictStatRent> districtStatRents = districtStatRentService.findLatestDistrictStatRent(dist, 1, room);
|
||||
// if (null != districtStatRents && districtStatRents.size() > 0) {
|
||||
// DistrictStatRent districtStatRent = districtStatRents.get(0);
|
||||
// if (districtStatRent.getAvgPrice() > 0) {
|
||||
// SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(dist.getCity(), dist.getRegion(), dist.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
||||
// if(sqmetreRent != null){
|
||||
// DistrictHouseDtao dto = new DistrictHouseDtao();
|
||||
// dto.setCity(dist.getCity());
|
||||
// dto.setRegion(dist.getRegion());
|
||||
// dto.setDistrictName(dist.getName());
|
||||
// dto.setSqAvgPrice(sqmetreRent.getAvgPrice());
|
||||
// dto.setRoom(room);
|
||||
// dtos.add(dto);
|
||||
// if(dtos.size()>=5){
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// retMap.put("districts", dtos);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// Map<String, Object> trendsMap = districtStatRentService.getRentTrend(model.getCity(), model.getDistrict(), model.getName(), -12);
|
||||
// retMap.put("trends", trendsMap);
|
||||
// mav.setModel(BasicModel.buildOKModel().setResult(retMap));
|
||||
// return mav;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public void setSeawaterService(SeawaterService seawaterService) {
|
||||
this.seawaterService = seawaterService;
|
||||
}
|
||||
|
||||
public void setSqmetreRentService(SqmetreRentService sqmetreRentService) {
|
||||
this.sqmetreRentService = sqmetreRentService;
|
||||
}
|
||||
@@ -359,4 +416,11 @@ public class RentController {
|
||||
this.regionStatRentService = regionStatRentService;
|
||||
}
|
||||
|
||||
public void setEvaluationService(EvaluationService evaluationService) {
|
||||
this.evaluationService = evaluationService;
|
||||
}
|
||||
|
||||
public void setHouseService(HouseService houseService) {
|
||||
this.houseService = houseService;
|
||||
}
|
||||
}
|
||||
|
||||
+584
@@ -0,0 +1,584 @@
|
||||
package com.fangjia.open.controllers.weixin;
|
||||
|
||||
import com.fangjia.core.util.*;
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.SdQuery;
|
||||
import com.fangjia.dal.SrQuery;
|
||||
import com.fangjia.dal.mongo.model.DistrictRoomSqmetreRent;
|
||||
import com.fangjia.dal.mongo.model.Evaluation;
|
||||
import com.fangjia.dal.mongo.model.RentDealPrice;
|
||||
import com.fangjia.dal.seawater.model.Seawater;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.open.compatible.model.JsonModel;
|
||||
import com.fangjia.open.dto.DistrictHouseDtao;
|
||||
import com.fangjia.open.interceptors.AuthenticationBean;
|
||||
import com.fangjia.open.model.BaseModel;
|
||||
import com.fangjia.open.model.weixin.EvaluationModel;
|
||||
import com.fangjia.open.model.weixin.PropertyEvaluationModel;
|
||||
import com.fangjia.open.util.LineChartsUtils;
|
||||
import com.fangjia.service.api.AutoCompleteBo;
|
||||
import com.fangjia.service.datastore.DistrictService;
|
||||
import com.fangjia.service.datastore.EvaluationService;
|
||||
import com.fangjia.service.datastore.HouseService;
|
||||
import com.fangjia.service.district.DistrictRoomSqmetreRentService;
|
||||
import com.fangjia.service.district.RentDealPriceService;
|
||||
import com.fangjia.service.mongo.fangjia.FileService;
|
||||
import com.fangjia.service.mongo.fangjia.SeawaterService;
|
||||
import com.fangjia.service.util.DistrictScoreUtil;
|
||||
import com.lowagie.text.pdf.BaseFont;
|
||||
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.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.sothis.core.util.CollectionUtils;
|
||||
import org.sothis.web.mvc.ActionContext;
|
||||
import org.sothis.web.mvc.annotation.Param;
|
||||
import org.xhtmlrenderer.pdf.ITextFontResolver;
|
||||
import org.xhtmlrenderer.pdf.ITextRenderer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 建设银行租金控制类
|
||||
*
|
||||
* @author shenjian
|
||||
* @since 2021/4/6
|
||||
*/
|
||||
public class CcbRentController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CcbRentController.class);
|
||||
|
||||
private DistrictService districtService;
|
||||
private SeawaterService seawaterService;
|
||||
private DistrictRoomSqmetreRentService districtRoomSqmetreRentService;
|
||||
private EvaluationService evaluationService;
|
||||
private HouseService houseService;
|
||||
private RentDealPriceService rentDealPriceService;
|
||||
private FileService fileService;
|
||||
|
||||
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);
|
||||
if (StringUtils.isNotBlank(totalPrice)) {
|
||||
result.setDealPrice(Double.valueOf(totalPrice));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Object detailAction(PropertyEvaluationModel result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Object downloadPageAction(PropertyEvaluationModel result, HttpServletRequest request, @Param(name = "city") String city, @Param(name = "district") String districtStr,
|
||||
@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) {
|
||||
com.fangjia.open.model.PropertyEvaluationModel model = new com.fangjia.open.model.PropertyEvaluationModel();
|
||||
model.setCity(city);
|
||||
model.setDistrict(districtStr);
|
||||
model.setName(name);
|
||||
model.setAddress(address);
|
||||
model.setSize(size);
|
||||
model.setFloor(floor);
|
||||
model.setHeight(height);
|
||||
if (room != null) {
|
||||
model.setRoom(room);
|
||||
}
|
||||
if (hall != null) {
|
||||
model.setHall(hall);
|
||||
}
|
||||
if (toilet != null) {
|
||||
model.setToilet(toilet);
|
||||
}
|
||||
model.setDirection(direction);
|
||||
model.setFitment(fitment);
|
||||
|
||||
if (model.getCity().endsWith("市")) {
|
||||
model.setCity(model.getCity().replaceAll("市$", ""));
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||
Date calDate = null;
|
||||
try {
|
||||
calDate = org.apache.commons.lang.time.DateUtils.parseDate(request.getParameter("calDate"), new String[] { "yyyy-MM-dd" });
|
||||
} catch (ParseException e) {
|
||||
|
||||
}
|
||||
model.setCalDate(calDate);
|
||||
}
|
||||
/* 先到CPDB库中查找小区 */
|
||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
|
||||
"district");
|
||||
model.setName(district.getName());
|
||||
|
||||
|
||||
model.setRegion(district.getRegion());
|
||||
model.setDistrictName(district.getName());
|
||||
if (StringUtils.isBlank(model.getPropertyType())) {
|
||||
if (district.getEstateType2() != null && district.getEstateType2().contains("别墅")) {
|
||||
model.setPropertyType("1");
|
||||
}
|
||||
}
|
||||
|
||||
if (model.getCalDate() != null) {
|
||||
if (new Date().before(model.getCalDate())) {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||
} else {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(model.getCalDate()));
|
||||
}
|
||||
} else {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||
}
|
||||
|
||||
Evaluation evaluation = buildEvaluation(model, request);
|
||||
evaluation.setSource("api_property_evaluate_rent");
|
||||
evaluation = evaluationService.evaluateRent(district, evaluation, model.getCalDate());
|
||||
|
||||
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0) {
|
||||
evaluation.setAvgPrice((int)(evaluation.getTotalPrice()/evaluation.getArea()));
|
||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||
districtPriceMap.put("city", district.getCity());
|
||||
districtPriceMap.put("district", district.getRegion());
|
||||
districtPriceMap.put("name", district.getName());
|
||||
districtPriceMap.put("address", district.getAddress());
|
||||
districtPriceMap.put("totalPrice", evaluation.getTotalPrice());
|
||||
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);
|
||||
|
||||
//周边相似小区
|
||||
if (null == model.getRadius()) {// 设置默认值
|
||||
model.setRadius(1000);
|
||||
}
|
||||
String[] fields = { "city", "region", "name", "estateType2", "id","finishBuildingDate"};
|
||||
List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
|
||||
//按条件过滤相似小区
|
||||
Integer buildYear = null;
|
||||
List<District> districts = null;
|
||||
if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
|
||||
buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||
if(buildYear!=null){
|
||||
districts = new ArrayList<District>();
|
||||
int startYear = buildYear -7;
|
||||
int endYear = buildYear + 7;
|
||||
for(District dist : allDistricts){
|
||||
if(StringUtils.isNotBlank(dist.getFinishBuildingDate())){
|
||||
int simlarDistYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||
if(simlarDistYear>=startYear && simlarDistYear<=endYear && StringUtils.isNotBlank(district.getEstateType2()) && StringUtils.isNotBlank(dist.getEstateType2()) && district.getEstateType2().equals(dist.getEstateType2())){
|
||||
districts.add(dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//相似房源
|
||||
Double startArea = model.getSize() - model.getSize()*0.1;
|
||||
Double endArea = model.getSize() + model.getSize()*0.1;
|
||||
Integer startDate = Integer.parseInt(org.apache.tools.ant.util.DateUtils.format(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||
List<Seawater> houses = seawaterService.findSeawatersFromEs2("rent", district.getCity(), district.getRegion(), district.getName(), null, null, startDate, null,
|
||||
startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
||||
//无评估小区房源用周边相似小区的房源
|
||||
if(null == houses || houses.size()==0){
|
||||
for (District dist : districts) {
|
||||
houses = seawaterService.findSeawatersFromEs2("rent", dist.getCity(), dist.getRegion(), dist.getName(), null, null, startDate, null,
|
||||
startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
||||
if(houses!=null && houses.size()>0){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(houses)) {
|
||||
for (Seawater seawater: houses) {
|
||||
if (seawater.getpDate() != null) {
|
||||
seawater.setRoot(DateUtil.formatByPattern(DateUtil.parseDate(String.valueOf(seawater.getpDate()), "yyyyMMdd"), "yyyy-MM-dd"));
|
||||
}
|
||||
}
|
||||
}
|
||||
districtPriceMap.put("houses", houses);
|
||||
|
||||
//周边相似小区租金
|
||||
if(model.getRoom() != 0){
|
||||
room = model.getRoom();
|
||||
}else{
|
||||
room = houseService.getDistrictRoomType((float)model.getSize());
|
||||
}
|
||||
if (null != districts) {
|
||||
if (null != room) {
|
||||
List<DistrictHouseDtao> dtos = new ArrayList<DistrictHouseDtao>();
|
||||
Date weekend = DateUtil.getFirstDayOfWeek(new Date());
|
||||
for (District dist : districts) {
|
||||
|
||||
List<DistrictRoomSqmetreRent> districtRoomSqmetreRents = districtRoomSqmetreRentService.findDistrictRoomSqmetreRents(dist, 1, room);
|
||||
|
||||
///List<DistrictStatRent> districtStatRents = districtStatRentService.findLatestDistrictStatRent(dist, 1, room);
|
||||
if (null != districtRoomSqmetreRents && districtRoomSqmetreRents.size() > 0) {
|
||||
DistrictRoomSqmetreRent districtRoomSqmetreRent = districtRoomSqmetreRents.get(0);
|
||||
if (districtRoomSqmetreRent.getAvgPrice() > 0) {
|
||||
|
||||
int startSqPrice = (int)(evaluation.getAvgPrice() - evaluation.getAvgPrice()*0.1);
|
||||
int endSqPrice = (int)(evaluation.getAvgPrice() + evaluation.getAvgPrice()*0.1);
|
||||
// SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(dist.getCity(), dist.getRegion(), dist.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
||||
if(districtRoomSqmetreRent.getAvgPrice()>=startSqPrice && districtRoomSqmetreRent.getAvgPrice()<=endSqPrice){
|
||||
DistrictHouseDtao dto = new DistrictHouseDtao();
|
||||
dto.setCity(dist.getCity());
|
||||
dto.setRegion(dist.getRegion());
|
||||
dto.setDistrictName(dist.getName());
|
||||
dto.setSqAvgPrice(districtRoomSqmetreRent.getAvgPrice());
|
||||
dto.setRoom(room);
|
||||
dtos.add(dto);
|
||||
if(dtos.size()>=5){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
districtPriceMap.put("districts", dtos);
|
||||
}
|
||||
}
|
||||
|
||||
//近一年户型租金走势
|
||||
Map<String, Object> trendsMap = districtRoomSqmetreRentService.getRentTrends(district.getCity(), district.getRegion(), district.getName(), room, -12);
|
||||
districtPriceMap.put("trends", trendsMap);
|
||||
|
||||
// 生成走势图图片,一遍转pdf
|
||||
String tradesImgUrl = buildTrendImage(trendsMap, room);
|
||||
|
||||
//成交的租房房源
|
||||
List<RentDealPrice> rentTrades = rentDealPriceService.getRentDealPrices(district.getCity(), district.getRegion(), district.getName(), 5);
|
||||
if (CollectionUtils.isNotEmpty(rentTrades)) {
|
||||
for (RentDealPrice price : rentTrades) {
|
||||
// 返回成交日期到前端,直接取日期转pdf报错!!!!!!!!!!!!!!!!!
|
||||
if (price.getTradeDate() != null) {
|
||||
price.setSource(DateUtil.formatByPattern(price.getTradeDate(), "yyyy-MM-dd"));
|
||||
}
|
||||
}
|
||||
}
|
||||
districtPriceMap.put("trades", rentTrades);
|
||||
districtPriceMap.put("tradesImgUrl", tradesImgUrl);
|
||||
|
||||
result.setResult(districtPriceMap);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String buildTrendImage(Map<String, Object> trendsMap, Integer room) {
|
||||
List<String> times = (List<String>) trendsMap.get("times");
|
||||
Map<String, Object> distMap = (Map<String, Object>) ((Map<String, Object>) trendsMap.get("distMap")).get(String.valueOf(room));
|
||||
if (distMap != null) {
|
||||
List<Integer> values = new ArrayList<Integer>();
|
||||
for (int i = 0; i < times.size(); i++) {
|
||||
if (distMap.get(times.get(i)) != null) {
|
||||
values.add((Integer) distMap.get(times.get(i)));
|
||||
} else {
|
||||
values.add(null);
|
||||
}
|
||||
}
|
||||
// 保存到本地测试
|
||||
//String url = LineChartsUtils.createChartAndSave2Png("d://test.png",room + "居室", times, values);
|
||||
String url = LineChartsUtils.createChartAndUpload(fileService,room + "居室", times, values);
|
||||
logger.info("租金估值图片上传至服务器:{}", url);
|
||||
return url;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过EvaluationModel组装Evaluation实体
|
||||
*
|
||||
* @param model
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
private Evaluation buildEvaluation(com.fangjia.open.model.PropertyEvaluationModel model, HttpServletRequest request) {
|
||||
Evaluation evaluation = new Evaluation();
|
||||
evaluation.setCity(model.getCity());
|
||||
evaluation.setRegion(model.getRegion());
|
||||
evaluation.setDistrictName(model.getName());
|
||||
evaluation.setDirection(DIRECTION.get(model.getDirection()));
|
||||
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(model.getDecoration())));
|
||||
evaluation.setAtticArea(model.getAtticSize());
|
||||
evaluation.setTerraceArea(model.getOuterSize());
|
||||
evaluation.setBasementArea(model.getBasementSize());
|
||||
evaluation.setGardenArea(model.getGardenSize());
|
||||
String worryFacility = model.getNegativeFactor();
|
||||
evaluation.setCreationDate(new Date());
|
||||
evaluation.setModificationDate(new Date());
|
||||
evaluation.setClientNo(model.getClientNo());
|
||||
if (0 != model.getAge()) {
|
||||
evaluation.setAge(model.getAge());
|
||||
}
|
||||
evaluation.setArea(model.getSize());
|
||||
if (StringUtils.isNotBlank(model.getBuildType())) {
|
||||
evaluation.setBuildType(model.getBuildType());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getCarport())) {
|
||||
evaluation.setCarport(model.getCarport());
|
||||
}
|
||||
if (model.getDecorationAge() >= 1 && model.getDecorationAge() <= 5) {
|
||||
evaluation.setFitmentAge(model.getDecorationAge());
|
||||
}
|
||||
evaluation.setCarportPrice(model.getCarportPrice());
|
||||
evaluation.setCity(model.getCity());
|
||||
evaluation.setDistrictName(model.getName());
|
||||
if (model.getDecorationCost() != null && model.getDecorationCost() > 0) {
|
||||
evaluation.setFitmentCharge(model.getDecorationCost());
|
||||
}
|
||||
if (0 != model.getHall()) {
|
||||
evaluation.setHall(model.getHall());
|
||||
}
|
||||
if (null != model.getFloor()) {
|
||||
evaluation.setFloor(model.getFloor());
|
||||
}
|
||||
if (model.getMaxFloor() != null && 0 != model.getMaxFloor()) {
|
||||
evaluation.setHeight(model.getMaxFloor());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getBuildingNumber())) {
|
||||
evaluation.setHouseNum(model.getBuildingNumber());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getHouseProperty())) {
|
||||
evaluation.setHouseProperty(model.getHouseProperty());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getInsidepos())) {
|
||||
evaluation.setInsidepos(model.getInsidepos());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getLightingVentilation())) {
|
||||
evaluation.setLightingVentilation(model.getLightingVentilation());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(model.getOtherFactor())) {
|
||||
evaluation.setOtherFactor(model.getOtherFactor());
|
||||
}
|
||||
evaluation.setRegion(model.getDistrict());
|
||||
if (0 != model.getRoom()) {
|
||||
evaluation.setRoom(model.getRoom());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getRoomNumber())) {
|
||||
evaluation.setRoomNum(model.getRoomNumber());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getSideset())) {
|
||||
evaluation.setSideset(model.getSideset());
|
||||
}
|
||||
if (0 != model.getToilet()) {
|
||||
evaluation.setToilet(model.getToilet());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(model.getFacade())) {
|
||||
evaluation.setFacade(model.getFacade());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getTraffice())) {
|
||||
evaluation.setTraffice(model.getTraffice());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getShape())) {
|
||||
evaluation.setShape(model.getShape());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getObstacle())) {
|
||||
evaluation.setObstacle(model.getObstacle());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getIndustry())) {
|
||||
evaluation.setIndustry(model.getIndustry());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getSupportDevice())) {
|
||||
evaluation.setSupportDevice(model.getSupportDevice());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getLeftPosition())) {
|
||||
evaluation.setLeftPosition(model.getLeftPosition());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getShopType())) {
|
||||
evaluation.setShopType(model.getShopType());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getShopUnique())) {
|
||||
evaluation.setShopUnique(model.getShopUnique());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getLocation())) {
|
||||
evaluation.setLocation(model.getLocation());
|
||||
}
|
||||
if (model.isNewDistrict()) {
|
||||
evaluation.setNewDistrict(model.isNewDistrict());
|
||||
}
|
||||
String ip = AnalyticsUtil.getIpAddress(ActionContext.getContext().getRequest());
|
||||
evaluation.setIp(ip);
|
||||
AuthenticationBean authenticationBean = (AuthenticationBean) request
|
||||
.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
||||
if (authenticationBean != null && authenticationBean.apiUser != null) {
|
||||
evaluation.setFromUserId(String.valueOf(authenticationBean.apiUser.getId()));
|
||||
}
|
||||
evaluation.setSource("api_property_evaluation");
|
||||
return evaluation;
|
||||
}
|
||||
|
||||
public void downloadAction(HttpServletResponse response, HttpServletRequest request, @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) throws IOException {
|
||||
response.setHeader("Content-disposition", "attachment; filename=report.pdf");
|
||||
response.setContentType("application/pdf;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
OutputStream os = null;
|
||||
try {
|
||||
os = response.getOutputStream();
|
||||
ITextRenderer renderer = new ITextRenderer(35, 20);
|
||||
ITextFontResolver fontResolver = renderer.getFontResolver();
|
||||
String fontUrl = ActionContext.getContext().getServletContext().getRealPath("/") + "fonts" + File.separator + "simsun.ttc";
|
||||
fontResolver.addFont(fontUrl, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
||||
final String path = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
|
||||
String url = path + "/ccbRent/downloadPage?city=" + DataUtil.urlEncode(city) + "&district="+DataUtil.urlEncode(district)+"&name="+DataUtil.urlEncode(name);
|
||||
url += "&address=" + DataUtil.urlEncode(address) +"&size="+size+"&floor="+floor+"&height="+height+"&room="+room+"&hall="+hall+"&toilet="+toilet+"&direction="+direction+"&fitment="+fitment;
|
||||
renderer.setDocument(url);
|
||||
renderer.layout();
|
||||
renderer.createPDF(os, true);
|
||||
renderer.finishPDF();
|
||||
os.flush();
|
||||
os.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (os != null) {
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法同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<AutoCompleteBo> suggestList = getDistrictByKeyword(cat, city, keyword, limit, lng, lat);
|
||||
model.setJsonModel(suggestList);
|
||||
return model;
|
||||
}
|
||||
|
||||
private List<AutoCompleteBo> 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<QueryParam> params = new ArrayList<QueryParam>();
|
||||
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<String, Double> 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<District> districts = districtService.findAllByParams(params, 0, limit, new String[]{"region", "name", "address", "addrAlias","id"});
|
||||
List<AutoCompleteBo> ret = new ArrayList<AutoCompleteBo>(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;
|
||||
}
|
||||
|
||||
private static final Map<String, String> DIRECTION = new HashMap<String, String>() {
|
||||
{
|
||||
put(null, "南");
|
||||
put("1", "西南");
|
||||
put("2", "东南");
|
||||
put("3", "南");
|
||||
put("4", "西北");
|
||||
put("5", "东北");
|
||||
put("6", "东");
|
||||
put("7", "西");
|
||||
put("8", "北");
|
||||
put("9", "东西");
|
||||
put("10", "南北");
|
||||
}
|
||||
};
|
||||
|
||||
private static final Map<String, String> FITMENT = new HashMap<String, String>() {
|
||||
{
|
||||
put(null, "简装");
|
||||
put("1", "毛坯");
|
||||
put("2", "简装");
|
||||
put("3", "精装");
|
||||
put("4", "豪装");
|
||||
}
|
||||
};
|
||||
|
||||
private static final Map<String, String> EVALUATION_MODEL_FITMENT = new HashMap<String, String>() {
|
||||
{
|
||||
put(null, "简单装修");
|
||||
put("简装", "简单装修");
|
||||
put("毛坯", "毛坯");
|
||||
put("精装", "精装修");
|
||||
put("豪装", "豪华装修");
|
||||
}
|
||||
};
|
||||
|
||||
public void setDistrictService(DistrictService districtService) {
|
||||
this.districtService = districtService;
|
||||
}
|
||||
|
||||
public void setSeawaterService(SeawaterService seawaterService) {
|
||||
this.seawaterService = seawaterService;
|
||||
}
|
||||
|
||||
public void setDistrictRoomSqmetreRentService(DistrictRoomSqmetreRentService districtRoomSqmetreRentService) {
|
||||
this.districtRoomSqmetreRentService = districtRoomSqmetreRentService;
|
||||
}
|
||||
|
||||
public void setEvaluationService(EvaluationService evaluationService) {
|
||||
this.evaluationService = evaluationService;
|
||||
}
|
||||
|
||||
public void setHouseService(HouseService houseService) {
|
||||
this.houseService = houseService;
|
||||
}
|
||||
|
||||
public void setRentDealPriceService(RentDealPriceService rentDealPriceService) {
|
||||
this.rentDealPriceService = rentDealPriceService;
|
||||
}
|
||||
|
||||
public void setFileService(FileService fileService) {
|
||||
this.fileService = fileService;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,8 @@ public class DistrictDto implements Serializable {
|
||||
* 均价
|
||||
*/
|
||||
private Integer avgPrice;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 板块
|
||||
*/
|
||||
@@ -525,7 +526,5 @@ public class DistrictDto implements Serializable {
|
||||
public void setAvgPrice(Integer avgPrice) {
|
||||
this.avgPrice = avgPrice;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.fangjia.open.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class DistrictHouseDtao implements Serializable {
|
||||
|
||||
private String city;
|
||||
private String region;
|
||||
private String districtName;
|
||||
private Integer roomPrice;
|
||||
private Integer sqAvgPrice;
|
||||
private Integer room;
|
||||
private Integer hall;
|
||||
private Integer toilet;
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getDistrictName() {
|
||||
return districtName;
|
||||
}
|
||||
|
||||
public void setDistrictName(String districtName) {
|
||||
this.districtName = districtName;
|
||||
}
|
||||
|
||||
public Integer getRoomPrice() {
|
||||
return roomPrice;
|
||||
}
|
||||
|
||||
public void setRoomPrice(Integer roomPrice) {
|
||||
this.roomPrice = roomPrice;
|
||||
}
|
||||
|
||||
public Integer getSqAvgPrice() {
|
||||
return sqAvgPrice;
|
||||
}
|
||||
|
||||
public void setSqAvgPrice(Integer sqAvgPrice) {
|
||||
this.sqAvgPrice = sqAvgPrice;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+8
-3
@@ -1,5 +1,7 @@
|
||||
package com.fangjia.open.model;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import java.util.Date;
|
||||
|
||||
public class PropertyEvaluationModel extends FangjiaApiModel {
|
||||
@@ -267,7 +269,9 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
|
||||
private String estateType;
|
||||
private String periodType;
|
||||
private Integer periodCount;
|
||||
private int houseType;
|
||||
|
||||
|
||||
private Integer houseType;
|
||||
private String clientNo;
|
||||
private int scope;
|
||||
|
||||
@@ -280,6 +284,7 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
|
||||
|
||||
private String user;
|
||||
|
||||
|
||||
public void setDecorationAge(int decorationAge) {
|
||||
this.decorationAge = decorationAge;
|
||||
}
|
||||
@@ -701,11 +706,11 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
|
||||
this.decoration = decoration;
|
||||
}
|
||||
|
||||
public int getHouseType() {
|
||||
public Integer getHouseType() {
|
||||
return houseType;
|
||||
}
|
||||
|
||||
public void setHouseType(int houseType) {
|
||||
public void setHouseType(Integer houseType) {
|
||||
this.houseType = houseType;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,15 @@ public class RentModel {
|
||||
|
||||
private String endDate;
|
||||
|
||||
|
||||
@Min(1)
|
||||
@Max(4)
|
||||
private Integer type;//ÀàÐÍ
|
||||
|
||||
@Min(1)
|
||||
@Max(6)
|
||||
private Integer houseType;//·¿ÐÍ
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
@@ -90,9 +95,12 @@ public class RentModel {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Integer getHouseType() {
|
||||
return houseType;
|
||||
}
|
||||
|
||||
public void setHouseType(Integer houseType) {
|
||||
this.houseType = houseType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ public class EvaluationModel extends BaseModel{
|
||||
private Integer role;
|
||||
private String cardId;
|
||||
|
||||
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
package com.fangjia.open.model.weixin;
|
||||
|
||||
import com.fangjia.open.model.BaseModel;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 建行租房估值
|
||||
*
|
||||
* @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;
|
||||
|
||||
private Map<String, Object> result;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
public Map<String, Object> getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(Map<String, Object> result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.fangjia.open.util;
|
||||
|
||||
import com.fangjia.core.util.DataUtil;
|
||||
import com.fangjia.service.mongo.fangjia.FileService;
|
||||
import org.bson.types.ObjectId;
|
||||
import org.jfree.chart.ChartFactory;
|
||||
import org.jfree.chart.ChartPanel;
|
||||
import org.jfree.chart.ChartUtilities;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
import org.jfree.chart.axis.NumberAxis;
|
||||
import org.jfree.chart.plot.CategoryPlot;
|
||||
import org.jfree.chart.plot.PlotOrientation;
|
||||
import org.jfree.chart.renderer.category.LineAndShapeRenderer;
|
||||
import org.jfree.chart.ui.ApplicationFrame;
|
||||
import org.jfree.data.category.DefaultCategoryDataset;
|
||||
import org.jfree.ui.RefineryUtilities;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 折线图绘图工具类
|
||||
*
|
||||
* @author shenjian
|
||||
* @since 2021/4/9
|
||||
*/
|
||||
public class LineChartsUtils {
|
||||
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
File file = new File("d://test.png");
|
||||
List<String> columns = new ArrayList<String>();
|
||||
columns.add("2020-02");
|
||||
columns.add("2020-03");
|
||||
columns.add("2020-04");
|
||||
columns.add("2020-05");
|
||||
columns.add("2020-06");
|
||||
columns.add("2020-07");
|
||||
columns.add("2020-08");
|
||||
columns.add("2020-09");
|
||||
columns.add("2020-10");
|
||||
columns.add("2020-11");
|
||||
columns.add("2020-12");
|
||||
columns.add("2021-01");
|
||||
|
||||
List<Integer> values = new ArrayList<Integer>();
|
||||
values.add(1000);
|
||||
values.add(2000);
|
||||
values.add(2000);
|
||||
values.add(2000);
|
||||
values.add(2000);
|
||||
values.add(2000);
|
||||
values.add(2000);
|
||||
values.add(3000);
|
||||
values.add(3000);
|
||||
values.add(3000);
|
||||
values.add(3000);
|
||||
values.add(3000);
|
||||
|
||||
createChartAndSave2Png("d://test.png", "1居室", columns, values);
|
||||
}
|
||||
|
||||
public static String createChartAndSave2Png(String path, String rowKey, List<String> columns, List<Integer> values) {
|
||||
File file = new File(path);
|
||||
try {
|
||||
ChartUtilities.saveChartAsPNG(file, createChart(rowKey, columns, values),800,300);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
public static String createChartAndUpload(FileService fileService, String rowKey, List<String> columns, List<Integer> values) {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
try {
|
||||
ChartUtilities.writeChartAsPNG(os, createChart(rowKey, columns, values),800,300);
|
||||
byte[] data = os.toByteArray();
|
||||
String id = new ObjectId().toString();
|
||||
fileService.save(id,"o", data, "image/png", "o");
|
||||
String url = "http://img0.fangjia.com/stc/fs/" + DataUtil.encodePicUrl(id, "o", "house");
|
||||
|
||||
return url;
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (os != null) {
|
||||
try {
|
||||
os.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义图表对象
|
||||
* @param rowKey 曲线名,如一居室
|
||||
* @param columns 横坐标名
|
||||
* @param values 纵坐标值
|
||||
*/
|
||||
public static JFreeChart createChart(String rowKey, List<String> columns, List<Integer> values) {
|
||||
createDataset(rowKey, columns, values);
|
||||
// 折线图名称, 横坐标名称, 纵坐标名称 数据水平竖直 PlotOrientation.HORIZONTAL, 水平显示图像 true, 水平显示图像 true, include legend true, tooltips false, urls
|
||||
JFreeChart chart = ChartFactory.createLineChart("", "", "", createDataset(rowKey, columns, values), PlotOrientation.VERTICAL, true, true, false);
|
||||
CategoryPlot plot = chart.getCategoryPlot();
|
||||
plot.setRangeGridlinesVisible(false); // 是否显示格子线
|
||||
plot.setBackgroundAlpha(0.3f); // 设置背景透明度
|
||||
LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
|
||||
renderer.setSeriesPaint(0, Color.BLUE);
|
||||
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
|
||||
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
|
||||
rangeAxis.setAutoRangeIncludesZero(true);
|
||||
rangeAxis.setUpperMargin(0.20);
|
||||
rangeAxis.setLabelAngle(Math.PI / 2.0);
|
||||
return chart;
|
||||
}
|
||||
|
||||
private static DefaultCategoryDataset createDataset(String rowKey, List<String> columns, List<Integer> values) {
|
||||
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
|
||||
for (int i = 0; i < columns.size(); i++) {
|
||||
String column = columns.get(i);
|
||||
if (values.get(i) != null) {
|
||||
dataset.addValue(Double.valueOf(values.get(i)), rowKey, column);
|
||||
} else {
|
||||
dataset.addValue(null, rowKey, column);
|
||||
}
|
||||
}
|
||||
return dataset;
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,8 @@ public class OpenApiClient {
|
||||
// }
|
||||
|
||||
JSONObject matchResult = request.getJsonContent(url, params, "UTF-8");
|
||||
|
||||
|
||||
if(matchResult.getInt("code") == 200){
|
||||
return matchResult.getJSONObject("result");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,489 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="referrer" content="no-referrer"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<title>租金报告中心</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1"/>
|
||||
<link rel="shortcut icon" href="/favicon.ico"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="../static/style/wx.css"/>
|
||||
<style type="text/css">
|
||||
body {
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
.main {
|
||||
margin: 4px 8px 4px 8px;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
.title {
|
||||
position: relative;
|
||||
color: #1E90FF;
|
||||
}
|
||||
.title1 {
|
||||
font-size: 14px;
|
||||
color: #1E90FF;
|
||||
}
|
||||
.p {
|
||||
font-size: 12px;
|
||||
}
|
||||
.table {
|
||||
width: 100%;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll
|
||||
}
|
||||
.inline {
|
||||
width: 550px;
|
||||
border-spacing: 0;
|
||||
text-align: left;
|
||||
}
|
||||
.table .inline th {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
line-height: 30px;
|
||||
text-align: left;
|
||||
}
|
||||
.download {
|
||||
float: right;
|
||||
color: #3d4145;
|
||||
border: solid 1px #333;
|
||||
order-radius: 3px;
|
||||
font-size: 12px;
|
||||
line-height: 1rem;
|
||||
width: 43px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
估值报告<span class="download" id="download">下载</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">1 评估申明</div>
|
||||
<div class="p">建设银行遵循中立、客观、公正的原则,通过周密细致的测算,评估求得分析对象的房地产市场参考。</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">2 评估时间</div>
|
||||
<div class="p">
|
||||
<span name="cal_date"></span><br/>
|
||||
评估结果<br/>
|
||||
楼盘名称:<span name="name"></span><br/>
|
||||
楼盘地址:<span name="address"></span><br/>
|
||||
租金估值(RMB):<span name="totalPrice"></span>元/月<br/>
|
||||
大写(人民币):<span name="totalPriceUpper"></span><br/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">3 报告有效期</div>
|
||||
<div class="p">本报告在市场无较大波动的情况下,该评估价格在报告出具起三个月内有效。</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">4 房产状况</div>
|
||||
<div class="p">
|
||||
详细地址:<span name="address"></span><br/>
|
||||
楼盘名称:<span name="name"></span><br/>
|
||||
室号:<span name="room"></span><br/>
|
||||
朝向:<span name="direction"></span><br/>
|
||||
建筑面积:<span name="size"></span>平米<br/>
|
||||
所在楼层:<span name="floor"></span> 层 <span name="height"></span>总层数<br/>
|
||||
电梯配套:<span name="hasLift"></span><br/>
|
||||
装修情况:<span name="fitment"></span><br/>
|
||||
建筑年代:<span name="buildYear"></span><br/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">5 历史租金</div>
|
||||
<div class="charts" id="districtRentTrendsChart"></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">6 已租房源</div>
|
||||
<div class="p table">
|
||||
<table class="inline">
|
||||
<thead>
|
||||
<tr class="bg">
|
||||
<th class="th01">城市</th>
|
||||
<th>区域</th>
|
||||
<th>小区名</th>
|
||||
<th>成交价</th>
|
||||
<th>面积</th>
|
||||
<th>室</th>
|
||||
<th>厅</th>
|
||||
<th>装修</th>
|
||||
<th>成交日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="trades">
|
||||
<td colspan="6">暂无数据</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">7 样本参考</div>
|
||||
<div class="p table">
|
||||
<table class="inline">
|
||||
<thead>
|
||||
<tr class="bg">
|
||||
<th class="th01">城市</th>
|
||||
<th>区域</th>
|
||||
<th>小区名</th>
|
||||
<th>租金</th>
|
||||
<th>面积</th>
|
||||
<th>室</th>
|
||||
<th>厅</th>
|
||||
<th>装修</th>
|
||||
<th>成交日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="referenceHouses">
|
||||
<td colspan="6">暂无数据</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">8 周边同类小区租金</div>
|
||||
<div class="p table">
|
||||
<table class="inline" style="width: 300px">
|
||||
<thead>
|
||||
<tr class="bg">
|
||||
<th class="th01">城市</th>
|
||||
<th>区域</th>
|
||||
<th>小区名</th>
|
||||
<th>平米租金</th>
|
||||
<th>室</th>
|
||||
<th>厅</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="sameDistricts">
|
||||
<tr class="">
|
||||
<td colspan="6">暂无数据</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
|
||||
<!-- 暂时注释 -->
|
||||
<script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
|
||||
<script type='text/javascript' src='../static/js/wx.js' charset='utf-8'></script>
|
||||
<script type="text/javascript" src="../static/js/trend-charts.js"></script>
|
||||
<script src="https://html2canvas.hertzen.com/dist/html2canvas.js"></script>
|
||||
<#-- <script src="../static/js/purify.min.js"></script>-->
|
||||
<#-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js"></script>-->
|
||||
<#-- <script src="../static/js/jspdf.umd.js"></script>-->
|
||||
<#-- <script src="../static/js/SourceHanSans-normal.js"></script>-->
|
||||
<#-- <script src="../static/js/simsun-normal.js"></script>-->
|
||||
<#-- <script type="text/javascript">-->
|
||||
<#-- $("#download").bind('click', function(){-->
|
||||
<#-- window.location.href = "download"-->
|
||||
<#-- // 打印所有可用的字体-->
|
||||
<#-- // jspdf.html(document.body, {-->
|
||||
<#-- // callback: function (doc) {-->
|
||||
<#-- // doc.save("租金报告.pdf");-->
|
||||
<#-- // },-->
|
||||
<#-- // x: 10,-->
|
||||
<#-- // y: 10-->
|
||||
<#-- // });-->
|
||||
<#-- // jspdf.html("test测试", {-->
|
||||
<#-- // callback: function (doc) {-->
|
||||
<#-- // doc.save("租金报告.pdf");-->
|
||||
<#-- // },-->
|
||||
<#-- // x: 10,-->
|
||||
<#-- // y: 10-->
|
||||
<#-- // });-->
|
||||
<#-- });-->
|
||||
<#-- $(function () {-->
|
||||
<#-- $('span[name="name"]').text('场中小区');-->
|
||||
<#-- });-->
|
||||
<#-- </script>-->
|
||||
<script type="text/javascript">
|
||||
// window.jsPDF = window.jspdf.jsPDF
|
||||
// var jspdf = new jsPDF();
|
||||
// jspdf.addFileToVFS('SourceHanSans-Normal.ttf',normalChinese);
|
||||
// jspdf.addFont('SourceHanSans-Normal.ttf', 'SourceHanSans-Normal', 'normal');
|
||||
// jspdf.setFont('SourceHanSans-Light');
|
||||
//console.log(jspdf.getFontList());
|
||||
$("#download").bind('click', function(){
|
||||
window.location.href = "download?city="+params.city+"&district="+params.district+"&name="+params.name+"&address="+params.address+"&size="+params.size+"&floor="+params.floor
|
||||
+"&height="+params.height+"&room="+params.room+"&hall="+params.hall+"&toilet="+params.toilet+"&direction="+params.direction+"&fitment="+params.fitment;
|
||||
// jspdf.html(document.body, {
|
||||
// callback: function (doc) {
|
||||
// doc.save("租金报告.pdf");
|
||||
// },
|
||||
// x: 0,
|
||||
// y: 0,
|
||||
// fontFaces: [{
|
||||
// family: 'SimSun',
|
||||
// weight: 'bold',
|
||||
// //style: style,
|
||||
// src: [{
|
||||
// format: "truetype",
|
||||
// url: "../static/fonts/SimSun.ttf"
|
||||
// }]
|
||||
// }]
|
||||
// });
|
||||
});
|
||||
|
||||
// 后台传参过来用
|
||||
let params = {
|
||||
'city': sessionStorage.city,
|
||||
'district': sessionStorage.district,
|
||||
'name': sessionStorage.name,
|
||||
'address': sessionStorage.address,
|
||||
'size': sessionStorage.size,
|
||||
'floor': sessionStorage.floor,
|
||||
'height': sessionStorage.height,
|
||||
'room': sessionStorage.room,
|
||||
'hall': sessionStorage.hall,
|
||||
'toilet': sessionStorage.toilet,
|
||||
'direction': sessionStorage.direction,
|
||||
'fitment': sessionStorage.fitment
|
||||
};
|
||||
|
||||
function init() {
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../property/rentReport',
|
||||
data: params,
|
||||
dataType:"json",
|
||||
type:"post",
|
||||
success:function(data){
|
||||
if(data.code == 200){
|
||||
let result = data.result;
|
||||
// 评估时间
|
||||
$('span[name="cal_date"]').text(result.cal_date)
|
||||
$('span[name="name"]').text(result.name);
|
||||
$('span[name="address"]').text(result.address);
|
||||
$('span[name="totalPrice"]').text(result.totalPrice)
|
||||
$('span[name="totalPriceUpper"]').text(result.totalPriceUpper)
|
||||
|
||||
// 历史租金
|
||||
var charts = {}
|
||||
// charts.series = [{
|
||||
// name: '1居室',
|
||||
// data: [3800, 3900, 4000, 4100, 4200, 4200, 4200, 4200]
|
||||
// }];
|
||||
if (result.trends.distMap[params.room] == undefined) {
|
||||
console.log("返回历史租金,不存在" + params.room + "居室数据")
|
||||
$('#districtRentTrendsChart').empty();
|
||||
$('#districtRentTrendsChart').removeClass("charts");
|
||||
$('#districtRentTrendsChart').addClass("p table");
|
||||
$('#districtRentTrendsChart').append('<table style="width: 300px"><tr colspan="6">暂无数据<td></tr></table>');
|
||||
} else {
|
||||
var arr = [];
|
||||
result.trends.times.forEach(function (d) {
|
||||
var price = result.trends.distMap[params.room][d];
|
||||
if (price != undefined) {
|
||||
arr.push(price);
|
||||
} else {
|
||||
arr.push('');
|
||||
}
|
||||
})
|
||||
charts.series = [{'name': params.room + '居室', 'data': arr}]; // 纵坐标
|
||||
charts.xData = result.trends.times; // 横坐标值
|
||||
createChartNow('districtRentTrendsChart', charts, true);
|
||||
}
|
||||
// 房产状况
|
||||
$('span[name="room"]').text(result.room)
|
||||
$('span[name="direction"]').text(result.direction)
|
||||
$('span[name="size"]').text(result.size)
|
||||
$('span[name="floor"]').text(result.floor)
|
||||
$('span[name="height"]').text(result.height)
|
||||
$('span[name="hasLift"]').text(result.hasLift)
|
||||
$('span[name="fitment"]').text(result.fitment)
|
||||
$('span[name="buildYear"]').text(result.buildYear)
|
||||
|
||||
// 已租房源
|
||||
var trades = result.trades;
|
||||
if (trades && trades.length > 0) {
|
||||
$('#trades').empty();
|
||||
trades.forEach(function(d){
|
||||
var fitment = d.fitment != undefined ? d.fitment : '';
|
||||
var hall = d.hall != undefined ? d.hall : '';
|
||||
$('#trades').append('<tr class="bg"> \
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + d.districtName + '</td> \
|
||||
<td>' + d.totalPrice + '</td> \
|
||||
<td>' + d.area + '</td> \
|
||||
<td>' + d.room + '</td> \
|
||||
<td>' + hall + '</td> \
|
||||
<td>' + fitment + '</td> \
|
||||
<td>' + formatDate(d.tradeDate) + '</td> \
|
||||
</tr>');
|
||||
})
|
||||
}
|
||||
|
||||
// 样本参考
|
||||
var referenceHouses = result.houses;
|
||||
if (referenceHouses && referenceHouses.length > 0) {
|
||||
$('#referenceHouses').empty();
|
||||
referenceHouses.forEach(function(d){
|
||||
var fitment = d.fitment != undefined ? d.fitment : '';
|
||||
var date = (d.pDate + '').substring(0, 4) + "-" + (d.pDate + '').substring(4, 6) + "-" + (d.pDate + '').substring(6, 8)
|
||||
$('#referenceHouses').append('<tr class="bg"> \
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + d.districtName + '</td> \
|
||||
<td>' + d.totalPrice + '</td> \
|
||||
<td>' + d.area + '</td> \
|
||||
<td>' + d.room + '</td> \
|
||||
<td>' + d.hall + '</td> \
|
||||
<td>' + fitment + '</td> \
|
||||
<td>' + date + '</td> \
|
||||
</tr>');
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 同类小区租金
|
||||
var sameDistricts = result.districts;
|
||||
if (sameDistricts && sameDistricts.length > 0) {
|
||||
$('#sameDistricts').empty()
|
||||
sameDistricts.forEach(function(d){
|
||||
$('#sameDistricts').append('<tr class=""> \
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + d.districtName + '</td> \
|
||||
<td>' + d.roomPrice + '</td> \
|
||||
<td>' + d.room + '</td> \
|
||||
<td>1</td> \
|
||||
</tr>');
|
||||
})
|
||||
}
|
||||
}else{
|
||||
$.toast(data.msg);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
|
||||
}
|
||||
})
|
||||
};
|
||||
var formatDate = function (dateStr) {
|
||||
var date = new Date(dateStr);
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth() + 1;
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
var d = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
return y + '-' + m + '-' + d;
|
||||
};
|
||||
function createChartNow(renderId, data, showTradeCount) {
|
||||
if(data == null || data == 'undefined' || typeof(data) == undefined) {
|
||||
return;
|
||||
}
|
||||
if(data.series == 'undefined' || data.series.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var yaxis = [{
|
||||
title: {
|
||||
enable: false,
|
||||
text: ''
|
||||
},
|
||||
offset : -5,
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value + "元";
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
if(showTradeCount) {
|
||||
yaxis.push({
|
||||
title: {
|
||||
enable: false,
|
||||
text: ''
|
||||
},
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value +'套';
|
||||
},
|
||||
style: {
|
||||
color: '#4572A7'
|
||||
}
|
||||
},
|
||||
opposite: true
|
||||
});
|
||||
}
|
||||
|
||||
var config = {yaxis : yaxis};
|
||||
createHighChartNow(renderId, data, config);
|
||||
};
|
||||
function createHighChartNow(renderId, data, config) {
|
||||
var chart = new Highcharts.Chart({
|
||||
credits:{
|
||||
enabled:true,
|
||||
text: '',
|
||||
href: "",
|
||||
position: {
|
||||
align: 'center',
|
||||
verticalAlign: 'top',
|
||||
x: 0,
|
||||
y: 25
|
||||
},
|
||||
itemStyle: {
|
||||
cursor: 'pointer'
|
||||
}
|
||||
},
|
||||
chart: {
|
||||
renderTo: renderId,
|
||||
type: 'spline'
|
||||
},
|
||||
title: {
|
||||
text: data.title,
|
||||
floating: false,
|
||||
align: 'center',
|
||||
x : 0,
|
||||
y : 10
|
||||
},
|
||||
legend: {
|
||||
align: 'center',
|
||||
verticalAlign: 'bottom'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'datetime',
|
||||
dateTimeLabelFormats: {
|
||||
day: '%m月%d',
|
||||
week: '%m月%d',
|
||||
month: '%Y.%m',
|
||||
year: '%Y-%m'
|
||||
},
|
||||
categories: data.xData
|
||||
},
|
||||
yAxis: config.yaxis,
|
||||
series: data.series,
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
if(this.series.name.indexOf('成交量') > -1) {
|
||||
return Highcharts.dateFormat('%Y年%m月', this.x) +" 成交: <span style='color:#F50;font-weight: bold;'>"+ this.y +'</span>套';
|
||||
}else {
|
||||
return Highcharts.dateFormat('%Y-%m-%d', this.x) +'<br/>'+ this.series.name+ ": <span style='color:#F50;font-weight: bold;'>"+ this.y +'</span>元/平米';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function () {
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</#compress>
|
||||
@@ -0,0 +1,236 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="referrer" content="no-referrer"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<title>租金报告中心</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1"/>
|
||||
<link rel="shortcut icon" href="/favicon.ico"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="../static/style/wx.css"/>
|
||||
<style type="text/css">
|
||||
body {
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
background: #f8f8f8;
|
||||
/** 特别注意,否则中文不生效 **/
|
||||
font-family: SimSun;
|
||||
}
|
||||
.main {
|
||||
margin: 4px 8px 4px 8px;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
.title {
|
||||
position: relative;
|
||||
color: #1E90FF;
|
||||
}
|
||||
.title1 {
|
||||
font-size: 14px;
|
||||
color: #1E90FF;
|
||||
}
|
||||
.p {
|
||||
font-size: 12px;
|
||||
}
|
||||
.table {
|
||||
width: 100%;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll
|
||||
}
|
||||
.inline {
|
||||
width: 550px;
|
||||
border-spacing: 0;
|
||||
text-align: left;
|
||||
}
|
||||
.table .inline th {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
line-height: 30px;
|
||||
text-align: left;
|
||||
}
|
||||
.download {
|
||||
float: right;
|
||||
color: #3d4145;
|
||||
border: solid 1px #333;
|
||||
order-radius: 3px;
|
||||
font-size: 12px;
|
||||
line-height: 1rem;
|
||||
width: 43px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
估值报告
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">1 评估申明</div>
|
||||
<div class="p">建设银行遵循中立、客观、公正的原则,通过周密细致的测算,评估求得分析对象的房地产市场参考。</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">2 评估时间</div>
|
||||
<div class="p">
|
||||
<span name="cal_date"><#if result.cal_date??>${result.cal_date}</#if></span><br/>
|
||||
评估结果<br/>
|
||||
楼盘名称:<span name="name"><#if result.name??>${result.name}</#if></span><br/>
|
||||
楼盘地址:<span name="address"><#if result.address??>${result.address}</#if></span><br/>
|
||||
租金估值(RMB):<span name="totalPrice"><#if result.totalPrice??>${result.totalPrice}</#if></span>元/月<br/>
|
||||
大写(人民币):<span name="totalPriceUpper"><#if result.totalPriceUpper??>${result.totalPriceUpper}</#if></span><br/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">3 报告有效期</div>
|
||||
<div class="p">本报告在市场无较大波动的情况下,该评估价格在报告出具起三个月内有效。</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">4 房产状况</div>
|
||||
<div class="p">
|
||||
详细地址:<span name="address"><#if result.address??>${result.address}</#if></span><br/>
|
||||
楼盘名称:<span name="name"><#if result.name??>${result.name}</#if></span><br/>
|
||||
室号:<span name="room"><#if result.room??>${result.room}</#if></span><br/>
|
||||
朝向:<span name="direction"><#if result.direction??>${result.direction}</#if></span><br/>
|
||||
建筑面积:<span name="size"><#if result.size??>${result.size}</#if></span>平米<br/>
|
||||
所在楼层:<span name="floor"><#if result.floor??>${result.floor}</#if></span> 层 <span name="height"><#if result.height??>${result.height}</#if></span>总层数<br/>
|
||||
电梯配套:<span name="hasLift"><#if result.hasLift??>${result.hasLift}</#if></span><br/>
|
||||
装修情况:<span name="fitment"><#if result.fitment??>${result.fitment}</#if></span><br/>
|
||||
建筑年代:<span name="buildYear"><#if result.buildYear??>${result.buildYear}</#if></span><br/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">5 历史租金</div>
|
||||
<div>
|
||||
<#if result.tradesImgUrl??>
|
||||
<#-- <img width="800px" height="300px" src="../static/images/test.png"></img>-->
|
||||
<img width="800px" height="300px" src="${result.tradesImgUrl}"></img>
|
||||
<#else>
|
||||
<div class="p table">
|
||||
<table class="inline">
|
||||
<tbody><tr><td>暂无数据</td></tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">6 已租房源</div>
|
||||
<div class="p table">
|
||||
<table class="inline">
|
||||
<thead>
|
||||
<tr class="bg">
|
||||
<th class="th01">城市</th>
|
||||
<th>区域</th>
|
||||
<th>小区名</th>
|
||||
<th>成交价</th>
|
||||
<th>面积</th>
|
||||
<th>室</th>
|
||||
<th>厅</th>
|
||||
<th>装修</th>
|
||||
<th>成交日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<#if (result.trades??&&result.trades?size>0)>
|
||||
<#list result.trades as bo>
|
||||
<tr class="">
|
||||
<td class="td01"><#if bo.city??>${bo.city}</#if></td>
|
||||
<td class="td02"><#if bo.region??>${bo.region}</#if></td>
|
||||
<td><#if bo.districtName??>${bo.districtName}</#if></td>
|
||||
<td><#if bo.totalPrice??>${bo.totalPrice}</#if></td>
|
||||
<td><#if bo.area??>${bo.area}</#if></td>
|
||||
<td><#if bo.room??>${bo.room}</#if></td>
|
||||
<td><#if bo.hall??>${bo.hall}</#if></td>
|
||||
<td><#if bo.fitment??>${bo.fitment}</#if></td>
|
||||
<td><#if bo.source??>${bo.source}</#if></td>
|
||||
</tr>
|
||||
</#list>
|
||||
<#else>
|
||||
<tr><td>暂无数据</td></tr>
|
||||
</#if>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">7 样本参考</div>
|
||||
<div class="p table">
|
||||
<table class="inline">
|
||||
<thead>
|
||||
<tr class="bg">
|
||||
<th class="th01">城市</th>
|
||||
<th>区域</th>
|
||||
<th>小区名</th>
|
||||
<th>租金</th>
|
||||
<th>面积</th>
|
||||
<th>室</th>
|
||||
<th>厅</th>
|
||||
<th>装修</th>
|
||||
<th>成交日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="referenceHouses">
|
||||
<#if (result.houses??&&result.houses?size>0)>
|
||||
<#list result.houses as bo>
|
||||
<tr class="">
|
||||
<td class="td01"><#if bo.city??>${bo.city}</#if></td>
|
||||
<td class="td02"><#if bo.region??>${bo.region}</#if></td>
|
||||
<td><#if bo.districtName??>${bo.districtName}</#if></td>
|
||||
<td><#if bo.totalPrice??>${bo.totalPrice}</#if></td>
|
||||
<td><#if bo.area??>${bo.area}</#if></td>
|
||||
<td><#if bo.room??>${bo.room}</#if></td>
|
||||
<td><#if bo.hall??>${bo.hall}</#if></td>
|
||||
<td><#if bo.fitment??>${bo.fitment}</#if></td>
|
||||
<td><#if bo.root??>${bo.root}</#if></td>
|
||||
</tr>
|
||||
</#list>
|
||||
<#else>
|
||||
<tr><td>暂无数据</td></tr>
|
||||
</#if>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title1">8 周边同类小区租金</div>
|
||||
<div class="p table">
|
||||
<table class="inline" style="width: 300px">
|
||||
<thead>
|
||||
<tr class="bg">
|
||||
<th class="th01">城市</th>
|
||||
<th>区域</th>
|
||||
<th>小区名</th>
|
||||
<th>平米租金</th>
|
||||
<th>室</th>
|
||||
<th>厅</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="sameDistricts">
|
||||
<#if (result.districts??&&result.districts?size>0)>
|
||||
<#list result.districts as bo>
|
||||
<tr class="">
|
||||
<td class="td01"><#if bo.city??>${bo.city}</#if></td>
|
||||
<td class="td02"><#if bo.region??>${bo.region}</#if></td>
|
||||
<td><#if bo.districtName??>${bo.districtName}</#if></td>
|
||||
<td><#if bo.totalPrice??>${bo.totalPrice}</#if></td>
|
||||
<td><#if bo.room??>${bo.room}</#if></td>
|
||||
<td><#if bo.hall??>${bo.hall}</#if></td>
|
||||
</tr>
|
||||
</#list>
|
||||
<#else>
|
||||
<tr><td>暂无数据</td></tr>
|
||||
</#if>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</#compress>
|
||||
@@ -0,0 +1,403 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>租金评估</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||
<link rel="stylesheet" href="../static/style/wx.css">
|
||||
<style>
|
||||
.list-block .item-content .item-inner{margin-left:0;padding-left:0.75rem;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page-group">
|
||||
<div class="page page-current">
|
||||
<input type="hidden" id="t" value="c">
|
||||
<form id="evaluateForm">
|
||||
<div class="content">
|
||||
<div class="list-block" style="margin-bottom:60px;">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<input id="cityName" value="上海" name="city" type="hidden">
|
||||
<input value="2000" name="radius" type="hidden">
|
||||
<div class="item-title label">城市:<font>上海</font></div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">地址:</div>
|
||||
<div class="item-input">
|
||||
<input type="text" placeholder="请输入小区名或地址" id="districtSearch" name="name" class="search_input" required>
|
||||
<input type="hidden" name="address" />
|
||||
</div>
|
||||
<!-- 区域 -->
|
||||
<input value="" name="district" type="hidden" required>
|
||||
<div class="item-media"><span>(必填项)</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="searchSpan" style="margin-bottom:50px;z-index:999;position: absolute; width: 100%;" >
|
||||
<ul></ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">面积:</div>
|
||||
<div class="item-input">
|
||||
<input type="number" name="size" placeholder="请输入建筑面积(平米)" id="houseArea" min="0" max="1000" value="" required>
|
||||
</div>
|
||||
<div class="item-media"><span>(必填项)</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="content-block">
|
||||
<div class="item-title label di">户型:</div>
|
||||
<input name="room" type="hidden" id="room" placeholder="请选择室" value="1">
|
||||
<input name="hall" type="hidden" id="hall" placeholder="请选择厅">
|
||||
<input name="toilet" type="hidden" id="toilet" placeholder="请选择卫">
|
||||
<p class="di">
|
||||
<a href="#" class="create-actions01-now">1</a>室 <a
|
||||
href="#" class="create-actions02-now">0</a>厅 <a
|
||||
href="#" class="create-actions03-now">0</a>卫
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">楼层:</div>
|
||||
<div class="item-input">
|
||||
<input type="number" name="floor" id="houseFloor" placeholder="请输入所在楼层" min="1" max="200" required value="">
|
||||
</div>
|
||||
<div class="item-media"><span>(必填项)</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">总楼层:</div>
|
||||
<div class="item-input">
|
||||
<input type="number" name="height" id="houseHight" placeholder="请输入总楼层" min="1" max="200" value="" required>
|
||||
</div>
|
||||
<div class="item-media"><span>(必填项)</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="moreInput dn">
|
||||
<li>
|
||||
<div class="item-content">
|
||||
|
||||
<div class="item-inner">
|
||||
<div class="content-block">
|
||||
<div class="item-title label di">朝向:</div>
|
||||
<input id="direction" type="hidden" name="direction">
|
||||
<p class="di"><a href="#" class="create-actions04">请选择朝向</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
|
||||
<div class="item-inner">
|
||||
<div class="content-block">
|
||||
<div class="item-title label di">装修情况:</div>
|
||||
<input type="hidden" id="fitment" name="fitment">
|
||||
<p class="di"><a href="#" class="create-actions05">请选择装修情况</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="content-block">
|
||||
<div class="item-title label di">电梯配套:</div>
|
||||
<input type="hidden" id="hasLift" name="hasLift" placeholder="请选择电梯配套">
|
||||
<p class="di"><a href="#" class="create-actions14-now">请选择电梯配套</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<div class="more_btn">继续填写,租金更加精准↓</div>
|
||||
<div class="little_btn dn">收起</div>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<p><a id="evaluateBtn" class="button button-big button-fill">查看租金结果</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='../static/js/select.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='../static/js/wx.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='../static/js/autoCompletion.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='../static/js/jquery.cookie.js' charset='utf-8'></script>
|
||||
<script type="text/javascript">
|
||||
function storeSession() {
|
||||
sessionStorage.city = $('input[name="city"]').val()
|
||||
sessionStorage.name = $('input[name="name"]').val()
|
||||
sessionStorage.district = $('input[name="district"]').val()
|
||||
sessionStorage.address = $('input[name="address"]').val()
|
||||
sessionStorage.size = $('input[name="size"]').val()
|
||||
sessionStorage.room = $('input[name="room"]').val()
|
||||
sessionStorage.hall = $('input[name="hall"]').val()
|
||||
sessionStorage.toilet = $('input[name="toilet"]').val()
|
||||
sessionStorage.floor = $('input[name="floor"]').val()
|
||||
sessionStorage.height = $('input[name="height"]').val()
|
||||
sessionStorage.direction = $('input[name="direction"]').val()
|
||||
sessionStorage.fitment = $('input[name="fitment"]').val()
|
||||
}
|
||||
function getSession() {
|
||||
if (sessionStorage.city != undefined) {
|
||||
$('input[name="city"]').val(sessionStorage.city)
|
||||
}
|
||||
if (sessionStorage.name != undefined) {
|
||||
$('input[name="name"]').val(sessionStorage.name)
|
||||
}
|
||||
if (sessionStorage.district != undefined) {
|
||||
$('input[name="district"]').val(sessionStorage.district)
|
||||
}
|
||||
if (sessionStorage.address != undefined) {
|
||||
$('input[name="address"]').val(sessionStorage.address)
|
||||
}
|
||||
if (sessionStorage.size != undefined) {
|
||||
$('input[name="size"]').val(sessionStorage.size)
|
||||
}
|
||||
if (sessionStorage.room != undefined) {
|
||||
$('input[name="room"]').val(sessionStorage.room)
|
||||
}
|
||||
if (sessionStorage.hall != undefined) {
|
||||
$('input[name="hall"]').val(sessionStorage.hall)
|
||||
}
|
||||
if (sessionStorage.toilet != undefined) {
|
||||
$('input[name="toilet"]').val(sessionStorage.toilet)
|
||||
}
|
||||
if (sessionStorage.floor != undefined) {
|
||||
$('input[name="floor"]').val(sessionStorage.floor)
|
||||
}
|
||||
if (sessionStorage.height != undefined) {
|
||||
$('input[name="height"]').val(sessionStorage.height)
|
||||
}
|
||||
if (sessionStorage.direction != undefined) {
|
||||
$('input[name="direction"]').val(sessionStorage.direction)
|
||||
}
|
||||
if (sessionStorage.fitment != undefined) {
|
||||
$('input[name="fitment"]').val(sessionStorage.fitment)
|
||||
}
|
||||
}
|
||||
|
||||
$("#evaluateBtn").on('click', function(){
|
||||
var inputs = $("input")
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
var input = $(inputs[i])
|
||||
var fieldName = input.attr("placeholder").substring(3)
|
||||
var fieldVal = $.trim(input.val())
|
||||
if (input.attr("required") && fieldVal == "") {
|
||||
if (input.attr("name").indexOf("district") != -1) {
|
||||
$.toast("请选择输入地址时提示的小区")
|
||||
} else {
|
||||
$.toast(fieldName + "不能为空");
|
||||
}
|
||||
return
|
||||
}
|
||||
if (input.attr("type") == 'number' && fieldVal != "") {
|
||||
if (input.attr("name").indexOf("size") != -1) {
|
||||
if (!/^[0-9]+(.[0-9]+)?$/.test(fieldVal)) {
|
||||
$.toast(fieldName + "非法");
|
||||
return
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!/^[0-9]+$/.test(fieldVal)) {
|
||||
$.toast(fieldName + "必须是正整数");
|
||||
return
|
||||
}
|
||||
}
|
||||
var min = input.attr("min")
|
||||
var max = input.attr("max")
|
||||
if (max && min && (parseFloat(min) > parseFloat(fieldVal) || parseFloat(max) < parseFloat(fieldVal))) {
|
||||
$.toast(fieldName + "的取值范围是:" + min + "到" + max);
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if(parseFloat($("#houseHight").val()) < parseFloat($("#houseFloor").val())){
|
||||
$.toast("楼层不能大于楼高");
|
||||
return
|
||||
}
|
||||
storeSession()
|
||||
|
||||
if($("#houseHight").val() && parseFloat($("#houseHight").val())>=60){
|
||||
$.toast("请输入合理的楼层数");
|
||||
return
|
||||
}
|
||||
$("#evaluateBtn").prop("disabled", true)
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../property/evaluateRent',
|
||||
data:$("#evaluateForm").serialize(),
|
||||
dataType:"json",
|
||||
type:"post",
|
||||
success:function(data){
|
||||
if(data.code == 200){
|
||||
window.location.href = "report?address=" + data.result.address + "&totalPrice=" + data.result.totalPrice
|
||||
}else{
|
||||
$.toast("估价失败,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
//$.toast("服务器异常,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
}
|
||||
})
|
||||
})
|
||||
// 选择操作-房型-室
|
||||
$(document).on('click', '.create-actions01-now', function () {
|
||||
var buttons1 = [
|
||||
{
|
||||
text: '请选择室',
|
||||
label: true
|
||||
}
|
||||
];
|
||||
for (var i = 1; i < 10; i++) {
|
||||
buttons1.push({
|
||||
text: i + '',
|
||||
onClick: function () {
|
||||
$("#room").val(this.text)
|
||||
$(".create-actions01-now").empty().text(this.text).addClass("selected")
|
||||
}
|
||||
})
|
||||
}
|
||||
var buttons2 = [
|
||||
{
|
||||
text: '取消',
|
||||
bg: 'gray'
|
||||
}
|
||||
];
|
||||
var groups = [buttons1, buttons2];
|
||||
$.actions(groups);
|
||||
});
|
||||
|
||||
// 选择操作-房型-号
|
||||
$(document).on('click', '.create-actions02-now', function () {
|
||||
var buttons1 = [
|
||||
{
|
||||
text: '请选择厅',
|
||||
label: true
|
||||
}
|
||||
];
|
||||
for (var i = 0; i < 10; i++) {
|
||||
buttons1.push({
|
||||
text: i + '',
|
||||
onClick: function () {
|
||||
$("#hall").val(this.text)
|
||||
$(".create-actions02-now").empty().text(this.text).addClass("selected")
|
||||
}
|
||||
})
|
||||
}
|
||||
var buttons2 = [
|
||||
{
|
||||
text: '取消',
|
||||
bg: 'gray'
|
||||
}
|
||||
];
|
||||
var groups = [buttons1, buttons2];
|
||||
$.actions(groups);
|
||||
});
|
||||
|
||||
// 选择操作-房型-卫
|
||||
$(document).on('click', '.create-actions03-now', function () {
|
||||
var buttons1 = [
|
||||
{
|
||||
text: '请选择卫',
|
||||
label: true
|
||||
}
|
||||
];
|
||||
for (var i = 0; i < 10; i++) {
|
||||
buttons1.push({
|
||||
text: i + '',
|
||||
onClick: function () {
|
||||
$("#toilet").val(this.text)
|
||||
$(".create-actions03-now").empty().text(this.text).addClass("selected")
|
||||
}
|
||||
})
|
||||
}
|
||||
var buttons2 = [
|
||||
{
|
||||
text: '取消',
|
||||
bg: 'gray'
|
||||
}
|
||||
];
|
||||
var groups = [buttons1, buttons2];
|
||||
$.actions(groups);
|
||||
});
|
||||
|
||||
// 电梯配套
|
||||
$(document).on('click', '.create-actions14-now', function () {
|
||||
var buttons1 = [
|
||||
{
|
||||
text: '请选择是否有电梯',
|
||||
label: true
|
||||
},
|
||||
{
|
||||
text: '是',
|
||||
bold: true,
|
||||
onClick: function () {
|
||||
$('#hasLift').val(true)
|
||||
$("a.create-actions14-now").empty().text(this.text).addClass("selected")
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '否',
|
||||
onClick: function () {
|
||||
$('#hasLift').val(false)
|
||||
$("a.create-actions14").empty().text(this.text).addClass("selected")
|
||||
}
|
||||
}
|
||||
];
|
||||
var buttons2 = [
|
||||
{
|
||||
text: '取消',
|
||||
bg: 'gray'
|
||||
}
|
||||
];
|
||||
var groups = [buttons1, buttons2];
|
||||
$.actions(groups);
|
||||
});
|
||||
function init() {
|
||||
getSession()
|
||||
}
|
||||
$(function(){
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</#compress>
|
||||
@@ -0,0 +1,69 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<title>租金报告中心</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1"/>
|
||||
<link rel="shortcut icon" href="/favicon.ico"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="../static/style/wx.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-group">
|
||||
<div class="page page-current">
|
||||
<div class="content">
|
||||
<div class="list-block" style="margin-bottom:60px;">
|
||||
<a href="javascript:void(0)" onclick="javascript:history.back(-1);" class="button_12 blue blue_borderbottom radius4"><返回</a>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">您评估的地址:</div>
|
||||
<div class="item-input">
|
||||
<input type="text" disabled id="districtSearch" name="name" value="${lender}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">租金:</div>
|
||||
<div class="item-input">
|
||||
<input type="text" name="mount" disabled name="evaluation.mount" value="${dealPrice}元/月">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<p><a id="evaluateBtn" class="button button-big button-fill">查看租金报告</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='../static/js/wx.js' charset='utf-8'></script>
|
||||
<script type="text/javascript">
|
||||
$("#evaluateBtn").on('click', function(){
|
||||
window.location.href = "detail"
|
||||
});
|
||||
function init() {
|
||||
|
||||
};
|
||||
$(function () {
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</#compress>
|
||||
@@ -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 = '<li><a class="item-content" style="color:#333;text-align: center"><div class="item-inner"><div class="item-subtitle">未搜索到小区</div></div></a></li>'
|
||||
$("#searchSpan ul").empty().append(content)
|
||||
return
|
||||
}
|
||||
var template = '<li data-id="{0}" data-name="{1}" data-addr ="{2}"><a class="item-link item-content"><div class="item-inner"><div class="item-subtitle">{1}<br><small>{2}</small></div></div></a></li>'
|
||||
var template = '<li data-id="{0}" data-name="{1}" data-addr="{2}" data-region="{3}"><a class="item-link item-content"><div class="item-inner"><div class="item-subtitle">{1}<br><small>{2}</small></div></div></a></li>'
|
||||
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
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>org.sothis</groupId>
|
||||
<artifactId>sothis-core</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
+2
@@ -523,6 +523,8 @@ public interface DistrictService extends ModeService<DistrictKey, DistrictBo> {
|
||||
|
||||
List<District> findNearestDistrict(District district, int radiusMeters, int limit);
|
||||
|
||||
List<District> findNearestDistrict(District district, int radiusMeters, String[] fields, int limit);
|
||||
|
||||
List<District> findNearestDistrict(String city, Double lng, Double lat, int radiusMeters, int limit);
|
||||
|
||||
int findPeopleDensity(District district);
|
||||
|
||||
+48
-1
@@ -2292,6 +2292,22 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public List<District> findNearestDistrict(District district, int radiusMeters, String[] fields, int limit) {
|
||||
String cacheKey = district.getCity() + "#" + district.getRegion() + "#" + district.getName() + "#" + radiusMeters + "#" + limit;
|
||||
Object obj = CacheUtils.getValue(this.getClass(), cacheKey);
|
||||
if (obj != null) {
|
||||
return (List<District>) obj;
|
||||
}
|
||||
ArrayList<District> list = new ArrayList<District>();
|
||||
List<District> nlist = doFindNearestDistrict(district, radiusMeters, fields, limit);
|
||||
if (nlist.size() > 0) {
|
||||
list = (ArrayList<District>) nlist;
|
||||
}
|
||||
CacheUtils.putValue(CachePolicyEnum.LONG, this.getClass(), cacheKey, list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<District> findNearestDistrict(String city, Double lng, Double lat, int radiusMeters, int limit) {
|
||||
|
||||
@@ -2408,17 +2424,48 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.size() > limit) {
|
||||
ret = ret.subList(0, limit);
|
||||
}
|
||||
|
||||
return new ArrayList<District>(ret);
|
||||
}
|
||||
|
||||
|
||||
public List<District> doFindNearestDistrict(District district, int radiusMeters, String[] fields, int limit) {
|
||||
if (district == null || district.getLat() == null || district.getLng() == null || district.getLat() <= 0
|
||||
|| district.getLng() <= 0) {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("category", "district"));
|
||||
params.add(new QueryParam("city", district.getCity()));
|
||||
params.add(new QueryParam("visible", 0));
|
||||
SdQuery sdQuery = new SdQuery();
|
||||
sdQuery.setPoint((double) district.getLat() / 10000000000.0 + "," + (double) district.getLng() / 10000000000.0);
|
||||
sdQuery.setField("lat_lng");
|
||||
sdQuery.setDistance(String.valueOf((double) radiusMeters / 1000.0));
|
||||
params.add(new QueryParam(QueryParam.SD_PARAM_NAME, sdQuery));
|
||||
List<District> list = districtDao.findAllByParams(params, null, 0, limit * 2, fields);
|
||||
if (list.size() == 0) {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
List<District> ret = new ArrayList<District>();
|
||||
for (District d : list) {
|
||||
if (district.getName().equals(d.getName()) && district.getRegion().equals(d.getRegion())
|
||||
&& district.getCity().equals(d.getCity())) {
|
||||
continue;
|
||||
}
|
||||
if (d.getEstateType2() != null) {
|
||||
if ("ÆÕͨסլ".equals(district.getEstateType2())) {
|
||||
if (d.getEstateType2().indexOf(district.getEstateType2()) > -1) {
|
||||
ret.add(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.size() > limit) {
|
||||
ret = ret.subList(0, limit);
|
||||
}
|
||||
|
||||
+10
@@ -80,6 +80,16 @@ public interface EvaluationService {
|
||||
Evaluation evaluateWithPadding(Evaluation evaluation,Date weekend);
|
||||
|
||||
Evaluation evaluate(District district, Evaluation evaluation , Date weekend);
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件对小区进行租金估价
|
||||
* @param district
|
||||
* @param evaluation
|
||||
* @param weekend
|
||||
* @return
|
||||
*/
|
||||
Evaluation evaluateRent(District district, Evaluation evaluation, Date weekend);
|
||||
|
||||
/**
|
||||
* ÓÑ´ïÆÀ¹À
|
||||
|
||||
+47
-16
@@ -14,6 +14,9 @@ import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.fangjia.dal.mongo.model.*;
|
||||
import com.fangjia.service.district.DistrictRoomSqmetreRentService;
|
||||
import com.fangjia.service.district.SqmetreRentService;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
@@ -41,17 +44,6 @@ import com.fangjia.dal.mongo.dao.EvaluationDao;
|
||||
import com.fangjia.dal.mongo.dao.EvaluationHistoryDao;
|
||||
import com.fangjia.dal.mongo.dao.HouseLoudongDao;
|
||||
import com.fangjia.dal.mongo.fangjia.model.ServerArea;
|
||||
import com.fangjia.dal.mongo.model.ApiUserCfg;
|
||||
import com.fangjia.dal.mongo.model.BusStation;
|
||||
import com.fangjia.dal.mongo.model.DistrictAnalyData;
|
||||
import com.fangjia.dal.mongo.model.DistrictSellStat;
|
||||
import com.fangjia.dal.mongo.model.DistrictStat;
|
||||
import com.fangjia.dal.mongo.model.DistrictStatRent;
|
||||
import com.fangjia.dal.mongo.model.Evaluation;
|
||||
import com.fangjia.dal.mongo.model.EvaluationHistory;
|
||||
import com.fangjia.dal.mongo.model.HouseLoudong;
|
||||
import com.fangjia.dal.mongo.model.RegionBlock;
|
||||
import com.fangjia.dal.mongo.model.YdDealPrice;
|
||||
import com.fangjia.dal.mongo.pds.model.HourseTypeStat;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.service.api.ApiUserCfgService;
|
||||
@@ -96,6 +88,10 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
private DistrictSellStatService districtSellStatService;
|
||||
|
||||
private ApiUserCfgService apiUserCfgService;
|
||||
private SqmetreRentService sqmetreRentService;
|
||||
|
||||
private DistrictRoomSqmetreRentService districtRoomSqmetreRentService;
|
||||
|
||||
private final static Logger LOGGER = LoggerFactory.getLogger(EvaluationServiceImpl.class);
|
||||
|
||||
public static final Map<String, List<Double>> CREDIT_RATE_MAP = new HashMap<String, List<Double>>();
|
||||
@@ -1030,6 +1026,33 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
return wrapEvaluation(district,evaluation,weekend,stat);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Evaluation evaluateRent(District district, Evaluation evaluation, Date weekend) {
|
||||
|
||||
if (null == evaluation.getFloor() || 0 == evaluation.getFloor() || null == evaluation.getHeight() || 0 == evaluation.getHeight()) {
|
||||
evaluation.setFloor(null);
|
||||
evaluation.setHeight(null);
|
||||
}
|
||||
|
||||
|
||||
SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(district.getCity(), district.getRegion(), district.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
||||
if(sqmetreRent!=null){
|
||||
long totalPrice = evaluationRateService.evaluationRent(sqmetreRent.getAvgPrice(), evaluation);
|
||||
|
||||
evaluation.setTotalPrice(((Number) (totalPrice)).intValue());
|
||||
|
||||
evaluation.setEvaluateWay(sqmetreRent.getSampleEnum());
|
||||
evaluation.setCredit(sqmetreRent.getCredit());
|
||||
}else{
|
||||
evaluation.setTotalPrice(null);
|
||||
}
|
||||
if(weekend != null) {
|
||||
evaluation.setWeekend(weekend);
|
||||
}
|
||||
return evaluation;
|
||||
}
|
||||
|
||||
/**
|
||||
* 友达评估接口
|
||||
*/
|
||||
@@ -1338,6 +1361,10 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
this.apiUserCfgService = apiUserCfgService;
|
||||
}
|
||||
|
||||
public void setSqmetreRentService(SqmetreRentService sqmetreRentService) {
|
||||
this.sqmetreRentService = sqmetreRentService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long findUserEvaluationCount(long userId, Date startDate, Date endDate, String source) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
@@ -1782,7 +1809,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
* 封装价格
|
||||
* @author yinjihuan
|
||||
* @param dto
|
||||
* @param model
|
||||
* @param evaluation
|
||||
*/
|
||||
private void buildPrice(EvaluationBeforeLoanBean dto, Evaluation evaluation) {
|
||||
// 获取房屋总价
|
||||
@@ -1808,7 +1835,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
* 小区年涨幅
|
||||
* @author yinjihuan
|
||||
* @param dto
|
||||
* @param model
|
||||
* @param evaluation
|
||||
*/
|
||||
private void buildOneYearUpDownRange(EvaluationBeforeLoanBean dto, Evaluation evaluation) {
|
||||
List<DistrictSellStat> districtsSellStats = districtSellStatService.getAllWithMonths(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName(), 12);
|
||||
@@ -1824,7 +1851,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
* 上个月参考均价
|
||||
* @author yinjihuan
|
||||
* @param dto
|
||||
* @param model
|
||||
* @param evaluation
|
||||
*/
|
||||
private void buildTopMonthAvgPrice(EvaluationBeforeLoanBean dto, Evaluation evaluation) {
|
||||
String topMonth = DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -1), "yyyyMM");
|
||||
@@ -1839,7 +1866,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
* 涨跌幅在城市排名
|
||||
* @author yinjihuan
|
||||
* @param dto
|
||||
* @param key
|
||||
* @param evaluation
|
||||
*/
|
||||
private void buildUpDownRangecityLevel(EvaluationBeforeLoanBean dto, Evaluation evaluation, DistrictAnalyData districtAnalyData) {
|
||||
Double increaseRate = 0d;
|
||||
@@ -1858,7 +1885,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
* 获得最近一期的小区均价
|
||||
* @author yinjihuan
|
||||
* @param dto
|
||||
* @param model
|
||||
* @param evaluation
|
||||
*/
|
||||
private void buildWeekAvgPrice(EvaluationBeforeLoanBean dto, Evaluation evaluation) {
|
||||
DistrictStatBo bo = getNearestDistrictStat(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName()));
|
||||
@@ -1992,4 +2019,8 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
}
|
||||
return evaluationDao.findCountByParams(params);
|
||||
}
|
||||
|
||||
public void setDistrictRoomSqmetreRentService(DistrictRoomSqmetreRentService districtRoomSqmetreRentService) {
|
||||
this.districtRoomSqmetreRentService = districtRoomSqmetreRentService;
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.fangjia.service.district;
|
||||
|
||||
import com.fangjia.dal.mongo.model.DistrictRoomSqmetreRent;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface DistrictRoomSqmetreRentService {
|
||||
|
||||
List<DistrictRoomSqmetreRent> findDistrictRoomSqmetreRents(District district, int periodCount, int houseType);
|
||||
|
||||
Map<String, Object> getRentTrends(String city, String region, String name, int room, int count);
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package com.fangjia.service.district;
|
||||
|
||||
import com.fangjia.core.util.CacheUtils;
|
||||
import com.fangjia.core.util.DateUtil;
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.SortParam;
|
||||
import com.fangjia.dal.mongo.dao.DistrictRoomSqmetreRentDao;
|
||||
import com.fangjia.dal.mongo.model.DistrictRoomSqmetreRent;
|
||||
import com.fangjia.dal.mongo.model.DistrictStatRent;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.service.bo.DistrictStatRentBo;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class DistrictRoomSqmetreRentServiceImpl implements DistrictRoomSqmetreRentService{
|
||||
|
||||
private DistrictRoomSqmetreRentDao districtRoomSqmetreRentDao;
|
||||
|
||||
@Override
|
||||
public List<DistrictRoomSqmetreRent> findDistrictRoomSqmetreRents(District district, int periodCount, int houseType) {
|
||||
String cacheKey = district.getCity() + "_" + district.getRegion() + "_" + district.getName() + "_" + periodCount + "_" + houseType+"_room_rent";
|
||||
// Object obj = CacheUtils.getValue(this.getClass(), cacheKey);
|
||||
// if (obj != null) {
|
||||
// return (List<DistrictRoomSqmetreRent>) obj;
|
||||
// }
|
||||
List<DistrictRoomSqmetreRent> values = doFindLatestDistrictStatRent(district, periodCount, houseType);
|
||||
CacheUtils.putValue(CacheUtils.CachePolicyEnum.LONG, this.getClass(), cacheKey, new ArrayList<DistrictRoomSqmetreRent>(values));
|
||||
return values;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getRentTrends(String city, String region, String name, int room, int count) {
|
||||
List<Date> dates = DateUtil.getLastDayBetweenDates(DateUtil.addMonthToDate(new Date(),count), new Date());
|
||||
|
||||
List<String> times = new ArrayList<String>();
|
||||
for(Date date : dates){
|
||||
times.add(org.apache.tools.ant.util.DateUtils.format(date, "yyyyMM"));
|
||||
}
|
||||
|
||||
// List<DistrictStatRentBo> districtRents = findDistrictStatRentsByParams(city, region, name, null, dates.get(0), dates.get(dates.size()-1), null, null, null, null, true);
|
||||
List<DistrictRoomSqmetreRent> districtRents = findRentTrends(city, region, name, room, count);
|
||||
Map<String, Map<String, Integer>> distMap = null;
|
||||
List<Integer> rooms = null;
|
||||
|
||||
if(null != districtRents){
|
||||
distMap = new HashMap<String, Map<String, Integer>>();
|
||||
rooms = new ArrayList<Integer>();
|
||||
for(DistrictRoomSqmetreRent rent : districtRents){
|
||||
|
||||
Map<String, Integer> priceMap = distMap.get(String.valueOf(room));
|
||||
if(null == priceMap){
|
||||
priceMap = new HashMap<String, Integer>();
|
||||
distMap.put(String.valueOf(room), priceMap);
|
||||
}
|
||||
|
||||
priceMap.put(String.valueOf(rent.getsDate()), rent.getAvgPrice());
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> retMap = new HashMap<String, Object>();
|
||||
if(rooms != null){
|
||||
retMap.put("times", times);
|
||||
retMap.put("distMap", distMap);
|
||||
retMap.put("room", room);
|
||||
}
|
||||
return retMap;
|
||||
}
|
||||
|
||||
|
||||
private List<DistrictRoomSqmetreRent> findRentTrends(String city, String region, String name, int room, int count){
|
||||
String date = DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), count), "yyyyMM");
|
||||
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("city", city));
|
||||
params.add(new QueryParam("region", region));
|
||||
params.add(new QueryParam("districtName", name));
|
||||
params.add(new QueryParam("houseType",room));
|
||||
params.add(new QueryParam("sDate", QueryParam.GREATER_THAN_EQUAL_OPERATOR, Integer.parseInt(date)));
|
||||
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||
sortParams.add(new SortParam("sDate", false));
|
||||
return districtRoomSqmetreRentDao.findAllByParams(params, sortParams, 0, count);
|
||||
}
|
||||
|
||||
|
||||
private List<DistrictRoomSqmetreRent> doFindLatestDistrictStatRent(District district, int periodCount, int houseType){
|
||||
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("city", district.getCity()));
|
||||
params.add(new QueryParam("region", district.getRegion()));
|
||||
params.add(new QueryParam("districtName", district.getName()));
|
||||
params.add(new QueryParam("houseType",houseType));
|
||||
// params.add(new QueryParam("sDate", QueryParam.GREATER_THAN_EQUAL_OPERATOR, calendar.getTime()));
|
||||
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||
sortParams.add(new SortParam("sDate", false));
|
||||
return districtRoomSqmetreRentDao.findAllByParams(params, sortParams, 0, periodCount);
|
||||
}
|
||||
|
||||
public void setDistrictRoomSqmetreRentDao(DistrictRoomSqmetreRentDao districtRoomSqmetreRentDao) {
|
||||
this.districtRoomSqmetreRentDao = districtRoomSqmetreRentDao;
|
||||
}
|
||||
}
|
||||
+9
@@ -140,4 +140,13 @@ public interface DistrictStatRentService {
|
||||
|
||||
|
||||
List<DistrictStatRent> findLatestDistrictStatRent(District district, int periodCount, int houseType);
|
||||
|
||||
|
||||
Map<String, Object> getRentTrend(String city, String region, String name, Integer count);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+44
@@ -898,6 +898,50 @@ public class DistrictStatRentServiceImpl implements DistrictStatRentService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getRentTrend(String city, String region, String name, Integer count) {
|
||||
List<Date> dates = DateUtil.getLastDayBetweenDates(DateUtil.addMonthToDate(new Date(),count), new Date());
|
||||
|
||||
List<String> times = new ArrayList<String>();
|
||||
for(Date date : dates){
|
||||
times.add(org.apache.tools.ant.util.DateUtils.format(date, "yyyy-MM"));
|
||||
}
|
||||
|
||||
List<DistrictStatRentBo> districtRents = findDistrictStatRentsByParams(city, region, name, null, dates.get(0), dates.get(dates.size()-1), null, null, null, null, true);
|
||||
Map<String, Map<String, Integer>> distMap = null;
|
||||
List<Integer> rooms = null;
|
||||
|
||||
if(null != districtRents){
|
||||
distMap = new HashMap<String, Map<String, Integer>>();
|
||||
rooms = new ArrayList<Integer>();
|
||||
for(DistrictStatRentBo rent : districtRents){
|
||||
|
||||
DistrictStatRent distRent = rent.getDistrictStatRent();
|
||||
if(null == distRent){
|
||||
distRent = rent.getVillaDistrictStatRent();
|
||||
}
|
||||
|
||||
Map<String, Integer> priceMap = distMap.get(distRent.getHouseType().toString());
|
||||
if(null == priceMap){
|
||||
rooms.add(distRent.getHouseType());
|
||||
priceMap = new HashMap<String, Integer>();
|
||||
distMap.put(distRent.getHouseType().toString(), priceMap);
|
||||
}
|
||||
|
||||
priceMap.put(org.apache.tools.ant.util.DateUtils.format(distRent.getEndMonthDate(), "yyyy-MM"), distRent.getAvgPrice());
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> retMap = new HashMap<String, Object>();
|
||||
if(rooms != null){
|
||||
Collections.sort(rooms);
|
||||
retMap.put("times", times);
|
||||
retMap.put("distMap", distMap);
|
||||
retMap.put("rooms", rooms);
|
||||
}
|
||||
return retMap;
|
||||
}
|
||||
|
||||
private List<DistrictStatRent> doFindLatestDistrictStatRent(District district, int periodCount, int houseType){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MONTH, -4);
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.fangjia.service.district;
|
||||
|
||||
import com.fangjia.dal.mongo.model.RentDealPrice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RentDealPriceService {
|
||||
|
||||
List<RentDealPrice> getRentDealPrices(String city, String region, String districtName, int limit);
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.fangjia.service.district;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.SortParam;
|
||||
import com.fangjia.dal.mongo.dao.DistrictRoomSqmetreRentDao;
|
||||
import com.fangjia.dal.mongo.dao.RentDealPriceDao;
|
||||
import com.fangjia.dal.mongo.model.RegionStat;
|
||||
import com.fangjia.dal.mongo.model.RentDealPrice;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RentDealPriceServiceImpl extends MongoDaoImpl<RentDealPrice> implements RentDealPriceService{
|
||||
|
||||
private RentDealPriceDao dentDealPriceDao;
|
||||
|
||||
public void setDentDealPriceDao(RentDealPriceDao dentDealPriceDao) {
|
||||
this.dentDealPriceDao = dentDealPriceDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentDealPrice> getRentDealPrices(String city, String region, String districtName, int limit) {
|
||||
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("city", city));
|
||||
if (StringUtils.isNotBlank(region)) {
|
||||
params.add(new QueryParam("region", region));
|
||||
} else {
|
||||
params.add(new QueryParam("region", null));
|
||||
}
|
||||
if (StringUtils.isNotBlank(districtName)) {
|
||||
params.add(new QueryParam("districtName", districtName));
|
||||
} else {
|
||||
params.add(new QueryParam("districtName", null));
|
||||
}
|
||||
|
||||
List<SortParam> sortParms = new ArrayList<SortParam>(1);
|
||||
sortParms.add(new SortParam("tradeDate", true));
|
||||
List<RentDealPrice> list = findAllByParams(params, sortParms, limit);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -12,8 +12,13 @@ public interface SeawaterService {
|
||||
|
||||
List<Seawater> findSeawaters(String category, String city, String region, String name, List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate,
|
||||
Integer room, String root, String sort, boolean order, int start, int limit ,String[] keys);
|
||||
|
||||
List<Seawater> findSeawatersFromEs(String category, String city, String region, String name, List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate,
|
||||
Integer room, String root, String sort, boolean order, int start, int limit ,String[] keys,String table);
|
||||
Integer room, String root, String sort, boolean order, int start, int limit ,String[] keys,String table);
|
||||
|
||||
List<Seawater> findSeawatersFromEs2(String category, String city, String region, String name, List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate,
|
||||
Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root, String sort, boolean order, int start, int limit ,String[] keys,String table);
|
||||
|
||||
|
||||
long findSeawatersCount(String category, String city, String region, String name, List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate,
|
||||
Integer room, String root);
|
||||
|
||||
+16
-3
@@ -64,7 +64,7 @@ public class SeawaterServiceImpl implements SeawaterService {
|
||||
}
|
||||
return sells;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Seawater convertDBObjectToSeawater(DBObject dbo) {
|
||||
Seawater seawater = new Seawater();
|
||||
@@ -161,6 +161,9 @@ public class SeawaterServiceImpl implements SeawaterService {
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public List<Seawater> findAllSeawater(String category, String city, String name, String region,Integer room, String root, String sort, Integer startDate, Integer endDate,
|
||||
@@ -209,6 +212,8 @@ public class SeawaterServiceImpl implements SeawaterService {
|
||||
return seawaterDao.findSeawatersCountFromEs(category, city, region, name, alias, regionAlias, startDate, endDate, room, root,table);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Seawater findByIdFromEs(String id,String table) {
|
||||
return seawaterDao.findByIdFromEs(id,table);
|
||||
@@ -218,10 +223,18 @@ public class SeawaterServiceImpl implements SeawaterService {
|
||||
public List<Seawater> findSeawatersFromEs(String category, String city, String region, String name,
|
||||
List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate, Integer room, String root,
|
||||
String sort, boolean order, int start, int limit, String[] keys,String table) {
|
||||
return seawaterDao.findSeawatersFromEs(category,city,region,name,alias,regionAlias,startDate,endDate,room,root,
|
||||
sort,order,start,limit,keys,table);
|
||||
return seawaterDao.findSeawatersFromEs(category,city,region,name,alias,regionAlias,startDate,endDate, null, null, null, null, room,root,
|
||||
sort,order,start,limit,table);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Seawater> findSeawatersFromEs2(String category, String city, String region, String name, List<String> alias, List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root, String sort, boolean order, int start, int limit, String[] keys, String table) {
|
||||
return seawaterDao.findSeawatersFromEs(category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,
|
||||
sort,order,start,limit,table);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -23,6 +23,8 @@ public interface EvaluationRateService {
|
||||
long evaluation(int districtAvgPrice, Evaluation evaluation);
|
||||
long evaluation(int districtAvgPrice, FjtEvaluation evaluation);
|
||||
|
||||
long evaluationRent(double districtSqmetreRent, Evaluation evaluation);
|
||||
|
||||
long evaluation(int districtAvgPrice, Evaluation evaluation, boolean min);
|
||||
|
||||
long evalustionShop(int districtAvgPrice, Evaluation evaluation);
|
||||
@@ -40,7 +42,7 @@ public interface EvaluationRateService {
|
||||
/**
|
||||
* 根据房源ID获得房源当前的估价价格,用于房源信息已经经过知识库匹配
|
||||
*
|
||||
* @param houseId
|
||||
* @param house
|
||||
* @return
|
||||
*/
|
||||
public long evaluation(House house);
|
||||
|
||||
+192
@@ -515,6 +515,198 @@ public class EvaluationRateServiceImpl implements EvaluationRateService {
|
||||
return evaluatePrice;
|
||||
}
|
||||
|
||||
private long getEvaluationRatePrice(long evaluatePrice, Evaluation evaluation){
|
||||
String type = "小区";
|
||||
Map<String, Map<String, Float>> rateMap = getEvaluationRateMap();
|
||||
Map<String, Float> map = rateMap.get(evaluation.getCity());
|
||||
if(null == map){
|
||||
map = rateMap.get("默认");
|
||||
}
|
||||
|
||||
// 楼层系数
|
||||
float houseFloorRate = 0;
|
||||
// 房型
|
||||
String roomHall = String.valueOf(evaluation.getRoom()) + "室" + String.valueOf(evaluation.getHall()) + "厅";
|
||||
float chamberRate = getEvaluationRate(map, "房型", roomHall, type);
|
||||
// 朝向系数
|
||||
float directionRate = getEvaluationRate(map, "朝向", evaluation.getDirection(), type);
|
||||
// 小区位置系数
|
||||
float insideposRate = getEvaluationRate(map, "小区位置", evaluation.getInsidepos(), type);
|
||||
// 景观情况系数
|
||||
float sightRate = getEvaluationRate(map, "景观", evaluation.getSight(), type);
|
||||
// 采光通风系数
|
||||
float lightingVentilationRate = getEvaluationRate(map, "采光通风", evaluation.getLightingVentilation(), type);
|
||||
// 噪音影响系数
|
||||
float noiseRate = getEvaluationRate(map, "噪音", evaluation.getNoise(), type);
|
||||
// 边套装置系数
|
||||
float sidesetRate = getEvaluationRate(map, "边套", evaluation.getSideset(), type);
|
||||
// 厌恶设施系数
|
||||
float worryFacilityRate = getEvaluationRate(map, "厌恶设施", evaluation.getWorryFacility(), type);
|
||||
// 车位系数
|
||||
float carportRate = getEvaluationRate(map, "车位", evaluation.getCarport(), type);
|
||||
// 装修系数
|
||||
float fitmentRate = getEvaluationRate(map, "装修情况", evaluation.getFitment(), type);
|
||||
//装修年限系数
|
||||
String fitment = "";
|
||||
if (null != evaluation.getFitmentAge()) {
|
||||
if (evaluation.getFitmentAge() <= 3) {
|
||||
fitment = evaluation.getFitmentAge() + "年";
|
||||
} else if (4 == evaluation.getFitmentAge()) {
|
||||
fitment = evaluation.getFitmentAge() + "年";
|
||||
} else {
|
||||
fitment = "4年以上";
|
||||
}
|
||||
}
|
||||
float fitmentAgeRate = getEvaluationRate(map, "装修年限", fitment, type);
|
||||
|
||||
// 赠送花园
|
||||
float gardenAreaRate = getEvaluationRate(map, "赠送面积因素", "花园", type);
|
||||
// 赠送地下车库
|
||||
float basementAreaRate = getEvaluationRate(map, "赠送面积因素", "地下室", type);
|
||||
// 赠送露台
|
||||
float outerAreaRate = getEvaluationRate(map, "赠送面积因素", "露台", type);
|
||||
// 赠送阁楼
|
||||
float atticAreaRate = getEvaluationRate(map, "赠送面积因素", "阁楼", type);
|
||||
|
||||
// 楼间距
|
||||
float floorSpaceRate = getEvaluationRate(map, "楼间距", evaluation.getFloorSpace(), type);
|
||||
// 政策因素
|
||||
float policyRate = getPolicyRate(map);
|
||||
|
||||
|
||||
String houseFloorRateType = null;
|
||||
if (!StringUtils.contains(evaluation.getBuildType(), DistrictKindEnum.bieshu.getValue())) {// 不是别墅
|
||||
if (null != evaluation.getHeight() && 0 != evaluation.getHeight() && null != evaluation.getFloor() && 0 != evaluation.getFloor()) {
|
||||
houseFloorRateType = getHouseFloorRateType(evaluation.getHeight());
|
||||
if("小高层".equals(houseFloorRateType) || "高层".equals(houseFloorRateType)){
|
||||
if(evaluation.getFloor() == 1 || evaluation.getFloor() == 2){
|
||||
houseFloorRate = getFloorRate(map, "小高层", evaluation.getFloor(), "小区");
|
||||
}else if(evaluation.getFloor().compareTo(evaluation.getHeight()) == 0){
|
||||
houseFloorRate = getFloorRate(map, "小高层", 17, "小区");
|
||||
}else{
|
||||
if(evaluation.getFloor() == 4){//4楼使用3楼的系数
|
||||
houseFloorRate = 0.9545F + 0.108F * ((3 - 1)/(float) (evaluation.getHeight() - 1));
|
||||
}else{
|
||||
houseFloorRate = 0.9545F + 0.108F * ((evaluation.getFloor() - 1)/(float) (evaluation.getHeight() - 1));
|
||||
}
|
||||
}
|
||||
if(evaluation.getFloor() == 14){
|
||||
houseFloorRate *= 0.99F;
|
||||
}
|
||||
evaluatePrice = (long) (evaluatePrice * houseFloorRate);
|
||||
}else{
|
||||
houseFloorRate = getFloorRate(map, houseFloorRateType,(null != evaluation.getFloor() ? evaluation.getFloor() : 0), type);
|
||||
if(houseFloorRateType.equals("多层")){
|
||||
if(houseFloorRate > 0){
|
||||
evaluatePrice = (long) (evaluatePrice * houseFloorRate);
|
||||
}
|
||||
}else{
|
||||
double num;
|
||||
int mid = evaluation.getHeight()/2;
|
||||
if(evaluation.getHeight() == evaluation.getFloor()){
|
||||
num = 1 + (evaluation.getFloor() - mid -1) * 0.004 -0.001;
|
||||
}else{
|
||||
if(evaluation.getFloor() < mid){
|
||||
num = 1- (mid - evaluation.getFloor()) * 0.006;
|
||||
}else{
|
||||
num = 1 + (evaluation.getFloor() - mid) * 0.004;
|
||||
}
|
||||
}
|
||||
evaluatePrice = (long) (evaluatePrice * num * houseFloorRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (chamberRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * chamberRate);
|
||||
}
|
||||
if (directionRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * directionRate);
|
||||
}
|
||||
|
||||
if (insideposRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * insideposRate);
|
||||
}
|
||||
|
||||
if (sightRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * sightRate);
|
||||
}
|
||||
|
||||
if (lightingVentilationRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * lightingVentilationRate);
|
||||
}
|
||||
|
||||
if (noiseRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * noiseRate);
|
||||
}
|
||||
|
||||
if (sidesetRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * sidesetRate);
|
||||
}
|
||||
|
||||
if (worryFacilityRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * worryFacilityRate);
|
||||
}
|
||||
|
||||
if (carportRate > 0) {
|
||||
evaluatePrice = (long) (evaluatePrice * carportRate);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(evaluation.getSource()) && !evaluation.getSource().equals("api_property_evaluate_rent")){
|
||||
if (null != evaluation.getFitmentAge() && evaluation.getFitmentAge() > 0 && null != evaluation.getFitmentCharge()
|
||||
&& evaluation.getFitmentCharge() > 0) {
|
||||
// 输入了装修年限和装修价格
|
||||
evaluatePrice = (long) (evaluatePrice + evaluation.getFitmentCharge() * fitmentAgeRate);
|
||||
}
|
||||
}
|
||||
if(fitmentRate > 0){
|
||||
if(evaluatePrice > 10000000){
|
||||
fitmentRate = (float) (fitmentRate + 0.01);
|
||||
}
|
||||
|
||||
evaluatePrice = (long)(evaluatePrice * fitmentRate);
|
||||
}
|
||||
|
||||
if (null != evaluation.getGardenArea() && evaluation.getGardenArea() > 0) {
|
||||
evaluatePrice = (long) ((gardenAreaRate * evaluation.getGardenArea()/evaluation.getArea() + 1) * evaluatePrice);
|
||||
}
|
||||
|
||||
if (null != evaluation.getBasementArea() && evaluation.getBasementArea() > 0) {
|
||||
evaluatePrice = (long) ((basementAreaRate * evaluation.getBasementArea()/ evaluation.getArea() + 1) * evaluatePrice);
|
||||
}
|
||||
|
||||
if (null != evaluation.getAtticArea() && evaluation.getAtticArea() > 0) {
|
||||
evaluatePrice = (long) ((atticAreaRate * evaluation.getAtticArea()/ evaluation.getArea() + 1) * evaluatePrice);
|
||||
}
|
||||
|
||||
if (null != evaluation.getTerraceArea() && evaluation.getTerraceArea() > 0) {
|
||||
evaluatePrice = (long) ((outerAreaRate * evaluation.getTerraceArea()/ evaluation.getArea() + 1) * evaluatePrice);
|
||||
}
|
||||
|
||||
if (floorSpaceRate > 0) {
|
||||
evaluatePrice = (long) (floorSpaceRate * evaluatePrice);
|
||||
}
|
||||
if (policyRate > 0) {
|
||||
evaluatePrice = (long) (policyRate * evaluatePrice);
|
||||
}
|
||||
if(evaluation.getCarportPrice() !=null){
|
||||
evaluatePrice = (long)(evaluatePrice + evaluation.getCarportPrice().intValue());
|
||||
}
|
||||
return evaluatePrice;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long evaluationRent(double districtSqmetreRent, Evaluation evaluation) {
|
||||
if (districtSqmetreRent < 0 && evaluation != null) {
|
||||
return 0;
|
||||
}
|
||||
long evaluatePrice = (long) (districtSqmetreRent * (null == evaluation.getArea() ? 0 : evaluation.getArea()));
|
||||
evaluatePrice = getEvaluationRatePrice(evaluatePrice, evaluation);
|
||||
return evaluatePrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现估价的功能
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user