Merge remote-tracking branch 'origin/master'

This commit is contained in:
2022-05-19 18:39:38 +08:00
7 changed files with 83 additions and 25 deletions
@@ -215,6 +215,11 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
seawater.setFloor(source.getInt("floor"));
}catch(Exception e){
seawater.setFloor(0);
}
try{
seawater.setFloorInfo(source.getString("floor_info"));
}catch(Exception e){
}
if(source.containsKey("fitment")){
seawater.setFitment(source.getString("fitment"));
@@ -243,6 +248,14 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
if(source.containsKey("root")){
seawater.setRoot(source.getString("root"));
}
if(source.containsKey("estate_type")){
seawater.setEstateType(source.getString("estate_type"));
}
if(source.containsKey("build_type")){
seawater.setBuildType(source.getString("build_type"));
}
seawaterList.add(seawater);
}
return seawaterList;
@@ -391,11 +404,11 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
}
// ²»Õ¹Ê¾É¾³ý
JSONObject param = new JSONObject();
param.put("status", 0);
JSONObject temp = new JSONObject();
temp.put("term", param);
jsonList.add(temp);
// JSONObject param = new JSONObject();
// param.put("status", 0);
// JSONObject temp = new JSONObject();
// temp.put("term", param);
// jsonList.add(temp);
query.put("must", jsonList);
q.put("bool", query);
@@ -48,6 +48,7 @@ public class Seawater implements SeawaterEntity {
private Double area;
private Integer height;
private Integer floor;
private String floorInfo;
private String fitment;
private Integer room;
private Integer hall;
@@ -60,6 +61,7 @@ public class Seawater implements SeawaterEntity {
private Integer avgPrice;
private String purpose;
private String estateType;
private String buildType;
@Id
@Column(name = "_id")
@@ -197,6 +199,15 @@ public class Seawater implements SeawaterEntity {
this.floor = floor;
}
@Column(name = "floorInfo")
public String getFloorInfo() {
return floorInfo;
}
public void setFloorInfo(String floorInfo) {
this.floorInfo = floorInfo;
}
@Column(name = "fitment")
public String getFitment() {
return fitment;
@@ -305,4 +316,13 @@ public class Seawater implements SeawaterEntity {
public void setEstateType(String estateType) {
this.estateType = estateType;
}
@Column(name = "build_type")
public String getBuildType() {
return buildType;
}
public void setBuildType(String buildType) {
this.buildType = buildType;
}
}
@@ -203,6 +203,15 @@ public class AuctionController {
if(StringUtils.isNotBlank(model.getName())){
params.add(new QueryParam("matchName", model.getName()));
}
Date startDate = null;
if(StringUtils.isNotBlank(model.getStartDate())){
startDate = DateUtil.parseDate(model.getStartDate(),"yyyyMMdd");
if(startDate != null){
params.add(new QueryParam("startDate", startDate));
}
}
List<SortParam> sortParams = new ArrayList<SortParam>();
sortParams.add(new SortParam("startDate", false));
List<PaiMai> paimais = paiMaiService.findAll(params, sortParams, model.getLimit(), SEARCH_FIELDS);
@@ -421,7 +421,9 @@ public class HouseController {
district = districtService.findDistrict(districtKey, "district");
}else{
district = districtService.findDistrictById(model.getId());
districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName());
if(district!=null){
districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName());
}
}
if(district == null){
@@ -1171,11 +1171,12 @@ public class PropertyController {
districtPriceMap.put("district", district.getRegion());
districtPriceMap.put("name", district.getName());
long totalPrice = evaluation.getBigTotalPrice();
if(CITY_CORRECTION_FACTOR.containsKey(district.getCity())){
totalPrice = (long)(totalPrice * (1 - CITY_CORRECTION_FACTOR.get(district.getCity())));
evaluation.setBigTotalPrice(totalPrice);
evaluation.setAvgPrice((int)(totalPrice/evaluation.getArea()));
}
// 取消系数下调
// if(CITY_CORRECTION_FACTOR.containsKey(district.getCity())){
// totalPrice = (long)(totalPrice * (1 - CITY_CORRECTION_FACTOR.get(district.getCity())));
// evaluation.setBigTotalPrice(totalPrice);
// evaluation.setAvgPrice((int)(totalPrice/evaluation.getArea()));
// }
districtPriceMap.put("totalPrice", evaluation.getBigTotalPrice());
districtPriceMap.put("unitPrice", evaluation.getAvgPrice());
List<String> names = new ArrayList<String>();
@@ -1217,7 +1218,7 @@ public class PropertyController {
}else if(district.getLng() != null && district.getLng() > 0){
double lng = DataUtil.roundDouble(district.getLng() / 10000000000.0,6);
double lat = DataUtil.roundDouble(district.getLat() / 10000000000.0, 6);
List<District> districts = districtService.findNearestDistrict(district.getEstateType2(), lng, lat, 1000 * 3 , 4, null);
List<District> districts = districtService.findNearestDistrict(district.getEstateType2(), lng, lat, 1000 * 3 , 6, null);
if(districts.size() < 2){
evaluationService.remove(evaluation.getId());
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData());
@@ -1255,9 +1256,15 @@ public class PropertyController {
districtDto.append("buildYear", String.valueOf(buildYear));
}
districtAnalyData = districtAnalyDataService.findByDistrictKey(new DistrictKey(d));
if(districtAnalyData != null && districtAnalyData.getHalfYearMarkup() != null){
districtDto.append("halfYearMarkup",DataUtil.roundDouble( districtAnalyData.getHalfYearMarkup() * 100 ,2));
if(districtAnalyData != null){
if (districtAnalyData.getHalfYearMarkup() != null) {
districtDto.append("halfYearMarkup", DataUtil.roundDouble(districtAnalyData.getHalfYearMarkup() * 100, 2));
}
if (districtAnalyData.getAvgPrice() != null && minPrice <= districtAnalyData.getAvgPrice() && maxPrice >= districtAnalyData.getAvgPrice()) {
districtDto.append("avgPrice", districtAnalyData.getAvgPrice());
}
}
nearCommunityDtos.add(districtDto);
}
Integer buildYear = districtService.getBuildYear(district);
@@ -18,6 +18,7 @@ public class AuctionModel extends FangjiaApiModel{
private Integer propertyType;
private Integer status;
private Integer limit = 10;
private String startDate;
public String getId() {
return id;
@@ -130,4 +131,12 @@ public class AuctionModel extends FangjiaApiModel{
public void setName(String name) {
this.name = name;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
}
@@ -1,12 +1,12 @@
package com.fangjia.service.address;
import com.fangjia.core.RegionData;
import com.fangjia.core.util.*;
import com.fangjia.core.util.DataUtil;
import com.fangjia.core.util.GeoUtils;
import com.fangjia.dal.QueryParam;
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.AmapPoi;
import com.fangjia.dal.mongo.model.bkoff.HouseLoudong;
import com.fangjia.dal.mongo.model.bkoff.Loudong;
import com.fangjia.dal.seaweed.dao.SeaweedDao;
@@ -16,17 +16,15 @@ import com.fangjia.service.address.processor.AddressDistrictProcessors;
import com.fangjia.service.address.processor.AddressProcessors;
import com.fangjia.service.api.AliyunService;
import com.fangjia.service.bo.AliyunBo;
import com.fangjia.service.bo.MatchAddressScore;
import com.fangjia.service.datastore.DistrictService;
import com.fangjia.service.mongo.addrepo.AddressRepoService;
import com.fangjia.service.mongo.bkoff.HouseLoudongService;
import com.fangjia.service.mongo.bkoff.LoudongService;
import com.google.common.base.Function;
import com.google.common.collect.MapMaker;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.bson.types.ObjectId;
import java.util.*;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
@@ -916,23 +914,23 @@ public class AddressParserServiceImpl implements AddressParserService {
} else if (standardAddressScore > 0) {
matchLevelScore = 0.8;
similarityScore = standardAddressScore * SIMILARITY_RATE;
}else if(metaData.getId().equals(address.getPolygonSeaweedId())){
matchLevelScore = 0.7;
similarityScore = 0.05;
} else if(keywordScore > 0 && streetScore > 0){
matchLevelScore = 0.6;
matchLevelScore = 0.7;
similarityScore = Math.max(streetScore, keywordScore * 0.8) * SIMILARITY_RATE;
} else if (keywordScore > 0) {
matchLevelScore = 0.5;
matchLevelScore = 0.6;
similarityScore = keywordScore * SIMILARITY_RATE;
} else if (fuzzyKeywordsScore > 0) {
if(address.hasCoordinate() && metaData.getLng() != null && GeoUtils.calculateDistance(address.getLng(), address.getLat(),
metaData.getLng(), metaData.getLat()) < 100){
matchLevelScore = 0.6;
matchLevelScore = 0.7;
}else{
matchLevelScore = 0.4;
}
similarityScore = fuzzyKeywordsScore * SIMILARITY_RATE;
}else if(metaData.getId().equals(address.getPolygonSeaweedId())){
matchLevelScore = 0.4;
similarityScore = 0.05;
}
if (similarityScore > 0) {
if(metaData.getBuildingType() != null){