Merge branch 'master' of http://gitlab.fangjia.com/dev0/main into script_gj
This commit is contained in:
@@ -25,6 +25,7 @@ import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import com.hankcs.hanlp.HanLP;
|
||||
import com.hankcs.hanlp.dictionary.py.Pinyin;
|
||||
import com.sun.javafx.scene.transform.TransformUtils;
|
||||
import net.sf.json.JSON;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONNull;
|
||||
@@ -1824,11 +1825,26 @@ public class DataUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(getFirstChar("文裕花园"));
|
||||
System.out.println(getFirstChar("文怡花园"));
|
||||
public static boolean isChineseChar(String c) {
|
||||
if (StringUtils.isNotBlank(c)) {
|
||||
String temp = String.valueOf(c);
|
||||
Pattern pattern = Pattern.compile("[\\u4e00-\\u9fa5\\w]+");
|
||||
Matcher matcher = pattern.matcher(temp);
|
||||
return matcher.matches();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
System.out.println(FourUpSixInto("258.393", 2));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(isChineseChar("6文怡a花园"));
|
||||
// System.out.println(getFirstChar("文怡花园"));
|
||||
//
|
||||
// System.out.println(FourUpSixInto("258.393", 2));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
package com.fangjia.core.util;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class SeaweedUtils {
|
||||
public static void main(String[] args){
|
||||
System.out.println(formatVirescencePercent("1"));
|
||||
}
|
||||
/**
|
||||
* 标准化输出绿化率
|
||||
*/
|
||||
public static String formatVirescencePercent(String virescence_percent) {
|
||||
// 绿化率
|
||||
if (StringUtils.isNotBlank(virescence_percent) && checkValue(virescence_percent)!=null) {
|
||||
double val = Double.valueOf(virescence_percent);
|
||||
if (val < 1) {
|
||||
return String.valueOf(val * 100);
|
||||
}
|
||||
if (val == 1) {
|
||||
return String.valueOf(val * 10);
|
||||
}
|
||||
if (val >= 70) {
|
||||
return "65";
|
||||
}
|
||||
return String.valueOf(val);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准化容积率输出
|
||||
*/
|
||||
public static String formatCubagePercent(String cubage_percent) {
|
||||
if (StringUtils.isNotBlank(cubage_percent) && checkValue(cubage_percent)!=null) {
|
||||
double val = Double.valueOf(cubage_percent);
|
||||
if (val >= 7 && val < 8) {
|
||||
return "6.2";
|
||||
}
|
||||
if (val >= 8 && val < 9) {
|
||||
return "6.3";
|
||||
}
|
||||
if (val >= 9 && val < 10) {
|
||||
return "6.5";
|
||||
}
|
||||
if (val >= 10) {
|
||||
return "6.7";
|
||||
}
|
||||
return String.valueOf(val);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准化车位输出
|
||||
*/
|
||||
public static String formatCarSiteCount(String car_site_count) {
|
||||
if (StringUtils.isNotBlank(car_site_count) && checkValue(car_site_count)!=null) {
|
||||
long val = Long.valueOf(car_site_count);
|
||||
if (val > 2500 || val < 100) {
|
||||
return "";
|
||||
}
|
||||
return String.valueOf(val);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准化户数输出
|
||||
*/
|
||||
public static String formatHouseholdCount(String household_count) {
|
||||
if (StringUtils.isNotBlank(household_count) && checkValue(household_count)!=null ) {
|
||||
if (Integer.valueOf(household_count) < 50) {
|
||||
return null; // 户数
|
||||
}
|
||||
return household_count;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准化总占地面积输出
|
||||
*/
|
||||
public static String formatAllArea(String all_area) {
|
||||
if (StringUtils.isNotBlank(all_area)) {
|
||||
Double formattedVal = 0.0;
|
||||
if (all_area.toString().indexOf("公顷") != -1) {
|
||||
String val = all_area.toString();
|
||||
formattedVal = (Double.valueOf(val.substring(0, val.indexOf("公顷"))) * 10000);
|
||||
} else if(checkValue(all_area)!=null) {
|
||||
formattedVal = Double.valueOf(all_area);
|
||||
}
|
||||
if (formattedVal > 100000 || formattedVal == 0.0) {
|
||||
return null;
|
||||
}
|
||||
return String.valueOf(formattedVal);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取浮点数与整数
|
||||
*/
|
||||
static String getNumber(String input) {
|
||||
Pattern pattern = Pattern.compile("\\d+(\\.\\d+)?");
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
List<String> list = new ArrayList();
|
||||
while (matcher.find()) {
|
||||
list.add(matcher.group());
|
||||
}
|
||||
if(list.size()>0){
|
||||
return list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static Float checkValue(String value){
|
||||
if(StringUtils.isNotBlank(value)){
|
||||
value = getNumber(value);
|
||||
if(StringUtils.isNotBlank(value)){
|
||||
value = subZeroAndDot(value);
|
||||
if(isNumber(value)){
|
||||
Float v = Float.parseFloat(value);
|
||||
if(v>0){
|
||||
return v;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}else if(isFloat(value)){
|
||||
Float v = Float.parseFloat(value);
|
||||
if(v>0){
|
||||
return v;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
} else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static boolean isNumber(String str){
|
||||
try {
|
||||
Integer.parseInt(str);
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static boolean isFloat(String str){
|
||||
try {
|
||||
Float.parseFloat(str);
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 正则表达式去掉多余的.与0
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
static String subZeroAndDot(String v){
|
||||
|
||||
if(StringUtils.isNotBlank(v)){
|
||||
if(v.indexOf(".")!=-1){
|
||||
Double myNum2 = Double.valueOf(v);
|
||||
BigDecimal b = new java.math.BigDecimal(myNum2);
|
||||
Double myNum3 = b.setScale(2, java.math.BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
v = myNum3.toString();
|
||||
}
|
||||
|
||||
if(v.indexOf(".")>-1){
|
||||
while(true)
|
||||
{
|
||||
if(v.endsWith("0")){
|
||||
v = v.substring(0,v.length()-1);
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(v.endsWith(".")){
|
||||
v=v.substring(0,v.length()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
+32
-1
@@ -1,5 +1,9 @@
|
||||
package com.fangjia.coresite.controllers;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -7,6 +11,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fangjia.core.util.DataUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.fangjia.coresite.model.JsonModel;
|
||||
@@ -37,7 +42,7 @@ public class SaleLeadsController {
|
||||
}
|
||||
|
||||
public Object doAddAction(SaleLeadsModel model, HttpServletRequest req,
|
||||
HttpServletResponse res) {
|
||||
HttpServletResponse res) throws UnsupportedEncodingException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
||||
|
||||
model.setViewType("redirect");
|
||||
String refUrl = model.getBackUrl();
|
||||
@@ -122,6 +127,8 @@ public class SaleLeadsController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
saleLeads = converValue(saleLeads);
|
||||
saleLeadsService.save(saleLeads);
|
||||
|
||||
if(StringUtils.isNotBlank(saleLeads.getBusiness()) && saleLeads.getBusiness().contains("_")){
|
||||
@@ -162,6 +169,30 @@ public class SaleLeadsController {
|
||||
model.setViewParam("location", url);
|
||||
return model;
|
||||
}
|
||||
|
||||
private SaleLeads converValue(SaleLeads saleLeads) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, UnsupportedEncodingException {
|
||||
//
|
||||
Field[] fields = saleLeads.getClass().getDeclaredFields();
|
||||
for(Field s : fields){
|
||||
String name = s.getName();
|
||||
String type = s.getGenericType().toString();
|
||||
if(type.contains("java.lang.String")){
|
||||
String fildName = name.substring(0,1).toUpperCase()+name.substring(1);
|
||||
Method m = saleLeads.getClass().getMethod("get"+fildName);
|
||||
String value = (String)m.invoke(saleLeads);
|
||||
if(StringUtils.isNotBlank(value)){
|
||||
String s1 = value.replaceAll("\\pP|\\pS", "");
|
||||
if(!DataUtil.isChineseChar(s1)){
|
||||
String newValue = new String(value.getBytes("ISO8859-1"), "UTF-8");
|
||||
m = saleLeads.getClass().getMethod("set"+fildName,String.class);
|
||||
m.invoke(saleLeads, newValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return saleLeads;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Object addDownInfoAction(SaleLeadsModel model, HttpServletRequest req,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDao;
|
||||
import com.fangjia.dal.mongo.model.BsEvaluation;
|
||||
|
||||
public interface BsEvaluationDao extends MongoDao<BsEvaluation> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.model.BsEvaluation;
|
||||
|
||||
public class BsEvaluationDaoImpl extends MongoDaoImpl<BsEvaluation> implements
|
||||
BsEvaluationDao {
|
||||
}
|
||||
@@ -99,6 +99,9 @@ public class PaiMai implements MongoEntity {
|
||||
private Integer marketAvgPrice;
|
||||
/**物业类型*/
|
||||
private String matchEstateType;
|
||||
private String houseNum;
|
||||
private String unitNum;
|
||||
private String roomNum;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@@ -488,4 +491,28 @@ public class PaiMai implements MongoEntity {
|
||||
public void setMatchEstateType(String matchEstateType) {
|
||||
this.matchEstateType = matchEstateType;
|
||||
}
|
||||
|
||||
public String getHouseNum() {
|
||||
return houseNum;
|
||||
}
|
||||
|
||||
public void setHouseNum(String houseNum) {
|
||||
this.houseNum = houseNum;
|
||||
}
|
||||
|
||||
public String getUnitNum() {
|
||||
return unitNum;
|
||||
}
|
||||
|
||||
public void setUnitNum(String unitNum) {
|
||||
this.unitNum = unitNum;
|
||||
}
|
||||
|
||||
public String getRoomNum() {
|
||||
return roomNum;
|
||||
}
|
||||
|
||||
public void setRoomNum(String roomNum) {
|
||||
this.roomNum = roomNum;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
package com.fangjia.dal.mongo.model;
|
||||
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "business.evaluation")
|
||||
public class BsEvaluation implements MongoEntity {
|
||||
private String id;
|
||||
private String fullAddress;
|
||||
private String commid;
|
||||
private String cityName;
|
||||
private String distName;
|
||||
private String commName;
|
||||
private String address;
|
||||
private Double buildArea;
|
||||
private Integer floor;
|
||||
private Integer floorcnt;
|
||||
private Integer roomcnt;
|
||||
private Integer livingroomcnt;
|
||||
private String houseaspect;//ÄÏ
|
||||
private String fitment;
|
||||
private Date cDate;
|
||||
private Integer unitPrice;
|
||||
private Integer totalPrice;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
@Column(name = "_id")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Column(name = "full_address")
|
||||
public String getFullAddress() {
|
||||
return fullAddress;
|
||||
}
|
||||
|
||||
public void setFullAddress(String fullAddress) {
|
||||
this.fullAddress = fullAddress;
|
||||
}
|
||||
|
||||
@Column(name = "commid")
|
||||
public String getCommid() {
|
||||
return commid;
|
||||
}
|
||||
|
||||
public void setCommid(String commid) {
|
||||
this.commid = commid;
|
||||
}
|
||||
|
||||
@Column(name = "cityname")
|
||||
public String getCityName() {
|
||||
return cityName;
|
||||
}
|
||||
|
||||
public void setCityName(String cityName) {
|
||||
this.cityName = cityName;
|
||||
}
|
||||
|
||||
@Column(name = "distname")
|
||||
public String getDistName() {
|
||||
return distName;
|
||||
}
|
||||
|
||||
public void setDistName(String distName) {
|
||||
this.distName = distName;
|
||||
}
|
||||
|
||||
@Column(name = "commname")
|
||||
public String getCommName() {
|
||||
return commName;
|
||||
}
|
||||
|
||||
public void setCommName(String commName) {
|
||||
this.commName = commName;
|
||||
}
|
||||
|
||||
@Column(name = "address")
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
@Column(name = "buildarea")
|
||||
public Double getBuildArea() {
|
||||
return buildArea;
|
||||
}
|
||||
|
||||
public void setBuildArea(Double buildArea) {
|
||||
this.buildArea = buildArea;
|
||||
}
|
||||
|
||||
@Column(name = "floor")
|
||||
public Integer getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
public void setFloor(Integer floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
@Column(name = "floorcnt")
|
||||
public Integer getFloorcnt() {
|
||||
return floorcnt;
|
||||
}
|
||||
|
||||
public void setFloorcnt(Integer floorcnt) {
|
||||
this.floorcnt = floorcnt;
|
||||
}
|
||||
|
||||
@Column(name = "roomcnt")
|
||||
public Integer getRoomcnt() {
|
||||
return roomcnt;
|
||||
}
|
||||
|
||||
public void setRoomcnt(Integer roomcnt) {
|
||||
this.roomcnt = roomcnt;
|
||||
}
|
||||
|
||||
@Column(name = "livingroomcnt")
|
||||
public Integer getLivingroomcnt() {
|
||||
return livingroomcnt;
|
||||
}
|
||||
|
||||
public void setLivingroomcnt(Integer livingroomcnt) {
|
||||
this.livingroomcnt = livingroomcnt;
|
||||
}
|
||||
|
||||
@Column(name = "houseaspect")
|
||||
public String getHouseaspect() {
|
||||
return houseaspect;
|
||||
}
|
||||
|
||||
public void setHouseaspect(String houseaspect) {
|
||||
this.houseaspect = houseaspect;
|
||||
}
|
||||
|
||||
@Column(name = "fitment")
|
||||
public String getFitment() {
|
||||
return fitment;
|
||||
}
|
||||
|
||||
public void setFitment(String fitment) {
|
||||
this.fitment = fitment;
|
||||
}
|
||||
|
||||
@Column(name = "c_date")
|
||||
public Date getcDate() {
|
||||
return cDate;
|
||||
}
|
||||
|
||||
public void setcDate(Date cDate) {
|
||||
this.cDate = cDate;
|
||||
}
|
||||
|
||||
@Column(name = "unitprice")
|
||||
public Integer getUnitPrice() {
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
public void setUnitPrice(Integer unitPrice) {
|
||||
this.unitPrice = unitPrice;
|
||||
}
|
||||
|
||||
@Column(name = "totalprice")
|
||||
public Integer getTotalPrice() {
|
||||
return totalPrice;
|
||||
}
|
||||
|
||||
public void setTotalPrice(Integer totalPrice) {
|
||||
this.totalPrice = totalPrice;
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,7 @@ public class DistrictFacilitys implements MongoEntity {
|
||||
private String imgUrl3D;
|
||||
|
||||
private List<String> school;
|
||||
private List<String> keySchool;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@@ -380,4 +381,12 @@ public class DistrictFacilitys implements MongoEntity {
|
||||
this.school = school;
|
||||
}
|
||||
|
||||
@Column(name = "key_school")
|
||||
public List<String> getKeySchool() {
|
||||
return keySchool;
|
||||
}
|
||||
|
||||
public void setKeySchool(List<String> keySchool) {
|
||||
this.keySchool = keySchool;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,11 @@ public class DealPrice implements MongoEntity {
|
||||
private Integer floor;//当前楼层
|
||||
private Long score;
|
||||
|
||||
private String matchId;
|
||||
private String matchCity;
|
||||
private String matchRegion;
|
||||
private String matchName;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@Column(name = "_id", unique = true, nullable = false)
|
||||
@@ -296,4 +301,40 @@ public class DealPrice implements MongoEntity {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Column(name = "match_id")
|
||||
public String getMatchId() {
|
||||
return matchId;
|
||||
}
|
||||
|
||||
public void setMatchId(String matchId) {
|
||||
this.matchId = matchId;
|
||||
}
|
||||
|
||||
@Column(name = "match_city")
|
||||
public String getMatchCity() {
|
||||
return matchCity;
|
||||
}
|
||||
|
||||
public void setMatchCity(String matchCity) {
|
||||
this.matchCity = matchCity;
|
||||
}
|
||||
|
||||
@Column(name = "match_region")
|
||||
public String getMatchRegion() {
|
||||
return matchRegion;
|
||||
}
|
||||
|
||||
public void setMatchRegion(String matchRegion) {
|
||||
this.matchRegion = matchRegion;
|
||||
}
|
||||
|
||||
@Column(name = "match_name")
|
||||
public String getMatchName() {
|
||||
return matchName;
|
||||
}
|
||||
|
||||
public void setMatchName(String matchName) {
|
||||
this.matchName = matchName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,6 +448,7 @@ public class HouseLoudong extends com.fangjia.dal.mongo.model.HouseLoudong{
|
||||
this.openTotalPrice = openTotalPrice;
|
||||
}
|
||||
|
||||
@Column(name = "district_id")
|
||||
public String getDistrictId() {
|
||||
return districtId;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,11 @@ public class Loudong implements MongoEntity {
|
||||
* seaweed中的小区名
|
||||
*/
|
||||
private String nameInSeaweed;
|
||||
|
||||
/**
|
||||
* seaweed中的小区id
|
||||
*/
|
||||
private String idInSeaweed;
|
||||
|
||||
@Column(name = "remark")
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
@@ -402,4 +406,13 @@ public class Loudong implements MongoEntity {
|
||||
public void setNameInSeaweed(String nameInSeaweed) {
|
||||
this.nameInSeaweed = nameInSeaweed;
|
||||
}
|
||||
|
||||
@Column(name = "id_in_seaweed")
|
||||
public String getIdInSeaweed() {
|
||||
return idInSeaweed;
|
||||
}
|
||||
|
||||
public void setIdInSeaweed(String idInSeaweed) {
|
||||
this.idInSeaweed = idInSeaweed;
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.fangjia.dal.mongo.open.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDao;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityBasePrice;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
|
||||
public interface CommunityBasePriceDao extends MongoDao<CommunityBasePrice> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.fangjia.dal.mongo.open.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDao;
|
||||
import com.fangjia.dal.mongo.model.CountDistrictStatBycity;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
|
||||
public interface CommunityPoiDao extends MongoDao<CommunityPoi> {
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.fangjia.dal.mongo.open.dao.impl;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.open.dao.CommunityBasePriceDao;
|
||||
import com.fangjia.dal.mongo.open.dao.CommunityPoiDao;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityBasePrice;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
|
||||
public class CommunityBasePriceDaoImpl extends MongoDaoImpl<CommunityBasePrice> implements CommunityBasePriceDao {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.fangjia.dal.mongo.open.dao.impl;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.open.dao.ApiVisitCountDao;
|
||||
import com.fangjia.dal.mongo.open.dao.CommunityPoiDao;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
import com.fangjia.dal.mongo.tool.model.ApiVisitCount;
|
||||
|
||||
public class CommunityPoiDaoImpl extends MongoDaoImpl<CommunityPoi> implements CommunityPoiDao {
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.fangjia.dal.mongo.open.model;
|
||||
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* Ð¡Çø½¨ÐÐÖÃÐŶÈÐÅÏ¢
|
||||
*
|
||||
* @author shenjian@fangjia.com
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "business.community_base_price_gj")
|
||||
public class CommunityBasePrice implements MongoEntity {
|
||||
|
||||
private static final long serialVersionUID = -8010010773207622878L;
|
||||
|
||||
private String id;
|
||||
private String city;
|
||||
private String region;
|
||||
private String name;
|
||||
private Double credit;
|
||||
|
||||
@Id
|
||||
@Column(name = "_id")
|
||||
@Override
|
||||
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 = "name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Column(name = "credit")
|
||||
public Double getCredit() {
|
||||
return credit;
|
||||
}
|
||||
|
||||
public void setCredit(Double credit) {
|
||||
this.credit = credit;
|
||||
}
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
package com.fangjia.dal.mongo.open.model;
|
||||
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 小区周边配套统计信息
|
||||
*
|
||||
* @author shenjian@fangjia.com
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "fangjia_stat.community_poi_gj")
|
||||
public class CommunityPoi implements MongoEntity {
|
||||
|
||||
private static final long serialVersionUID = -7663644539542318409L;
|
||||
|
||||
private String id;
|
||||
private String city;
|
||||
private String region;
|
||||
private String name;
|
||||
private Integer subway;
|
||||
private Integer traffic;
|
||||
private Integer bank;
|
||||
private Integer primary;
|
||||
private Integer junior;
|
||||
private Integer hospital;
|
||||
/**
|
||||
* 不利设施,丧葬
|
||||
*/
|
||||
private Integer funeral;
|
||||
|
||||
@Id
|
||||
@Column(name = "_id")
|
||||
@Override
|
||||
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 = "name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Column(name = "subway")
|
||||
public Integer getSubway() {
|
||||
return subway;
|
||||
}
|
||||
|
||||
public void setSubway(Integer subway) {
|
||||
this.subway = subway;
|
||||
}
|
||||
|
||||
@Column(name = "traffic")
|
||||
public Integer getTraffic() {
|
||||
return traffic;
|
||||
}
|
||||
|
||||
public void setTraffic(Integer traffic) {
|
||||
this.traffic = traffic;
|
||||
}
|
||||
|
||||
@Column(name = "bank")
|
||||
public Integer getBank() {
|
||||
return bank;
|
||||
}
|
||||
|
||||
public void setBank(Integer bank) {
|
||||
this.bank = bank;
|
||||
}
|
||||
|
||||
@Column(name = "primary")
|
||||
public Integer getPrimary() {
|
||||
return primary;
|
||||
}
|
||||
|
||||
public void setPrimary(Integer primary) {
|
||||
this.primary = primary;
|
||||
}
|
||||
|
||||
@Column(name = "junior")
|
||||
public Integer getJunior() {
|
||||
return junior;
|
||||
}
|
||||
|
||||
public void setJunior(Integer junior) {
|
||||
this.junior = junior;
|
||||
}
|
||||
|
||||
@Column(name = "hospital")
|
||||
public Integer getHospital() {
|
||||
return hospital;
|
||||
}
|
||||
|
||||
public void setHospital(Integer hospital) {
|
||||
this.hospital = hospital;
|
||||
}
|
||||
|
||||
@Column(name = "funeral")
|
||||
public Integer getFuneral() {
|
||||
return funeral;
|
||||
}
|
||||
|
||||
public void setFuneral(Integer funeral) {
|
||||
this.funeral = funeral;
|
||||
}
|
||||
}
|
||||
+30
-5
@@ -67,6 +67,8 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
must.add(addTerms("district_name", alias));
|
||||
must.add(addMatch("cat", "sell"));
|
||||
must.add(addRange("avg_price", minPrice, maxPrice));
|
||||
must.add(addRangeGte("p_date", 20210501));
|
||||
|
||||
bool.put("must", must);
|
||||
query.put("bool", bool);
|
||||
reqBody.put("query", query);
|
||||
@@ -161,6 +163,16 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
||||
return term;
|
||||
}
|
||||
|
||||
private JSONObject addRangeGte(String name, Number min){
|
||||
JSONObject term = new JSONObject();
|
||||
JSONObject range = new JSONObject();
|
||||
JSONObject rangeValue = new JSONObject();
|
||||
rangeValue.put("gte", min);
|
||||
range.put(name, rangeValue);
|
||||
term.put("range", range);
|
||||
return term;
|
||||
}
|
||||
|
||||
|
||||
private List<Seawater> wrapSeawater(List<JSONObject> jsonList){
|
||||
List<Seawater> seawaterList= new ArrayList<Seawater>();
|
||||
@@ -203,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"));
|
||||
@@ -231,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;
|
||||
@@ -379,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;
|
||||
@@ -58,6 +59,9 @@ public class Seawater implements SeawaterEntity {
|
||||
private String url;
|
||||
private String root;
|
||||
private Integer avgPrice;
|
||||
private String purpose;
|
||||
private String estateType;
|
||||
private String buildType;
|
||||
|
||||
@Id
|
||||
@Column(name = "_id")
|
||||
@@ -195,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;
|
||||
@@ -285,4 +298,31 @@ public class Seawater implements SeawaterEntity {
|
||||
public void setAvgPrice(Integer avgPrice) {
|
||||
this.avgPrice = avgPrice;
|
||||
}
|
||||
|
||||
@Column(name = "purpose")
|
||||
public String getPurpose() {
|
||||
return purpose;
|
||||
}
|
||||
|
||||
public void setPurpose(String purpose) {
|
||||
this.purpose = purpose;
|
||||
}
|
||||
|
||||
@Column(name = "estate_type")
|
||||
public String getEstateType() {
|
||||
return estateType;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
+48
-3
@@ -1797,6 +1797,51 @@ public class AddressController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
/**
|
||||
* 五级行政区划V2地址标准化接口
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object fiveDivisionStructure2Action(AddesssMatchModel model) {
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getAddress())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
|
||||
params.put("address", model.getAddress());
|
||||
// 地址验证无效也输出标准化结果
|
||||
params.put("flag", "true");
|
||||
try{
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8");
|
||||
} catch(Exception e){
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8");
|
||||
} catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("status");
|
||||
String msg = json.getString("msg");
|
||||
BasicModel basicModel = new BasicModel(code, msg);
|
||||
if(json.containsKey("result")){
|
||||
basicModel.setResult(json.get("result"));
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
} else {
|
||||
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
/**
|
||||
* 详细地址标准化接口
|
||||
*
|
||||
@@ -1847,7 +1892,7 @@ public class AddressController {
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object structureForTestAction(AddesssMatchModel model) {
|
||||
public Object structureAndCompleteAction(AddesssMatchModel model) {
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getAddress())) {
|
||||
@@ -1863,10 +1908,10 @@ public class AddressController {
|
||||
// 地址验证无效也输出标准化结果
|
||||
params.put("flag", "true");
|
||||
try{
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureForTest", params, "UTF-8");
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8");
|
||||
} catch(Exception e){
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureForTest", params, "UTF-8");
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8");
|
||||
} catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
+78
-2
@@ -1,6 +1,7 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import com.fangjia.core.util.DateUtil;
|
||||
import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.SortParam;
|
||||
import com.fangjia.dal.common.DistrictKey;
|
||||
@@ -14,6 +15,7 @@ import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
import com.fangjia.service.fsh.DistrictNewPriceService;
|
||||
import com.fangjia.service.open.PaiMaiService;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bson.types.ObjectId;
|
||||
|
||||
@@ -23,13 +25,14 @@ import java.util.regex.Pattern;
|
||||
/**
|
||||
* ·¨ÅÄÊý¾ÝÌṩ½Ó¿Ú
|
||||
*/
|
||||
@Authority(role = Role.USER)
|
||||
//@Authority(role = Role.USER)
|
||||
public class AuctionController {
|
||||
|
||||
|
||||
private PaiMaiService paiMaiService;
|
||||
private DistrictNewPriceService districtNewPriceService;
|
||||
private static final String[] SEARCH_FIELDS = new String[]{"marketAvgPrice", "startDate", "curPrice", "imgUrls", "id", "matchCity", "matchRegion", "matchName", "address", "marketTotalPrice", "startPrice", "curPrice", "predictPrice", "depositPrice", "area", "status", "url", "matchEstateType"};
|
||||
private static final String[] SEARCH_FIELDS = new String[]{"marketAvgPrice", "startDate", "curPrice", "imgUrls", "id", "matchCity", "matchRegion", "matchName", "address", "marketTotalPrice", "startPrice", "curPrice", "predictPrice", "depositPrice", "area", "status", "url",
|
||||
"matchEstateType","type","count", "tradeAvgPrice", "evaluationPrice"};
|
||||
|
||||
public Object housesAction(AuctionModel model){
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
@@ -187,6 +190,79 @@ public class AuctionController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
public Object searchPaimaisAction(AuctionModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
if(StringUtils.isNotBlank(model.getCity())){
|
||||
params.add(new QueryParam("matchCity", model.getCity()));
|
||||
}
|
||||
if(StringUtils.isNotBlank(model.getDistrict())){
|
||||
params.add(new QueryParam("matchRegion", model.getDistrict()));
|
||||
}
|
||||
|
||||
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", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||
}
|
||||
}
|
||||
|
||||
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||
sortParams.add(new SortParam("startDate", false));
|
||||
List<PaiMai> paimais = paiMaiService.findAll(params, sortParams, model.getLimit(), SEARCH_FIELDS);
|
||||
if(paimais!=null && paimais.size()>0){
|
||||
for(PaiMai paiMai : paimais){
|
||||
Map<String, Object> map = standard(paiMai.getCity(), paiMai.getAddress());
|
||||
if(map!=null){
|
||||
if (map.containsKey("buildingNumber")) {
|
||||
paiMai.setHouseNum((String) map.get("buildingNumber"));
|
||||
}
|
||||
if (map.containsKey("unitNumber")) {
|
||||
paiMai.setUnitNum((String) map.get("unitNumber"));
|
||||
}
|
||||
if (map.containsKey("roomNumber")) {
|
||||
paiMai.setRoomNum((String) map.get("roomNumber"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(paimais));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
private Map standard(String city, String address){
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", city);
|
||||
params.put("address", address);
|
||||
try{
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8");
|
||||
} catch(Exception e){
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8");
|
||||
} catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("status");
|
||||
String msg = json.getString("msg");
|
||||
if(json.containsKey("result")){
|
||||
return (Map)json.get("result");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setPaiMaiService(PaiMaiService paiMaiService) {
|
||||
this.paiMaiService = paiMaiService;
|
||||
}
|
||||
|
||||
+38
@@ -15,8 +15,10 @@ import java.util.Map.Entry;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.fangjia.dal.common.DistrictKey;
|
||||
import com.fangjia.dal.mongo.model.Metro;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.service.bo.DistrictStatBo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.fangjia.core.util.DateUtil;
|
||||
@@ -211,6 +213,42 @@ public class DealPriceController {
|
||||
mv.setModel(resMap);
|
||||
return mv;
|
||||
}
|
||||
|
||||
public Object searchListAction(final DealPriceModel model) {
|
||||
RestfulModelAndView mv = new RestfulModelAndView();
|
||||
mv.setViewType("rest");
|
||||
|
||||
if (StringUtils.isBlank(model.getId())) {
|
||||
mv.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "楼盘编号不能为空"));
|
||||
return mv;
|
||||
}
|
||||
District district = districtService.findDistrictById(model.getId());
|
||||
DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName());
|
||||
|
||||
if(district == null){
|
||||
mv.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||
return mv;
|
||||
}
|
||||
DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey);
|
||||
Integer minPrice = null;
|
||||
Integer maxPrice = null;
|
||||
if(bo.getDistrictStat()!=null){
|
||||
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
|
||||
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
|
||||
}
|
||||
Date startDate = null;
|
||||
Date endDate = null;
|
||||
if(StringUtils.isNotBlank(model.getStartDate())){
|
||||
startDate = DateUtil.parseDate(model.getStartDate(),"yyyyMMdd");
|
||||
}
|
||||
if(StringUtils.isNotBlank(model.getEndDate())){
|
||||
endDate = DateUtil.parseDate(model.getEndDate(),"yyyyMMdd");
|
||||
}
|
||||
|
||||
List<DealPrice> dealPrices = dealPriceService.getNearlySameDealPrice(model.getId(), minPrice, maxPrice, startDate, endDate, model.getLimit());
|
||||
mv.setModel(BasicModel.buildOKModel().setResult(dealPrices));
|
||||
return mv;
|
||||
}
|
||||
|
||||
private List<DealPrice> findDealPricesByName(String city,String region ,String name){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
+37
-16
@@ -7,11 +7,11 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.fangjia.core.RegionData;
|
||||
import com.fangjia.core.util.DateUtil;
|
||||
import com.fangjia.dal.mongo.model.RegionStat;
|
||||
import com.fangjia.dal.mongo.model.RegionStatRent;
|
||||
import com.fangjia.dal.mongo.model.*;
|
||||
import com.fangjia.open.model.AvgPriceQueryModel;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.service.datastore.RegionStatService;
|
||||
import com.fangjia.service.district.DistrictFacilitysService;
|
||||
import com.fangjia.service.district.DistrictStatRentService;
|
||||
import com.fangjia.service.district.RegionStatRentService;
|
||||
import com.fangjia.service.mongo.fangjia.AverageAnalyService;
|
||||
@@ -38,8 +38,6 @@ import com.fangjia.dal.common.DistrictKey;
|
||||
import com.fangjia.dal.common.FangjiaServerAreaContextHolder;
|
||||
import com.fangjia.dal.common.ServerAreaData;
|
||||
import com.fangjia.dal.mongo.fangjia.model.ServerArea;
|
||||
import com.fangjia.dal.mongo.model.DistrictHouse;
|
||||
import com.fangjia.dal.mongo.model.DistrictStat;
|
||||
import com.fangjia.dal.mongo.model.bkoff.ExtractDistrict;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.dal.sql.model.ApiUser;
|
||||
@@ -93,6 +91,7 @@ public class DistrictController {
|
||||
private RegionBlockService regionBlockService;
|
||||
private RegionStatService regionStatService;
|
||||
private RegionStatRentService regionStatRentService;
|
||||
private DistrictFacilitysService districtFacilitysService;
|
||||
|
||||
|
||||
public static final String[] COLUMNS = { "id", "name", "estateType", "buildType", "licence", "buildArea", "allArea",
|
||||
@@ -444,19 +443,19 @@ public class DistrictController {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object showAction(DistrictSearchModel model, @Param(name = "city") String city, @Param(name = "region") String region,
|
||||
@Param(name = "name") String name, HttpServletRequest request) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (StringUtils.isBlank(name) || StringUtils.isBlank(city) || StringUtils.isBlank(region)) {
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "小区所在城市,小区名,所在区域必必须输入"));
|
||||
return mav;
|
||||
} else {
|
||||
DistrictBo districtBo = districtService.findByFullMode(new DistrictKey(city, region, name));
|
||||
if (null == districtBo) {
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "小区数据不存在,请检查查询条件"));
|
||||
public Object showAction(DistrictSearchModel model, @Param(name = "city") String city, @Param(name = "region") String region,
|
||||
@Param(name = "name") String name, HttpServletRequest request) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (StringUtils.isBlank(name) || StringUtils.isBlank(city) || StringUtils.isBlank(region)) {
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "小区所在城市,小区名,所在区域必必须输入"));
|
||||
return mav;
|
||||
}
|
||||
} else {
|
||||
DistrictBo districtBo = districtService.findByFullMode(new DistrictKey(city, region, name));
|
||||
if (null == districtBo) {
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "小区数据不存在,请检查查询条件"));
|
||||
return mav;
|
||||
}
|
||||
districtBo.setStat(this.districtStatService.findDistrictStat(districtBo.getDistrictKey()));
|
||||
// È¥³ýÐ¡ÇøÃèÊöÖеÄhtml±êÇ©
|
||||
districtBo.setDescription(DataUtil.removeSpecialString(districtBo.getDescription()));
|
||||
@@ -1146,6 +1145,25 @@ public class DistrictController {
|
||||
ret.put("RESULT", 200);
|
||||
return mav;
|
||||
}
|
||||
|
||||
public Object facilitysAction(DistrictSearchModel model, @Param(name = "city") String city, @Param(name = "region") String region,
|
||||
@Param(name = "name") String name, HttpServletRequest request) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (StringUtils.isBlank(name) || StringUtils.isBlank(city) || StringUtils.isBlank(region)) {
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "小区所在城市,小区名,所在区域必必须输入"));
|
||||
return mav;
|
||||
} else {
|
||||
District districtBo = districtService.findDistrict(new DistrictKey(city, region, name), "district");
|
||||
if (null == districtBo) {
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "小区数据不存在"));
|
||||
return mav;
|
||||
}
|
||||
DistrictFacilitys facilitys = districtFacilitysService.findByDistrict(districtBo);
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(facilitys));
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1230,4 +1248,7 @@ public class DistrictController {
|
||||
this.regionStatRentService = regionStatRentService;
|
||||
}
|
||||
|
||||
public void setDistrictFacilitysService(DistrictFacilitysService districtFacilitysService) {
|
||||
this.districtFacilitysService = districtFacilitysService;
|
||||
}
|
||||
}
|
||||
|
||||
+57
-5
@@ -10,9 +10,14 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fangjia.dal.mongo.model.BsEvaluation;
|
||||
import com.fangjia.dal.mongo.model.bkoff.DealPrice;
|
||||
import com.fangjia.service.bo.AddrEvaResult;
|
||||
import com.fangjia.service.bo.DistrictStatBo;
|
||||
import com.fangjia.service.bo.EvaluationBo;
|
||||
import com.fangjia.service.bo.HouseScorer;
|
||||
import com.fangjia.service.datastore.*;
|
||||
import com.fangjia.service.district.DistrictStatService;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -54,11 +59,6 @@ import com.fangjia.open.model.RestfulModelAndView;
|
||||
import com.fangjia.service.api.AutoCompleteService;
|
||||
import com.fangjia.service.api.KnowbaseService;
|
||||
import com.fangjia.service.common.SellSimilar;
|
||||
import com.fangjia.service.datastore.BusinessEstateService;
|
||||
import com.fangjia.service.datastore.DistrictService;
|
||||
import com.fangjia.service.datastore.EvaluationReportService;
|
||||
import com.fangjia.service.datastore.EvaluationService;
|
||||
import com.fangjia.service.datastore.HouseService;
|
||||
import com.fangjia.service.sql.ApiUserService;
|
||||
import com.fangjia.service.sql.UserService;
|
||||
import com.fangjia.service.web.AddressService;
|
||||
@@ -94,6 +94,8 @@ public class EvaluationController {
|
||||
private ApiUserService apiUserService;
|
||||
private UserService userService;
|
||||
private AddressService addressService;
|
||||
private DistrictStatService districtStatService;
|
||||
private BsEvaluationService bsEvaluationService;
|
||||
|
||||
private final static String AK = OpenConfig.getConfig().getBaiduAk();
|
||||
public Object lngLatEvaluateAction(EvaluationModel model) {
|
||||
@@ -1005,6 +1007,44 @@ public class EvaluationController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
public Object bsListAction(EvaluationModel model) {
|
||||
RestfulModelAndView mv = new RestfulModelAndView();
|
||||
mv.setViewType("rest");
|
||||
|
||||
if (StringUtils.isBlank(model.getId())) {
|
||||
mv.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "楼盘编号不能为空"));
|
||||
return mv;
|
||||
}
|
||||
District district = districtService.findDistrictById(model.getId());
|
||||
DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName());
|
||||
|
||||
if(district == null){
|
||||
mv.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||
return mv;
|
||||
}
|
||||
DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey);
|
||||
Integer minPrice = null;
|
||||
Integer maxPrice = null;
|
||||
if(bo.getDistrictStat()!=null){
|
||||
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
|
||||
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
|
||||
}
|
||||
Date startDate = null;
|
||||
Date endDate = null;
|
||||
if(StringUtils.isNotBlank(model.getStartDate())){
|
||||
startDate = DateUtil.parseDate(model.getStartDate(),"yyyyMMdd");
|
||||
}
|
||||
if(StringUtils.isNotBlank(model.getEndDate())){
|
||||
endDate = DateUtil.parseDate(model.getEndDate(),"yyyyMMdd");
|
||||
}
|
||||
|
||||
List<BsEvaluation> dealPrices = bsEvaluationService.getNearlySameEvaluation(model.getId(), minPrice, maxPrice, startDate, endDate, model.getLimit());
|
||||
mv.setModel(BasicModel.buildOKModel().setResult(dealPrices));
|
||||
return mv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setEvaluationService(EvaluationService evaluationService) {
|
||||
this.evaluationService = evaluationService;
|
||||
}
|
||||
@@ -1017,6 +1057,18 @@ public class EvaluationController {
|
||||
this.knowbaseService = knowbaseService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setDistrictStatService(DistrictStatService districtStatService) {
|
||||
this.districtStatService = districtStatService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setBsEvaluationService(BsEvaluationService bsEvaluationService) {
|
||||
this.bsEvaluationService = bsEvaluationService;
|
||||
}
|
||||
|
||||
public void setAutoCompleteService(AutoCompleteService autoCompleteService) {
|
||||
this.autoCompleteService = autoCompleteService;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import com.fangjia.dal.mongo.model.DistrictFacilitys;
|
||||
import com.fangjia.dal.mongo.model.FangjiaOfficialAreaMap;
|
||||
import com.fangjia.dal.mongo.model.Metro;
|
||||
import com.fangjia.dal.mongo.model.StatsIndex;
|
||||
import com.fangjia.dal.seawater.dao.SeawaterDao;
|
||||
import com.fangjia.dal.seawater.model.Seawater;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.dal.sql.model.ApiUser;
|
||||
import com.fangjia.datastore.driver.FacetResult;
|
||||
@@ -29,6 +31,7 @@ import com.fangjia.open.ws.query.CollateralSampleQuery;
|
||||
import com.fangjia.open.ws.query.ShopCollateralSampleQuery;
|
||||
import com.fangjia.service.address.AddressParser;
|
||||
import com.fangjia.service.bo.Collateral;
|
||||
import com.fangjia.service.bo.DistrictStatBo;
|
||||
import com.fangjia.service.bo.Sample;
|
||||
import com.fangjia.service.bo.ShopSample;
|
||||
import com.fangjia.service.datastore.CzbankSampleService;
|
||||
@@ -39,11 +42,13 @@ import com.fangjia.service.datastore.bean.CollateralSampleQueryBean;
|
||||
import com.fangjia.service.datastore.bean.ShopCollateralSampleQueryBean;
|
||||
import com.fangjia.service.district.DistrictFacilitysService;
|
||||
import com.fangjia.service.district.DistrictStatService;
|
||||
import com.fangjia.service.district.SqmetreRentService;
|
||||
import com.fangjia.service.menu.Item;
|
||||
import com.fangjia.service.menu.MenuCategoryEnum;
|
||||
import com.fangjia.service.menu.Value;
|
||||
import com.fangjia.service.mongo.fangjia.DealPriceService;
|
||||
import com.fangjia.service.mongo.fangjia.MetroService;
|
||||
import com.fangjia.service.mongo.fangjia.SeawaterService;
|
||||
import com.fangjia.service.mongo.fangjia.StatsIndexService;
|
||||
import com.fangjia.service.open.FangjiaOfficialAreaService;
|
||||
import com.fangjia.service.open.HousePojo;
|
||||
@@ -86,6 +91,9 @@ public class HouseController {
|
||||
private CzbankSampleService czbankSampleService;
|
||||
private DistrictService districtService;
|
||||
private FangjiaOfficialAreaService fangjiaOfficialAreaService;
|
||||
|
||||
private SeawaterService seawaterService;
|
||||
private SeawaterDao seawaterDao;
|
||||
private List<String> PROPERTY_TYPE_CODE_LIST = Arrays.asList("01", "02");
|
||||
|
||||
|
||||
@@ -399,6 +407,51 @@ public class HouseController {
|
||||
}
|
||||
}
|
||||
|
||||
public Object listAction(final HouseSearchModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (StringUtils.isBlank(model.getId()) && (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getRegion()) || StringUtils.isBlank(model.getName()))) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("楼盘编号或城市,区域,名称为必填项"));
|
||||
return mav;
|
||||
}
|
||||
District district = null;
|
||||
DistrictKey districtKey = null;
|
||||
if(StringUtils.isNotBlank(model.getName())){
|
||||
districtKey = new DistrictKey(model.getCity(), model.getRegion(), model.getName());
|
||||
district = districtService.findDistrict(districtKey, "district");
|
||||
}else{
|
||||
district = districtService.findDistrictById(model.getId());
|
||||
if(district!=null){
|
||||
districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName());
|
||||
}
|
||||
}
|
||||
|
||||
if(district == null){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||
return mav;
|
||||
}
|
||||
DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey);
|
||||
Integer minPrice = null;
|
||||
Integer maxPrice = null;
|
||||
if(bo.getDistrictStat()!=null){
|
||||
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
|
||||
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
|
||||
}
|
||||
List<String> names = new ArrayList<String>();
|
||||
names.add(district.getName());
|
||||
if(district.getAlias() != null){
|
||||
for(String alia : district.getAlias()){
|
||||
if(StringUtils.isNotBlank(alia) && !names.contains(alia)){
|
||||
names.add(alia);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<Seawater> houses = seawaterDao.findSeawatersFromEs("sell", district.getCity(), district.getRegion(), district.getName(), district.getAlias(), null, model.getStartTime(), model.getEndTime(),null,null,minPrice, maxPrice,null,null,"p_date", false,0, model.getPageSize(),"latest_seawater");
|
||||
//List<Seawater> houses1 = seawaterDao.findHouses(district.getCity(), district.getRegion(), names, minPrice, maxPrice, model.getPageSize());
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(houses));
|
||||
return mav;
|
||||
}
|
||||
|
||||
String getPicUrl(String url, List<String> urls) {
|
||||
if (!urls.contains(url)) {
|
||||
urls.add(url);
|
||||
@@ -832,6 +885,13 @@ public class HouseController {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setSeawaterService(SeawaterService seawaterService) {
|
||||
this.seawaterService = seawaterService;
|
||||
}
|
||||
|
||||
public void setSeawaterDao(SeawaterDao seawaterDao) {
|
||||
this.seawaterDao = seawaterDao;
|
||||
}
|
||||
|
||||
private boolean checkExists(FacetQueryResult<HousePojo> houseBoList, HousePojo house) {
|
||||
for (HousePojo bo : houseBoList) {
|
||||
|
||||
+220
-53
@@ -31,12 +31,15 @@ import javax.validation.Valid;
|
||||
import com.fangjia.core.util.*;
|
||||
import com.fangjia.dal.*;
|
||||
import com.fangjia.dal.mongo.model.*;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityBasePrice;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
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.open.impl.CommunityPoiServiceImpl;
|
||||
import com.fangjia.service.util.DistrictScoreUtil;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
@@ -175,6 +178,9 @@ public class PropertyController {
|
||||
private SeawaterDao seawaterDao;
|
||||
private SeawaterService seawaterService;
|
||||
private SqmetreRentService sqmetreRentService;
|
||||
private CommunityPoiService communityPoiService;
|
||||
private CommunityBasePriceService communityBasePriceService;
|
||||
private EvaluateFactorService evaluateFactorService;
|
||||
|
||||
private FileDao fileDao = FileDao.getInstance();
|
||||
private static final int DEFAULT_PAGE_SIZE = 20;
|
||||
@@ -390,10 +396,31 @@ public class PropertyController {
|
||||
put("5000", "five");// 五线
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 第三方均价映射
|
||||
*/
|
||||
private static final Map<String, String> OTHER_PRICE_MAP = new HashMap<String, String>() {
|
||||
{
|
||||
put("zhuge_price", "诸葛找房");
|
||||
put("anjuke_price", "安居客");
|
||||
put("fang_price", "房天下");
|
||||
put("lianjia_price", "链家");
|
||||
put("cityhouse_price", "禧泰数据");
|
||||
put("maitian_price", "麦田");
|
||||
put("ke_price", "贝壳");
|
||||
put("taofang_price", "淘房365");
|
||||
put("zhongyuan_price", "中原");
|
||||
put("tbs_price", "兔博士");
|
||||
put("qfang_price", "Q房");
|
||||
put("fangtan_price", "房探");
|
||||
put("fangduoduo_price", "房多多");
|
||||
put("wiwj_price", "我爱我家");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 利用百度API把GPS转换成Google经纬度
|
||||
*
|
||||
*
|
||||
* @param lng
|
||||
* @param lat
|
||||
* @return
|
||||
@@ -415,7 +442,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 利用算法模板把GPS转换成Google经纬度
|
||||
*
|
||||
*
|
||||
* @param lng
|
||||
* @param lat
|
||||
* @return
|
||||
@@ -607,7 +634,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 判断小区是否有经纬度
|
||||
*
|
||||
*
|
||||
* @param district
|
||||
* @return
|
||||
*/
|
||||
@@ -618,7 +645,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 调用匹配接口匹配小区
|
||||
*
|
||||
*
|
||||
* @param city
|
||||
* @param address
|
||||
* @param region
|
||||
@@ -666,17 +693,6 @@ public class PropertyController {
|
||||
}
|
||||
String userId = FangjiaApiUtil.parseUserId(model.getToken());
|
||||
|
||||
/**超级用户和上海交大账户不控制权限*/
|
||||
if (!"1007497".equals(userId) && !"1007632".equals(userId) && !"1007548".equals(userId)
|
||||
&& !"1007486".equals(userId) && !"1007533".equals(userId) && !"1007630".equals(userId)
|
||||
&& !"1007705".equals(userId) && !"1007739".equals(userId) && !"1007736".equals(userId)
|
||||
&& !"1007741".equals(userId) && !"1007742".equals(userId) && !"1007743".equals(userId)
|
||||
&& !"1007747".equals(userId) && !"1007757".equals(userId)
|
||||
&& model.getDetailLevel() != null && model.getDetailLevel() != 0) {// 临时权限控制
|
||||
mav.setModel(BasicModel.buildUnAuthorizedModel());
|
||||
return mav;
|
||||
}
|
||||
|
||||
District district = null;
|
||||
if (StringUtils.isNotBlank(model.getId())){
|
||||
if(ObjectId.isValid(model.getId())){
|
||||
@@ -740,18 +756,18 @@ public class PropertyController {
|
||||
} else {
|
||||
districtInfoDto.setBuildingType("");
|
||||
}
|
||||
districtInfoDto.setAlias(district.getAlias());
|
||||
districtInfoDto.setAlias(district.getMappingAlias());
|
||||
districtInfoDto.setAddressAlias(district.getAddrAlias());
|
||||
districtInfoDto.setCommunity(district.getStreetCommunity());
|
||||
districtInfoDto.setCommercialArea(district.getBusinessQuarter());
|
||||
if (district.getHouseholdCount() != null) {
|
||||
districtInfoDto.setTotalUnitCount(district.getHouseholdCount().toString());
|
||||
districtInfoDto.setTotalUnitCount(SeaweedUtils.formatHouseholdCount(district.getHouseholdCount().toString()));
|
||||
} else {
|
||||
districtInfoDto.setTotalUnitCount("");
|
||||
}
|
||||
districtInfoDto.setManagementFee(district.getEstateCharge());
|
||||
if (district.getCarSiteCount() != null) {
|
||||
districtInfoDto.setParking(district.getCarSiteCount().toString());
|
||||
districtInfoDto.setParking(SeaweedUtils.formatCarSiteCount(district.getCarSiteCount().toString()));
|
||||
} else {
|
||||
districtInfoDto.setParking("");
|
||||
}
|
||||
@@ -772,10 +788,10 @@ public class PropertyController {
|
||||
|
||||
districtInfoDto.setFinishBuildTime(district.getFinishBuildingDate());
|
||||
districtInfoDto.setMoveinTime(district.getLiveDate());
|
||||
districtInfoDto.setFloorSpace(district.getAllArea());
|
||||
districtInfoDto.setFloorSpace(SeaweedUtils.formatAllArea(district.getAllArea()));
|
||||
districtInfoDto.setConstructionSpace(district.getBuildArea());
|
||||
districtInfoDto.setPlotRatio(district.getCubagePercent());
|
||||
districtInfoDto.setGreenPercentage(district.getVirescencePercent());
|
||||
districtInfoDto.setPlotRatio(SeaweedUtils.formatCubagePercent(district.getCubagePercent()));
|
||||
districtInfoDto.setGreenPercentage(SeaweedUtils.formatVirescencePercent(district.getVirescencePercent()));
|
||||
districtInfoDto.setPreSalePermit(district.getLicence());
|
||||
districtInfoDto.setDeveloper(district.getDeveloper());
|
||||
districtInfoDto.setDiscount(district.getDiscount());
|
||||
@@ -792,6 +808,7 @@ public class PropertyController {
|
||||
districtInfoDto.setDescription(district.getDescription());
|
||||
districtInfoDto.setSalesOfficeAdd(district.getSellAddress());
|
||||
districtInfoDto.setSalesPhoneNumber(district.getMobile());
|
||||
districtInfoDto.setTownship(district.getTownship());
|
||||
if (district.getLoudongCount() != null && district.getLoudongCount() > 0) {
|
||||
districtInfoDto.setBuildingCount(district.getLoudongCount());
|
||||
}
|
||||
@@ -960,6 +977,12 @@ public class PropertyController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
if(model.getMaxFloor() == null && model.getFloor() != null &&StringUtils.isNotBlank(model.getBuildingNumber())){
|
||||
Loudong loudong = loudongService.findForEvaluate(district.getId(), model.getBuildingNumber(), model.getUnitNumber());
|
||||
if(loudong != null && loudong.getFloors() >= model.getFloor()){
|
||||
model.setMaxFloor(loudong.getFloors());
|
||||
}
|
||||
}
|
||||
model.setRegion(district.getRegion());
|
||||
model.setDistrictName(district.getName());
|
||||
if (StringUtils.isBlank(model.getPropertyType())) {
|
||||
@@ -996,6 +1019,32 @@ public class PropertyController {
|
||||
}
|
||||
}
|
||||
|
||||
// 调整面积不同面积价格
|
||||
try {
|
||||
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district));
|
||||
int orgAvgPrice = 0;
|
||||
if (districtStatBo != null) {
|
||||
if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("别墅") && districtStatBo.getVillaDistrictStat() != null) {
|
||||
orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice();
|
||||
} else if (districtStatBo.getDistrictStat() != null) {
|
||||
orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice();
|
||||
}
|
||||
}
|
||||
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
|
||||
int factorPrice = evaluation.getAvgPrice();
|
||||
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
|
||||
Integer minPrice = (int)(evaluation.getAvgPrice() * 0.95);
|
||||
Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.05);
|
||||
// 偏离度超过5%不进行调整
|
||||
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
|
||||
evaluation.setAvgPrice(avgPrice);
|
||||
evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea()));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
|
||||
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0
|
||||
&& (cityPriceCredit == null || evaluation.getCredit() >= cityPriceCredit)) {
|
||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||
@@ -1116,7 +1165,7 @@ public class PropertyController {
|
||||
model.setCalDate(calDate);
|
||||
}
|
||||
/* 先到CPDB库中查找小区 */
|
||||
District district = matchDistrict(model.getCity(), model.getAddress(), model.getDistrict(), model.getName());
|
||||
District district = districtService.findDistrict(new DistrictKey(model.getCity(), model.getDistrict(), model.getName()), "district");//matchDistrict(model.getCity(), model.getAddress(), model.getDistrict(), model.getName());
|
||||
if(district == null){
|
||||
//防止地址模糊,名称详细的情况
|
||||
district = matchDistrict(model.getCity(), model.getName(), model.getDistrict(), model.getAddress());
|
||||
@@ -1166,19 +1215,52 @@ public class PropertyController {
|
||||
evaluationService.remove(evaluation.getId());
|
||||
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData());
|
||||
return mav;
|
||||
}
|
||||
// 调整面积不同面积价格
|
||||
try {
|
||||
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district));
|
||||
int orgAvgPrice = 0;
|
||||
if (districtStatBo != null) {
|
||||
if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("别墅") && districtStatBo.getVillaDistrictStat() != null) {
|
||||
orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice();
|
||||
} else if (districtStatBo.getDistrictStat() != null) {
|
||||
orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice();
|
||||
}
|
||||
}
|
||||
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
|
||||
int factorPrice = evaluation.getAvgPrice();
|
||||
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
|
||||
Integer minPrice = (int)(evaluation.getAvgPrice() * 0.95);
|
||||
Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.05);
|
||||
// 偏离度超过5%不进行调整
|
||||
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
|
||||
evaluation.setAvgPrice(avgPrice);
|
||||
evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea()));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
Map<String, Object> districtPriceMap = new LinkedHashMap<String, Object>();
|
||||
districtPriceMap.put("city", district.getCity());
|
||||
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());
|
||||
// 新增置信度
|
||||
CommunityBasePrice communityBasePrice = communityBasePriceService.getById(district.getId());
|
||||
if (communityBasePrice != null) {
|
||||
districtPriceMap.put("credit", communityBasePrice.getCredit());
|
||||
} else {
|
||||
districtPriceMap.put("credit", evaluation.getCredit());
|
||||
}
|
||||
List<String> names = new ArrayList<String>();
|
||||
names.add(district.getName());
|
||||
if(district.getAlias() != null){
|
||||
@@ -1190,6 +1272,31 @@ public class PropertyController {
|
||||
}
|
||||
Integer minPrice = (int)(evaluation.getAvgPrice() * 0.8);
|
||||
Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.2);
|
||||
Integer min10Price = (int)(evaluation.getAvgPrice() * 0.9);
|
||||
Integer max10Price = (int)(evaluation.getAvgPrice() * 1.1);
|
||||
// 新增第三方均价
|
||||
try {
|
||||
double dCredit = 0.61;
|
||||
Map<String, Object> rMap = getLastEvaluationPrice(district, evaluation, dCredit);
|
||||
if (null != rMap) {
|
||||
if (rMap.containsKey("other_price")) {
|
||||
Map<String, Integer> otherPriceMap = (Map<String, Integer>) rMap.get("other_price");
|
||||
Map<String, Integer> priceResultMap = new HashMap<String, Integer>();
|
||||
for (String key : otherPriceMap.keySet()) {
|
||||
Integer price = otherPriceMap.get(key);
|
||||
// 剔除偏差大于10的
|
||||
if (min10Price <= price && max10Price >= price) {
|
||||
if (OTHER_PRICE_MAP.containsKey(key)) {
|
||||
priceResultMap.put(OTHER_PRICE_MAP.get(key), price);
|
||||
}
|
||||
}
|
||||
}
|
||||
districtPriceMap.put("otherPrice", priceResultMap);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
List<Seawater> houses = seawaterDao.findHouses(district.getCity(), district.getRegion(), names,minPrice, maxPrice, 20);
|
||||
if(houses.size() > 3){
|
||||
districtPriceMap.put("calcType", 1);
|
||||
@@ -1218,7 +1325,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());
|
||||
@@ -1256,9 +1363,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);
|
||||
@@ -1266,6 +1379,18 @@ public class PropertyController {
|
||||
modelFeaturesFto.put("buildYear", String.valueOf(buildYear));
|
||||
}
|
||||
modelFeaturesFto.append("nearCommunity", nearCommunityDtos);
|
||||
|
||||
// 模型特征新增周边数量
|
||||
CommunityPoi communityPoi = communityPoiService.getById(district.getId());
|
||||
if (communityPoi != null) {
|
||||
modelFeaturesFto.put("subway", communityPoi.getSubway());
|
||||
modelFeaturesFto.put("traffic", communityPoi.getTraffic());
|
||||
modelFeaturesFto.put("bank", communityPoi.getBank());
|
||||
modelFeaturesFto.put("primary", communityPoi.getPrimary());
|
||||
modelFeaturesFto.put("hospital", communityPoi.getHospital());
|
||||
modelFeaturesFto.put("junior", communityPoi.getJunior());
|
||||
modelFeaturesFto.put("funeral", communityPoi.getFuneral());
|
||||
}
|
||||
districtPriceMap.put("modelFeatures", modelFeaturesFto);
|
||||
}
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
||||
@@ -1473,7 +1598,7 @@ public class PropertyController {
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 四川锦程 定制接口 多建筑年代
|
||||
* @param model
|
||||
@@ -1585,7 +1710,7 @@ public class PropertyController {
|
||||
districtPriceMap.put("buildYear", matcher3.group());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 根据城市等 级设置D级可信度
|
||||
ApiUserAuthority apiUserAuthority = apiUserAuthorityService
|
||||
@@ -2098,7 +2223,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 小区租金查询接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -2577,7 +2702,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 批量获取小区的均价,均价走势数据
|
||||
*
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@@ -2719,7 +2844,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 批量获取小区的配套数据,最多12个小区
|
||||
*
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@@ -2864,7 +2989,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 获取JSON参数中的num参数值
|
||||
*
|
||||
*
|
||||
* @param jo
|
||||
* @return
|
||||
*/
|
||||
@@ -2889,7 +3014,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 获取JSON参数中的radius值
|
||||
*
|
||||
*
|
||||
* @param jo
|
||||
* @return
|
||||
*/
|
||||
@@ -3697,7 +3822,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 解析出关键字中的小区名
|
||||
*
|
||||
*
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
@@ -3814,7 +3939,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 小区统计分析接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -3899,7 +4024,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 小区交通接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -3957,7 +4082,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 小区周边接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4016,7 +4141,7 @@ public class PropertyController {
|
||||
/**
|
||||
* 相同小区相似户型房源挂牌量接口<br>
|
||||
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源
|
||||
*
|
||||
*
|
||||
* @author yinjihuan
|
||||
* @date 2016年9月1日
|
||||
* @param city
|
||||
@@ -4056,7 +4181,7 @@ public class PropertyController {
|
||||
/**
|
||||
* 周边小区相似户型挂牌量接口<br>
|
||||
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源
|
||||
*
|
||||
*
|
||||
* @author yinjihuan
|
||||
* @date 2016年9月1日
|
||||
* @param city
|
||||
@@ -4107,7 +4232,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 小区周边一公里均价
|
||||
*
|
||||
*
|
||||
* @author wenyan
|
||||
* @param model
|
||||
* @return
|
||||
@@ -4130,7 +4255,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 相同小区相似户型租金范围查询接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4173,7 +4298,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 周边小区相似户型租金范围查询接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4236,7 +4361,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 室号查询接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4272,7 +4397,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 楼栋楼层信息查询接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4297,7 +4422,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 楼栋查询接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4342,7 +4467,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 楼栋查询接口
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4795,7 +4920,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 房产交易记录查询
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4855,7 +4980,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 房产拍卖记录
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -4916,7 +5041,7 @@ public class PropertyController {
|
||||
|
||||
/**
|
||||
* 房产近期评估次数
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@@ -5412,6 +5537,36 @@ public class PropertyController {
|
||||
}
|
||||
}
|
||||
|
||||
public Object searchHouseLoudongAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
|
||||
if (StringUtils.isBlank(model.getId()) || StringUtils.isBlank(model.getHouseNumber()) || StringUtils.isBlank(model.getRoomNumber())){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数非法:楼盘编号,楼栋号,室为必填项"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
List<HouseLoudong> houseLoudongs = houseLoudongService.findAll(model.getId(), model.getHouseNumber(), model.getUnitNumber(), model.getRoomNumber());
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(houseLoudongs));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
public Object searchLoudongAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
|
||||
if (StringUtils.isBlank(model.getId()) || StringUtils.isBlank(model.getHouseNumber())){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数非法:楼盘编号,楼栋号为必填项"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
List<Loudong> loudongs = loudongService.findAll(model.getId(), model.getHouseNumber(), model.getUnitNumber());
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(loudongs));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
public void setHouseLoudongService(HouseLoudongService houseLoudongService) {
|
||||
this.houseLoudongService = houseLoudongService;
|
||||
@@ -5601,4 +5756,16 @@ public class PropertyController {
|
||||
public void setRentDealPriceService(RentDealPriceService rentDealPriceService) {
|
||||
this.rentDealPriceService = rentDealPriceService;
|
||||
}
|
||||
|
||||
public void setCommunityPoiService(CommunityPoiService communityPoiService) {
|
||||
this.communityPoiService = communityPoiService;
|
||||
}
|
||||
|
||||
public void setEvaluateFactorService(EvaluateFactorService evaluateFactorService) {
|
||||
this.evaluateFactorService = evaluateFactorService;
|
||||
}
|
||||
|
||||
public void setCommunityBasePriceService(CommunityBasePriceService communityBasePriceService) {
|
||||
this.communityBasePriceService = communityBasePriceService;
|
||||
}
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import com.fangjia.core.util.AnalyticsUtil;
|
||||
import com.fangjia.open.interceptors.Authority;
|
||||
import com.fangjia.open.interceptors.Role;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class requestController {
|
||||
|
||||
/**
|
||||
* »ñÈ¡ÇëÇóµÄrequestºÍIPÐÅÏ¢
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public Object requestAction(HttpServletRequest request) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
String ip = AnalyticsUtil.getIpAddress(request);
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
Enumeration headerNames = request.getHeaderNames();
|
||||
while (headerNames.hasMoreElements()) {
|
||||
String key = (String) headerNames.nextElement();
|
||||
String value = request.getHeader(key);
|
||||
map.put(key, value);
|
||||
}
|
||||
map.put("ip", ip);
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(map));
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
@@ -99,6 +99,7 @@ public class DistrictInfoDto {
|
||||
private String salesPhoneNumber;
|
||||
private Integer buildingCount;
|
||||
private Integer finishYear;
|
||||
private String township;
|
||||
|
||||
|
||||
public String getDistrict() {
|
||||
@@ -818,4 +819,12 @@ public class DistrictInfoDto {
|
||||
public void setFinishYear(Integer finishYear) {
|
||||
this.finishYear = finishYear;
|
||||
}
|
||||
|
||||
public String getTownship() {
|
||||
return township;
|
||||
}
|
||||
|
||||
public void setTownship(String township) {
|
||||
this.township = township;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ public class AnalyticsFilter implements Filter {
|
||||
if ("1".equals(request.getParameter("__refresh_cache"))) {
|
||||
threadLocalData.put(ThreadLocalKey.DisableCache, "1");
|
||||
}
|
||||
createUID(request, response);
|
||||
createSID(request, response);
|
||||
//createUID(request, response);
|
||||
//createSID(request, response);
|
||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||
response.addHeader("Access-Control-Allow-Methods", "*");
|
||||
chain.doFilter(request, response);
|
||||
|
||||
@@ -8,6 +8,7 @@ public class AuctionModel extends FangjiaApiModel{
|
||||
private String city;
|
||||
private String district;
|
||||
private String address;
|
||||
private String name;
|
||||
private Date minStartTime;
|
||||
private Date maxStartTime;
|
||||
private Integer minStartPrice;
|
||||
@@ -17,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;
|
||||
@@ -121,4 +123,20 @@ public class AuctionModel extends FangjiaApiModel{
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.fangjia.open.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DealPriceModel extends FangjiaApiModel{
|
||||
private String id;
|
||||
|
||||
private String city;
|
||||
|
||||
@@ -34,9 +37,13 @@ public class DealPriceModel extends FangjiaApiModel{
|
||||
private Double size;
|
||||
|
||||
private Integer max;
|
||||
private Integer limit = 10;
|
||||
private String decoration;
|
||||
|
||||
private boolean convert;
|
||||
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
|
||||
|
||||
public String getCity() {
|
||||
@@ -198,4 +205,36 @@ public class DealPriceModel extends FangjiaApiModel{
|
||||
public void setConvert(boolean convert) {
|
||||
this.convert = convert;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public Integer getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(Integer limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +246,42 @@ public class EvaluationModel extends FangjiaApiModel {
|
||||
private Date buildDate;
|
||||
private String sid;//微信小程序中的sid
|
||||
private String code;//微信小程序中的code
|
||||
private String id;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private Integer limit = 10;
|
||||
|
||||
public Integer getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(Integer limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
return region;
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.fangjia.service.datastore.bean.HouseQueryBean;
|
||||
import com.fangjia.service.query.QueryBean;
|
||||
|
||||
public class HouseSearchModel extends SearchModel {
|
||||
private String id;
|
||||
private String kind;
|
||||
private String estateType;
|
||||
private String buildingType;
|
||||
@@ -116,7 +117,12 @@ public class HouseSearchModel extends SearchModel {
|
||||
public void setShowDetail(Boolean showDetail) {
|
||||
this.showDetail = showDetail;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
+21
@@ -46,7 +46,12 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
|
||||
* Â¥ºÅ
|
||||
*/
|
||||
private String unitNumber;
|
||||
/**
|
||||
* ÐÂÂ¥ºÅ
|
||||
*/
|
||||
private String houseNumber;
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* ÊÒºÅ
|
||||
*/
|
||||
@@ -905,4 +910,20 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
|
||||
public void setAvgPrice(Integer avgPrice) {
|
||||
this.avgPrice = avgPrice;
|
||||
}
|
||||
|
||||
public String getHouseNumber() {
|
||||
return houseNumber;
|
||||
}
|
||||
|
||||
public void setHouseNumber(String houseNumber) {
|
||||
this.houseNumber = houseNumber;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ public abstract class SearchModel extends FangjiaApiModel {
|
||||
protected Integer totalPriceEnd;
|
||||
protected Integer avgPriceStart;
|
||||
protected Integer avgPriceEnd;
|
||||
protected Integer startTime;
|
||||
protected Integer endTime;
|
||||
protected Integer areaStart;
|
||||
protected Integer areaEnd;
|
||||
protected Integer room;
|
||||
@@ -358,4 +360,20 @@ public abstract class SearchModel extends FangjiaApiModel {
|
||||
public void setTotalPrice(Integer totalPrice) {
|
||||
this.totalPrice = totalPrice;
|
||||
}
|
||||
|
||||
public Integer getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(Integer startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Integer getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Integer endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,5 +38,10 @@
|
||||
<ladder>/address/standard</ladder>
|
||||
</ladders>
|
||||
</rule>
|
||||
<rule controller="address" action="fiveDivisionStructure2" channel="v2">
|
||||
<ladders>
|
||||
<ladder>/address/fiveDivisionStructure</ladder>
|
||||
</ladders>
|
||||
</rule>
|
||||
</rules>
|
||||
</urlrewrite>
|
||||
+6
@@ -57,6 +57,12 @@ class CcbFtpUtils {
|
||||
ftpUpload(dataCodeFileName)//上传加密码文件到FTP
|
||||
}
|
||||
|
||||
static def listFileNames(month){
|
||||
//上传到ftp
|
||||
sftpChannel = reConnect();
|
||||
Vector files = sftp.listFiles(ftpPath+ month+"/", sftpChannel);
|
||||
return files
|
||||
}
|
||||
|
||||
static main(args) {
|
||||
|
||||
|
||||
+23
@@ -3,8 +3,10 @@ package com.fangjia.script.ccbevaluation
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.jcraft.jsch.ChannelSftp
|
||||
import groovy.sql.Sql
|
||||
import com.fangjia.script.ccbevaluation.ronghe.SSHHelper
|
||||
import org.apache.commons.codec.digest.DigestUtils
|
||||
|
||||
class ExportOracleEvaluationData {
|
||||
def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl",
|
||||
@@ -33,6 +35,8 @@ class ExportOracleEvaluationData {
|
||||
exportCommCaseDetailGj(curMonth)
|
||||
|
||||
def curDate = curMonth.toString()+"28"
|
||||
// 生成MD5文件
|
||||
exportMd5()
|
||||
SSHHelper jschCommand = new SSHHelper();
|
||||
System.out.println(jschCommand.executeCommand("sh /home/ccb/output/gz_package.sh ${curDate}"));
|
||||
// okÎļþ
|
||||
@@ -413,4 +417,23 @@ class ExportOracleEvaluationData {
|
||||
CcbFtpUtils.ftpUpload(null, dataCodeFileName, curDate)
|
||||
}
|
||||
|
||||
def exportMd5(){
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"
|
||||
Vector files = CcbFtpUtils.listFileNames(curDate)
|
||||
Iterator fileVec = files.iterator()
|
||||
def fileRows = []
|
||||
while(fileVec.hasNext()){
|
||||
ChannelSftp.LsEntry file = fileVec.next()
|
||||
if(org.apache.commons.lang.StringUtils.isNotBlank(file.getFilename()) && file.getFilename().endsWith(".dat")){
|
||||
fileRows << file.getFilename() +":"+ DigestUtils.md5Hex(file.getFilename())
|
||||
}
|
||||
}
|
||||
def fileName = "/ccb/md5.txt"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\房价网\\md5.txt"
|
||||
}
|
||||
FileUtils.createTxtFile(fileRows, fileName, "utf-8", false);
|
||||
CcbFtpUtils.ftpUpload(null, fileName, curDate)
|
||||
println "md5.txt 上传Ftp完成......"
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -199,18 +199,18 @@ class CcbCodeUtils {
|
||||
static def getBuildStructureCode(def buildStructure){
|
||||
if(buildStructure){
|
||||
if(buildStructure.contains("钢结构")){
|
||||
return "001";
|
||||
return "3";
|
||||
}else if(buildStructure.contains("钢、钢筋混凝土结构")){
|
||||
return "002";
|
||||
return "1";
|
||||
}else if(buildStructure.contains("钢筋混凝土结构")){
|
||||
return "003";
|
||||
return "1";
|
||||
}else if(buildStructure.contains("砖木结构")){
|
||||
return "004";
|
||||
return "10";
|
||||
}else if(buildStructure.contains("混合结构")){
|
||||
return "005";
|
||||
return "2";
|
||||
}
|
||||
}
|
||||
return "006";
|
||||
return "11";
|
||||
}
|
||||
|
||||
static def getDistHouseTypeCode(def estateType){
|
||||
|
||||
@@ -50,4 +50,32 @@ class FileUtils {
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
|
||||
static def createTxtFile(ret, fileName, charset, isAppend){
|
||||
File file = new File(fileName);
|
||||
if (!file.getParentFile().exists()) {
|
||||
boolean result = file.getParentFile().mkdirs();
|
||||
if (!result) {
|
||||
System.out.println("´´½¨Ä¿Â¼Ê§°Ü");
|
||||
}
|
||||
}
|
||||
|
||||
OutputStream out = new FileOutputStream(fileName, isAppend);
|
||||
def sb = new StringBuffer();
|
||||
out.write(sb.toString().getBytes(charset));
|
||||
sb.setLength(0)
|
||||
def index = 0
|
||||
for(def row : ret){
|
||||
if(row){
|
||||
index++
|
||||
sb.append(row)
|
||||
sb.append("\n");
|
||||
}
|
||||
}
|
||||
if(sb.length()>0){
|
||||
out.write(sb.toString().getBytes(charset));
|
||||
sb.setLength(0)
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,11 +92,6 @@ public class DbUtils{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void executeQueryOnSeawater(BasicDBObject query,Closure c, BasicDBObject fields = null){
|
||||
seawater.find(query,fields).batchSize(10000).each(c)
|
||||
}
|
||||
|
||||
public static void executeQueryOnSeaweed(BasicDBObject query,Closure c, BasicDBObject fields = null){
|
||||
SEAWEED_SLAVE.find(query,fields).batchSize(1000).each(c)
|
||||
}
|
||||
@@ -171,10 +166,6 @@ public class DbUtils{
|
||||
return SEAWEED_SLAVE.findOne(query,fields);
|
||||
}
|
||||
|
||||
public static int executeCountOnSeawater(BasicDBObject query){
|
||||
return seawater.count(query);
|
||||
}
|
||||
|
||||
public static BasicDBObject buildSeaweedQuery(def city = null, def region = null, def name = null, def cat = "district", def visible = 0){
|
||||
BasicDBObject query = new BasicDBObject()
|
||||
if(city){
|
||||
@@ -387,31 +378,6 @@ public class DbUtils{
|
||||
return district.lat && district.lng && district.lng > 0 && district.lat > 0
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录修改小区库的操作日志
|
||||
* @param city
|
||||
* @param region
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
def static saveDeleteLog(String city, String region,String name,String category,int status){
|
||||
if(status!=1){
|
||||
return
|
||||
}
|
||||
DBObject obj = new BasicDBObject()
|
||||
obj.put("city", city);
|
||||
obj.put("region", region);
|
||||
obj.put("district_name", name);
|
||||
obj.put("category" , category)
|
||||
obj.put("origin" , "脚本")
|
||||
if(status==1){
|
||||
obj.put("type" , "remove")
|
||||
}
|
||||
obj.put("c_date" , new Date())
|
||||
obj.put("m_date" , new Date())
|
||||
OPERATION_LOG.save(obj)
|
||||
}
|
||||
|
||||
public static DBCollection getCollection(String host, int port, String dbName ,String collName){
|
||||
def collection = COLL_CACHE["${host}#${port}#${dbName}#${collName}"]
|
||||
if(!collection){
|
||||
|
||||
+25
-18
@@ -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;
|
||||
@@ -759,6 +757,13 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
double simScore;
|
||||
boolean onSameRoad = false;
|
||||
boolean sameDistrict = isSameDistrict(address, metaData);
|
||||
if(PreciseLevel.STRICT == address.getPreciseLevel() && !sameDistrict){
|
||||
return 0;
|
||||
}
|
||||
// //当地图解析出来的区域和用户地址中的区域一致时,只匹配指定区域下面的小区
|
||||
// if(address.getGeoRegion() != null && address.getGeoRegion().equals(address.getDistrict()) && !sameDistrict){
|
||||
// return 0;
|
||||
// }
|
||||
Iterator<Map.Entry<String, MatchText>> addrEntrySet = metaData.getAddrePinYinMap().entrySet().iterator();
|
||||
Map.Entry<String, MatchText> addrEntry;
|
||||
while(addrEntrySet.hasNext()){
|
||||
@@ -808,7 +813,6 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String keywordPinYin = address.getKeywordsPinYin();
|
||||
String keywords = address.getKeywords();
|
||||
String fuzzyKeywordsPinYin = address.getFuzzyKeywordsPinYin();
|
||||
@@ -892,7 +896,7 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
if(name.length() == 2 && (name.equals(address.getOrgAddress()) || name.equals(address.getEffectiveAddress()))){
|
||||
keywordScore = Math.max(keywordScore, namePriority);
|
||||
}else if(name.length() > 3 && (address.getOrgAddrePinYin().contains(namePinYin) || enhanceContains(address.getOrgAddress(), name))){
|
||||
double similar = AddressParserUtil.getSimilarityRatio(name, address.getEffectiveAddress());
|
||||
double similar = AddressParserUtil.getSimilarityRatio(name, address.getOrgAddress());
|
||||
if(similar == 1){
|
||||
keywordScore = Math.max(similar, keywordScore) * namePriority * 1.0001;
|
||||
}else if(similar > 0.1){
|
||||
@@ -907,20 +911,27 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
if (standardAddressScore > 0 && keywordScore > 0) {
|
||||
matchLevelScore = 0.9;
|
||||
similarityScore = Math.max(standardAddressScore, keywordScore) * SIMILARITY_RATE;
|
||||
} else if(keywordScore > 0 && streetScore > 0){
|
||||
matchLevelScore = 0.8;
|
||||
similarityScore = Math.max(streetScore, keywordScore * 0.8) * SIMILARITY_RATE;
|
||||
} else if (standardAddressScore > 0) {
|
||||
matchLevelScore = 0.7;
|
||||
matchLevelScore = 0.8;
|
||||
similarityScore = standardAddressScore * SIMILARITY_RATE;
|
||||
} else if(keywordScore > 0 && streetScore > 0){
|
||||
matchLevelScore = 0.7;
|
||||
similarityScore = Math.max(streetScore, keywordScore * 0.8) * SIMILARITY_RATE;
|
||||
} else if (keywordScore > 0) {
|
||||
matchLevelScore = 0.6;
|
||||
similarityScore = keywordScore * SIMILARITY_RATE;
|
||||
} else if (fuzzyKeywordsScore > 0) {
|
||||
matchLevelScore = 0.5;
|
||||
if(address.hasCoordinate() && metaData.getLng() != null && GeoUtils.calculateDistance(address.getLng(), address.getLat(),
|
||||
metaData.getLng(), metaData.getLat()) < 100){
|
||||
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){
|
||||
if ("shop".equals(metaData.getBuildingType().toString())) {
|
||||
@@ -942,10 +953,6 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
* similarityScore = ÏàËÆ¶È²¿·Ö(0.07) + ÀàÐͲ¿·Ö(0.01) < 0.1
|
||||
* */
|
||||
double score = matchLevelScore + similarityScore;
|
||||
if(address.hasCoordinate() && metaData.hasCoordinate()
|
||||
&& GeoUtils.calculateDistance(address.getLng(), address.getLat(), metaData.getLng(), metaData.getLat()) > 3 * 1000){
|
||||
score = 0d;
|
||||
}
|
||||
return score;
|
||||
|
||||
}
|
||||
@@ -980,7 +987,7 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
return false;
|
||||
}
|
||||
if(StringUtils.isBlank(address.getDistrict()) && StringUtils.isBlank(address.getSuggestDistrict())){
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
String district = metaData.getDistrict();
|
||||
return district.equals(address.getDistrict()) || district.equals(address.getSuggestDistrict());
|
||||
|
||||
@@ -61,6 +61,8 @@ public class Address {
|
||||
private String suggestDistrict;
|
||||
private String suggestName;
|
||||
private String suggestNamePinYin;
|
||||
private String polygonSeaweedId;
|
||||
private String geoRegion;
|
||||
private List<String> buildingNumbers;
|
||||
private PreciseLevel preciseLevel;
|
||||
private boolean pinYin;
|
||||
@@ -397,6 +399,7 @@ public class Address {
|
||||
}
|
||||
|
||||
public void setOrgAddress(String orgAddress) {
|
||||
orgAddress = orgAddress.toUpperCase();
|
||||
setAddress(orgAddress);
|
||||
if(this.orgAddress != null){
|
||||
throw new UnsupportedOperationException("ÔʼµØÖ·²»Äܱ»ÐÞ¸Ä");
|
||||
@@ -749,6 +752,14 @@ public class Address {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getGeoRegion() {
|
||||
return geoRegion;
|
||||
}
|
||||
|
||||
public void setGeoRegion(String geoRegion) {
|
||||
this.geoRegion = geoRegion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Address{" +
|
||||
@@ -808,6 +819,14 @@ public class Address {
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getPolygonSeaweedId() {
|
||||
return polygonSeaweedId;
|
||||
}
|
||||
|
||||
public void setPolygonSeaweedId(String polygonSeaweedId) {
|
||||
this.polygonSeaweedId = polygonSeaweedId;
|
||||
}
|
||||
|
||||
public String toMd5Hex(){
|
||||
String keyProperties = "Address{" +
|
||||
"city='" + city + '\'' +
|
||||
|
||||
+1
-3
@@ -20,11 +20,9 @@ public class AddressProcessors{
|
||||
|
||||
static {
|
||||
//Đ޸ÄËłĐňĐčŇŞľ÷Őűprocess i ľÄÖľ
|
||||
addressProcessors.add(new TokenProcessor());
|
||||
addressProcessors.add(new ProximalCharactersProcessor());
|
||||
addressProcessors.add(new PreNoiseProcessor());
|
||||
addressProcessors.add(new AddressFormatProcessor());
|
||||
addressProcessors.add(new TokenProcessor());
|
||||
addressProcessors.add(new FloorProcessor());
|
||||
addressProcessors.add(new TooltipProcessor());
|
||||
addressProcessors.add(new ProvinceProcessor());
|
||||
@@ -44,7 +42,7 @@ public class AddressProcessors{
|
||||
addressProcessors.add(new NumericProcessor());
|
||||
addressProcessors.add(new ProvinceAdjustProcessor());
|
||||
addressProcessors.add(new FormatProcessor());
|
||||
// addressProcessors.add(new GeoProcessor());
|
||||
addressProcessors.add(new GeoProcessor());
|
||||
}
|
||||
|
||||
|
||||
|
||||
+12
-18
@@ -52,8 +52,9 @@ public class CityProcessor extends AbstractAddressProcessor {
|
||||
}
|
||||
if(StringUtils.isNotBlank(city) && CityStatus.SURE != address.getCityStatus() ){
|
||||
String formatCity = RegionData.formatCity(city);
|
||||
String possibleCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) ? parseCityFromAddress(orgAddress, address) : null;
|
||||
String confirmCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) ? null : formatCity;
|
||||
address.setCity(formatCity);
|
||||
String possibleCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) || address.getAddressParserGoal() == null ? parseCityFromAddress(orgAddress, address) : null;
|
||||
String confirmCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) || address.getAddressParserGoal() == null? null : formatCity;
|
||||
/**如果省份和城市信息相互矛盾 则用区域推断城市*/
|
||||
if(StringUtils.isNotBlank(address.getProvince()) && !ProvinceData.belongTo(formatCity, address.getProvince())){
|
||||
List<String> possibleCities = speculateCityNameByRegion(address, city);
|
||||
@@ -191,15 +192,12 @@ public class CityProcessor extends AbstractAddressProcessor {
|
||||
}else{
|
||||
weight.score += 2;
|
||||
}
|
||||
|
||||
}else if(address.contains(city)){
|
||||
index = address.indexOf(city);
|
||||
weight.index = index;
|
||||
index += city.length();
|
||||
if(province != null && (orgAddress.contains(province + city) || orgAddress.contains(ProvinceData.getDisplay(province) + city))){
|
||||
weight.score += 2;
|
||||
}else{
|
||||
weight.score += 1;
|
||||
}
|
||||
}
|
||||
Map<String, List<String>> regionMap = RegionData.getAllRegions(city);
|
||||
@@ -208,9 +206,11 @@ public class CityProcessor extends AbstractAddressProcessor {
|
||||
if(matchResult !=null){
|
||||
address = address.replace(matchResult.matchContent, "");
|
||||
}
|
||||
if(address.indexOf(region, index) > -1){
|
||||
if(address.indexOf(region + "Çø", index) > -1 || address.indexOf(region + "ÏØ", index) > -1){
|
||||
if(province != null && (orgAddress.contains(province + region) || orgAddress.contains(ProvinceData.getDisplay(province) + region))){
|
||||
weight.score += 2;
|
||||
}else if(city.equals(addr.getCity())){
|
||||
weight.score += 10;
|
||||
}else{
|
||||
weight.score += 1;
|
||||
}
|
||||
@@ -221,9 +221,13 @@ public class CityProcessor extends AbstractAddressProcessor {
|
||||
List<String> alias = regionMap.get(region);
|
||||
if(alias != null){
|
||||
for(String alia : alias){
|
||||
if(StringUtils.isNotBlank(alia) && !alia.equals(region) && address.indexOf(alia, index) > -1
|
||||
if(StringUtils.isNotBlank(alia) && !alia.equals(region) && alia.length() > 2 && address.indexOf(alia, index) > -1
|
||||
&& (alia.endsWith("市")|(alia.endsWith("县")))){
|
||||
weight.score += 1;
|
||||
if(city.equals(addr.getCity())){
|
||||
weight.score += 10;
|
||||
}else{
|
||||
weight.score += 1;
|
||||
}
|
||||
weight.index = address.indexOf(alia, index);
|
||||
break;
|
||||
}
|
||||
@@ -237,16 +241,6 @@ public class CityProcessor extends AbstractAddressProcessor {
|
||||
}
|
||||
List<FragmentWeight> weights = new ArrayList<FragmentWeight>(weightMap.values());
|
||||
if(weights.size() > 0){
|
||||
/*String street = getStreet(address);
|
||||
if(street != null){
|
||||
Iterator<FragmentWeight> iterator = weights.iterator();
|
||||
while(iterator.hasNext()){
|
||||
FragmentWeight fragmentWeight = iterator.next();
|
||||
if(match(street, ".*" + fragmentWeight.text + "[东南西北中一二三四五六七八九十百千\\d]?(路|街|大道|支路|村)")){
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
Collections.sort(weights);
|
||||
}
|
||||
if(weights.size() > 0){
|
||||
|
||||
+3
@@ -167,6 +167,9 @@ public class DistrictProcessor extends AbstractAddressProcessor {
|
||||
address.setDevelopmentZone(dz);
|
||||
}
|
||||
}
|
||||
if(address.getSuggestDistrict() != null && address.getDistrict() == null){
|
||||
address.setDistrict(address.getSuggestDistrict());
|
||||
}
|
||||
address.setAddress(orgAddress);
|
||||
address.setEffectiveAddress(address.getAddress());
|
||||
return RepeatStatus.NEXT;
|
||||
|
||||
+46
-51
@@ -5,8 +5,12 @@ import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.service.address.mode.Address;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import java.util.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* µØÖ·¾Î³¶È´¦ÀíÆ÷
|
||||
@@ -16,78 +20,69 @@ import java.util.*;
|
||||
public class GeoProcessor extends AbstractAddressProcessor {
|
||||
|
||||
private static final String KEY = "4ccfe3c898a9489884bd2bcb1ef6dcde";
|
||||
|
||||
List<String> POI_LEVELS = Arrays.asList("村庄", "热点商圈", "兴趣点", "门牌号", "单元号", "道路交叉路口");
|
||||
List<String> DISTRICT_LEVEL = Arrays.asList("区县", "开发区", "乡镇", "村庄", "热点商圈", "兴趣点", "门牌号", "单元号", "道路交叉路口");
|
||||
private static final Logger logger = Logger.getLogger(GeoProcessor.class);
|
||||
List<String> POI_LEVELS = Arrays.asList("村庄", "热点商圈", "兴趣点", "门牌号", "单元号", "道路交叉路口", "门牌号");
|
||||
|
||||
@Override
|
||||
public RepeatStatus process(Address address) {
|
||||
|
||||
if (address.hasCoordinate()) {
|
||||
return RepeatStatus.NEXT;
|
||||
}
|
||||
List<String> queryTypes = new ArrayList<String>();
|
||||
List<String> addressList = new ArrayList<String>();
|
||||
if (address.isStandardAddress()) {
|
||||
addressList.add(address.getStandardAddress());
|
||||
queryTypes.add("StandardAddress");
|
||||
}
|
||||
if (StringUtils.isNotBlank(address.getOrgKeywords())) {
|
||||
addressList.add(address.getOrgKeywords());
|
||||
queryTypes.add("Keywords");
|
||||
String addr = address.getEffectiveAddress();
|
||||
if(addr == null || addr.length() < 3){
|
||||
addr = address.getOrgAddress();
|
||||
}
|
||||
HttpRequest request = new HttpRequest();
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("address", StringUtils.join(addressList, "|"));
|
||||
params.put("address", addr);
|
||||
params.put("key", KEY);
|
||||
params.put("city", address.getCity());
|
||||
params.put("batch", "true");
|
||||
params.put("output", "json");
|
||||
try {
|
||||
JSONObject response = request.getJsonContent("https://restapi.amap.com/v3/geocode/geo", params, "UTF-8");
|
||||
logger.info("高德API:" + response.toString());
|
||||
if (response.getInt("status") == 1) {
|
||||
JSONArray geocodes = response.getJSONArray("geocodes");
|
||||
if(queryTypes.contains("StandardAddress")){
|
||||
JSONObject geocode = geocodes.getJSONObject(queryTypes.indexOf("StandardAddress"));
|
||||
String level = geocode.getString("level");
|
||||
if(DISTRICT_LEVEL.contains(level)){
|
||||
if(StringUtils.isBlank(address.getDistrict())){
|
||||
address.setDistrict(RegionData.formatRegion(address.getCity(), geocode.getString("district")));
|
||||
if(geocodes.size() > 0){
|
||||
JSONObject json = geocodes.getJSONObject(0);
|
||||
if(json.get("district") instanceof String){
|
||||
String city = address.getCity();
|
||||
if(city == null){
|
||||
city = RegionData.formatCity(json.getString("city"));
|
||||
}
|
||||
String region = RegionData.formatRegion(city, json.getString("district"));
|
||||
address.setGeoRegion(region);
|
||||
}
|
||||
if(geocode.containsKey("street") && geocode.containsKey("number")){
|
||||
String geocodeAddress = geocode.getString("street") + geocode.getString("number");
|
||||
if(address.getStandardAddress().contains(geocodeAddress)){
|
||||
String location = geocode.getString("location");
|
||||
address.setLng(Double.parseDouble(location.split(",")[0]));
|
||||
address.setLat(Double.parseDouble(location.split(",")[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(queryTypes.contains("Keywords")){
|
||||
JSONObject geocode = geocodes.getJSONObject(queryTypes.indexOf("Keywords"));
|
||||
String level = geocode.getString("level");
|
||||
if(DISTRICT_LEVEL.contains(level)){
|
||||
if(StringUtils.isBlank(address.getDistrict())){
|
||||
address.setDistrict(RegionData.formatRegion(address.getCity(), geocode.getString("district")));
|
||||
}
|
||||
}
|
||||
if(POI_LEVELS.contains(level)){
|
||||
String formattedAddress = geocode.getString("formatted_address");
|
||||
formattedAddress = formattedAddress
|
||||
.replaceFirst(geocode.getString("province"), "")
|
||||
.replaceFirst(geocode.getString("city"), "")
|
||||
.replaceFirst(geocode.getString("district"), "");
|
||||
if(formattedAddress.equals(address.getOrgKeywords())){
|
||||
String location = geocode.getString("location");
|
||||
address.setLng(Double.parseDouble(location.split(",")[0]));
|
||||
address.setLat(Double.parseDouble(location.split(",")[1]));
|
||||
if(POI_LEVELS.contains(json.getString("level"))){
|
||||
//对于门牌号级别的POI,formatted_address中包含|代表是推测出来的路号,重庆市巴南区凤林路|808号,|号楼
|
||||
if("门牌号".equals(json.getString("level"))){
|
||||
if(!(json.get("number") instanceof JSONArray) && json.getString("formatted_address").contains("|" + json.getString("number"))){
|
||||
return RepeatStatus.NEXT;
|
||||
}
|
||||
}
|
||||
String location = json.getString("location");
|
||||
address.setLng(Double.valueOf(location.split(",")[0]));
|
||||
address.setLat(Double.valueOf(location.split(",")[1]));
|
||||
String tmp = "{ \"_source\": [\"seaweed_id\"], \"query\": {\"geo_shape\": {\"shape\": {\"shape\": {\"type\": \"Point\",\"coordinates\":[location]},\"relation\": \"CONTAINS\"}}}}";
|
||||
tmp = tmp.replace("location", location);
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
headers.put("Authorization","Basic ZGV2ZWxvcGVyOjVlOGVkZDg1MWQyZmRmYmQ3NDE1MjMyYzY3MzY3Y2Mz");
|
||||
JSONObject resp = JSONObject.fromObject(request.postWithBody("http://192.168.0.206:9200/seaweed_polygon/_search", JSONObject.fromObject(tmp),headers,"UTF-8"));
|
||||
if(resp.containsKey("hits") && resp.getJSONObject("hits").containsKey("hits")){
|
||||
JSONArray hits = resp.getJSONObject("hits").getJSONArray("hits");
|
||||
if(hits.size() > 0){
|
||||
String seaweedId = hits.getJSONObject(0).getJSONObject("_source").getString("seaweed_id");
|
||||
address.setPolygonSeaweedId(seaweedId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
logger.error(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return RepeatStatus.NEXT;
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public class KeywordProcessor extends AbstractAddressProcessor {
|
||||
static final List<Pattern> KEYWORDS_PATTERNS = Arrays.asList(Pattern.compile(".*[^一二三四五六七八九十\\d]{3,}号"));
|
||||
static final List<String> KEYWORDS = Arrays.asList("居委会", "辖区", "街道办", "街道", "办事处", "村委", "管理区");
|
||||
static final List<Pattern> NOISE_PATTERNS = Arrays.asList(Pattern.compile("^.*\\d+队"), Pattern.compile("^\\d+号院$"));
|
||||
static final List<Pattern> INVALID_KEYWORD_PATTERN = Arrays.asList(Pattern.compile("^[一二三四五六七八九十甲乙丙丁戊己庚辛A-Z\\d]+[区期]$"), Pattern.compile("碧桂园"), Pattern.compile("住宅楼"), Pattern.compile("家属院"));
|
||||
static final List<Pattern> INVALID_KEYWORD_PATTERN = Arrays.asList(Pattern.compile("^[一二三四五六七八九十甲乙丙丁戊己庚辛A-Z\\d]+[区期]$"), Pattern.compile("碧桂园"), Pattern.compile("住宅楼"), Pattern.compile("家属[区院]"), Pattern.compile("宿舍"), Pattern.compile("生活区"), Pattern.compile("公寓"));
|
||||
static final Pattern INVALID_PATTERN = Pattern.compile("^([-\\\\、])+$");
|
||||
|
||||
|
||||
|
||||
+8
-2
@@ -23,11 +23,17 @@ public class StageAndPartitionProcessor extends AbstractAddressProcessor {
|
||||
addr = addr.replaceAll(matchResult.matchContent, formatStage);
|
||||
address.setAddress(addr);
|
||||
}
|
||||
address.setStage(matchResult.matchContent);
|
||||
address.setStage(formatStage);
|
||||
}
|
||||
matchResult = matchFirst(AddressParserPatterns.PARTITION_PATTERN, orgAddr);
|
||||
if (matchResult != null) {
|
||||
address.setPartition(matchResult.matchContent);
|
||||
String formatPartition = CNNMFilter.convertArabicToCnNumeric(matchResult.matchContent);
|
||||
if(!formatPartition.equals(matchResult.matchContent)){
|
||||
String addr = address.getAddress();
|
||||
addr = addr.replaceAll(matchResult.matchContent, formatPartition);
|
||||
address.setAddress(addr);
|
||||
}
|
||||
address.setStage(formatPartition);
|
||||
}
|
||||
return RepeatStatus.NEXT;
|
||||
}
|
||||
|
||||
+2
-4
@@ -42,12 +42,10 @@ public class TooltipProcessor extends AbstractAddressProcessor {
|
||||
if(matchFirst(AddressParserPatterns.STREET, tooltip) != null){
|
||||
address.setTooltip(tooltip);
|
||||
address.setStreet(getStreet(tooltip));
|
||||
} else if(containsDistrictName(tooltip)){
|
||||
address.setTooltip(tooltip);
|
||||
} else if(RegionData.isRegion(address.getCity(), tooltip)){
|
||||
}else if(RegionData.isRegion(address.getCity(), tooltip)){
|
||||
address.setSuggestDistrict(tooltip);
|
||||
}else{
|
||||
address.addNosie(tooltip);
|
||||
address.setTooltip(tooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -15,15 +15,6 @@ public class VillageNameProcessor extends AbstractAddressProcessor {
|
||||
@Override
|
||||
public AbstractAddressProcessor.RepeatStatus process(Address address) {
|
||||
String orgAddress = address.getAddress();
|
||||
if(address.getTokens()!=null){
|
||||
for(Token token:address.getTokens()){
|
||||
if("district".equals(token.getKeywordTypes())){
|
||||
address.setKeywords(token.getName());
|
||||
address.setAddress(orgAddress.replace(token.getName(),""));
|
||||
return RepeatStatus.NEXT;
|
||||
}
|
||||
}
|
||||
}
|
||||
List<String> names = tokenDistrictNames(orgAddress);
|
||||
List<String> kws = new ArrayList<String>();
|
||||
for(String name : names){
|
||||
|
||||
+8
-16
@@ -1,24 +1,16 @@
|
||||
package com.fangjia.service.cnAnalyzer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.solr.client.solrj.util.ClientUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.fangjia.core.util.DataUtil;
|
||||
import com.goojia.solr.ganalytics.IKSegmentation;
|
||||
import com.goojia.solr.ganalytics.Lexeme;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 房价网分词器
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.fangjia.service.datastore;
|
||||
|
||||
import com.fangjia.dal.mongo.model.BsEvaluation;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface BsEvaluationService {
|
||||
|
||||
List<BsEvaluation> getNearlySameEvaluation(String id, Integer minPrice, Integer maxPrice, Date startDate, Date endDate, Integer limit);
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.fangjia.service.datastore;
|
||||
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.SortParam;
|
||||
import com.fangjia.dal.mongo.dao.BsEvaluationDao;
|
||||
import com.fangjia.dal.mongo.dao.EvaluationDao;
|
||||
import com.fangjia.dal.mongo.model.BsEvaluation;
|
||||
import com.fangjia.dal.mongo.model.bkoff.DealPrice;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class BsEvaluationServiceImpl implements BsEvaluationService {
|
||||
|
||||
private BsEvaluationDao bsEvaluationDao;
|
||||
|
||||
public void setBsEvaluationDao(BsEvaluationDao bsEvaluationDao) {
|
||||
this.bsEvaluationDao = bsEvaluationDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BsEvaluation> getNearlySameEvaluation(String id, Integer minPrice, Integer maxPrice, Date startDate, Date endDate, Integer limit) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("commid", id));
|
||||
if(startDate!=null){
|
||||
params.add(new QueryParam("cDate", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||
}
|
||||
if(endDate!=null){
|
||||
params.add(new QueryParam("cDate", QueryParam.LESS_THAN_EQUAL_OPERATOR, startDate));
|
||||
}
|
||||
|
||||
if (minPrice > 0) {
|
||||
params.add(new QueryParam("unitPrice", QueryParam.GREATER_THAN_OPERATOR, minPrice));
|
||||
}
|
||||
if (maxPrice > 0) {
|
||||
params.add(new QueryParam("unitPrice", QueryParam.LESS_THAN_OPERATOR, maxPrice));
|
||||
}
|
||||
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||
sortParams.add(new SortParam("cDate", false));
|
||||
List<BsEvaluation> bsEvaluations = bsEvaluationDao.findAllByParams(params, sortParams, limit);
|
||||
return bsEvaluations;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -240,7 +240,7 @@ public class AddressRepoServiceImpl implements AddressRepoService {
|
||||
}
|
||||
|
||||
private boolean isAvailablePoi(AddressMatchMetaData data){
|
||||
if(data.getType() != null && data.getType().contains("·")){
|
||||
if(data.getType() != null && (data.getType().contains("·") || data.getType().contains("½ÖµÀ"))){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
+2
@@ -94,4 +94,6 @@ public interface HouseLoudongService {
|
||||
public List<HouseLoudong> findAll(List<QueryParam> queryParams, Pager pager);
|
||||
|
||||
List<String> findAllSources();
|
||||
|
||||
public List<HouseLoudong> findAll(String id, String houseNum, String unitNum, String roomNum);
|
||||
}
|
||||
|
||||
+16
@@ -297,6 +297,22 @@ public class HouseLoudongServiceImpl implements HouseLoudongService {
|
||||
return froms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HouseLoudong> findAll(String id, String houseNum, String unitNum, String roomNum) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("districtId", id));
|
||||
if (StringUtils.isNotBlank(houseNum)) {
|
||||
params.add(new QueryParam("houseNum", houseNum));
|
||||
}
|
||||
if (StringUtils.isNotBlank(unitNum)) {
|
||||
params.add(new QueryParam("houseNumUnit", unitNum));
|
||||
}
|
||||
if (StringUtils.isNotBlank(roomNum)) {
|
||||
params.add(new QueryParam("roomNum", roomNum));
|
||||
}
|
||||
return houseLoudongBkoffDao.findAllByParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HouseLoudong> queryHouseLoudongList(String city, String districtName, String roomNum, Pager pager) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
|
||||
+4
@@ -23,6 +23,8 @@ public interface LoudongService {
|
||||
|
||||
List<Loudong> findAll(String city, String region, String name, String houseNumber, String unitNumber, int limit);
|
||||
|
||||
List<Loudong> findAll(String id, String houseNumber, String unitNumber);
|
||||
|
||||
Map<String, XSSFWorkbook> findAll(List<QueryParam> query, String city);
|
||||
|
||||
Loudong findById(String id);
|
||||
@@ -41,4 +43,6 @@ public interface LoudongService {
|
||||
void save(Map<String, Object> data);
|
||||
|
||||
List<String> findAllSources();
|
||||
|
||||
Loudong findForEvaluate(String idInSeaweed, String houseNumber, String unitNumber);
|
||||
}
|
||||
|
||||
+36
@@ -148,6 +148,23 @@ public class LoudongServiceImpl implements LoudongService {
|
||||
return loudongDao.findAllByParams(params,null, 0 , limit, ADDRESS_VERIFY_FIELDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Loudong> findAll(String id, String houseNumber, String unitNumber) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
params.add(new QueryParam("idInSeaweed", id));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(houseNumber)) {
|
||||
params.add(new QueryParam("houseNumber", houseNumber));
|
||||
}
|
||||
if(StringUtils.isNotBlank(unitNumber)) {
|
||||
params.add(new QueryParam("unitNumber", unitNumber));
|
||||
}
|
||||
|
||||
return loudongDao.findAllByParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Loudong findById(String id) {
|
||||
return loudongDao.findById(id);
|
||||
@@ -318,4 +335,23 @@ public class LoudongServiceImpl implements LoudongService {
|
||||
}
|
||||
return froms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Loudong findForEvaluate(String idInSeaweed, String houseNumber, String unitNumber){
|
||||
if(StringUtils.isBlank(idInSeaweed) || StringUtils.isBlank(houseNumber)){
|
||||
return null;
|
||||
}
|
||||
List<QueryParam> params = Lists.newArrayList();
|
||||
params.add(new QueryParam("idInSeaweed", idInSeaweed));
|
||||
params.add(new QueryParam("houseNumber", houseNumber));
|
||||
if(StringUtils.isNotBlank(unitNumber)) {
|
||||
params.add(new QueryParam("unitNumber", unitNumber));
|
||||
}
|
||||
params.add(new QueryParam("floors", QueryParam.GREATER_THAN_OPERATOR, 0));
|
||||
params.add(new QueryParam("floors", QueryParam.LESS_THAN_OPERATOR, 60));
|
||||
params.add(new QueryParam("status", QueryParam.NOT_EQUAL_OPERATOR, 0));
|
||||
|
||||
List<SortParam> sortParams = ImmutableList.of(new SortParam("floors", false));
|
||||
return loudongDao.findFirstByParams(params, sortParams);
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -82,6 +82,8 @@ public interface DealPriceService {
|
||||
|
||||
public List<DealPrice> getNearlySameDealPrice(DistrictKey key, int minPrice, int maxPrice, int radius, int limit);
|
||||
|
||||
public List<DealPrice> getNearlySameDealPrice(String districtId, Integer minPrice, Integer maxPrice,Date startDate, Date endDate, int limit);
|
||||
|
||||
public List<DealPrice> getDisSameDealPrice(DistrictKey key, int minPrice, int maxPrice, int limit);
|
||||
|
||||
/**
|
||||
|
||||
+23
@@ -354,6 +354,29 @@ public class DealPriceServiceImpl implements DealPriceService {
|
||||
return houses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DealPrice> getNearlySameDealPrice(String districtId, Integer minPrice, Integer maxPrice, Date startDate, Date endDate, int limit) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("matchId", districtId));
|
||||
if(startDate!=null){
|
||||
params.add(new QueryParam("tradeDate", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||
}
|
||||
if(endDate!=null){
|
||||
params.add(new QueryParam("tradeDate", QueryParam.LESS_THAN_EQUAL_OPERATOR, startDate));
|
||||
}
|
||||
|
||||
if (minPrice > 0) {
|
||||
params.add(new QueryParam("avgPrice", QueryParam.GREATER_THAN_OPERATOR, minPrice));
|
||||
}
|
||||
if (maxPrice > 0) {
|
||||
params.add(new QueryParam("avgPrice", QueryParam.LESS_THAN_OPERATOR, maxPrice));
|
||||
}
|
||||
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||
sortParams.add(new SortParam("tradeDate", false));
|
||||
List<DealPrice> dealPrices = dealPriceDao.findAllByParams(params, sortParams, limit);
|
||||
return dealPrices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DealPrice> getDisSameDealPrice(DistrictKey key, int minPrice, int maxPrice, int limit) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.fangjia.service.open;
|
||||
|
||||
import com.fangjia.dal.mongo.open.model.CommunityBasePrice;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
|
||||
public interface CommunityBasePriceService {
|
||||
|
||||
CommunityBasePrice getById(String id);
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.service.open;
|
||||
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
|
||||
public interface CommunityPoiService {
|
||||
|
||||
CommunityPoi getById(String id);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.fangjia.service.open.impl;
|
||||
|
||||
import com.fangjia.dal.mongo.open.dao.CommunityBasePriceDao;
|
||||
import com.fangjia.dal.mongo.open.dao.CommunityPoiDao;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityBasePrice;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
import com.fangjia.service.open.CommunityBasePriceService;
|
||||
import com.fangjia.service.open.CommunityPoiService;
|
||||
|
||||
public class CommunityBasePriceServiceImpl implements CommunityBasePriceService {
|
||||
|
||||
private CommunityBasePriceDao communityBasePriceDao;
|
||||
|
||||
@Override
|
||||
public CommunityBasePrice getById(String id) {
|
||||
return communityBasePriceDao.findById(id);
|
||||
}
|
||||
|
||||
public void setCommunityBasePriceDao(CommunityBasePriceDao communityBasePriceDao) {
|
||||
this.communityBasePriceDao = communityBasePriceDao;
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.fangjia.service.open.impl;
|
||||
|
||||
import com.fangjia.dal.mongo.open.dao.CommunityPoiDao;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
import com.fangjia.service.open.CommunityPoiService;
|
||||
|
||||
public class CommunityPoiServiceImpl implements CommunityPoiService {
|
||||
|
||||
private CommunityPoiDao communityPoiDao;
|
||||
|
||||
@Override
|
||||
public CommunityPoi getById(String id) {
|
||||
return communityPoiDao.findById(id);
|
||||
}
|
||||
|
||||
public void setCommunityPoiDao(CommunityPoiDao communityPoiDao) {
|
||||
this.communityPoiDao = communityPoiDao;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user