Merge branch 'master' of http://gitlab.fangjia.com/dev0/main into script_gj
This commit is contained in:
+19
@@ -1705,6 +1705,25 @@ public class AddressController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
public Object addressSimilarityAction(AddesssMatchModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getAddress_1()) || StringUtils.isBlank(model.getAddress_2())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("两个地址均不能为空"));
|
||||
return mav;
|
||||
}
|
||||
model.setAddress(model.getAddress_1());
|
||||
String result1 = addressMatchProxyService.standard(convertModelToMap(model));
|
||||
model.setAddress(model.getAddress_2());
|
||||
String result2 = addressMatchProxyService.standard(convertModelToMap(model));
|
||||
if (result1 != null && result2 != null) {
|
||||
Map<String, Object> resultMap = addressService.addressSimilarity(result1, result2);
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(resultMap));
|
||||
} else {
|
||||
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
public Object parseCityAction(AddressModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getProvince())) {
|
||||
|
||||
+2
-9
@@ -131,7 +131,7 @@ import com.google.common.collect.Sets;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBObject;
|
||||
|
||||
//@Authority(role = Role.USER)
|
||||
@Authority(role = Role.USER)
|
||||
public class PropertyController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PropertyController.class);
|
||||
@@ -4966,6 +4966,7 @@ public class PropertyController {
|
||||
* @throws NumberFormatException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
@Authority(role = Role.NONE)
|
||||
public Object rentReportAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
@@ -5164,7 +5165,6 @@ public class PropertyController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Object evaluateRentAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
@@ -5255,13 +5255,6 @@ public class PropertyController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setHouseLoudongService(HouseLoudongService houseLoudongService) {
|
||||
this.houseLoudongService = houseLoudongService;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,24 @@ public class AddesssMatchModel extends FangjiaApiModel {
|
||||
private String province;
|
||||
private String debugName;
|
||||
private boolean useMap;
|
||||
private String address_1;
|
||||
private String address_2;
|
||||
|
||||
public String getAddress_1() {
|
||||
return address_1;
|
||||
}
|
||||
|
||||
public void setAddress_1(String address_1) {
|
||||
this.address_1 = address_1;
|
||||
}
|
||||
|
||||
public String getAddress_2() {
|
||||
return address_2;
|
||||
}
|
||||
|
||||
public void setAddress_2(String address_2) {
|
||||
this.address_2 = address_2;
|
||||
}
|
||||
public boolean isContainsLocation() {
|
||||
return containsLocation;
|
||||
}
|
||||
|
||||
+1
-2
@@ -18,8 +18,7 @@ import org.apache.commons.lang.StringUtils
|
||||
class AutocompleteDataUpdaterBatch extends BaseBatch {
|
||||
|
||||
|
||||
|
||||
private static final DBCollection AC_COLL = MongoUtils.getCollectionByName("fangjia", "autocomplete", "192.168.0.51", 29009)
|
||||
private static final DBCollection AC_COLL = MongoUtils.getCollectionByName("fangjia", "autocomplete", "mongo.db.fangjia.com")
|
||||
private static final DSCollection SEAWEED_COLL = new DataStore("seaweed.db.fangjia.com", 27007).getCollection("fangjia.seaweed")
|
||||
private static final DSCollection AUTOCOMPLETE_COLL = new DataStore("192.168.0.38", 27008).getCollection("fangjia.autocomplete")
|
||||
private static final long C_DATE = DateUtil.formatToYYYYMMDDhhmmss(new Date()).toLong()
|
||||
|
||||
+12
-2557
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -11,8 +11,8 @@ import org.bson.Document
|
||||
import static com.mongodb.client.model.Filters.*
|
||||
|
||||
MongoCollection<Document> OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log")
|
||||
def startDate = DateUtil.parseDate("20210301", "yyyyMMdd")
|
||||
def endDate = DateUtil.parseDate("20210401", "yyyyMMdd")
|
||||
def startDate = DateUtil.parseDate("20210401", "yyyyMMdd")
|
||||
def endDate = DateUtil.parseDate("20210501", "yyyyMMdd")
|
||||
Calendar calendar = Calendar.getInstance()
|
||||
calendar.setTime(startDate)
|
||||
def count = 0
|
||||
|
||||
+23
-5
@@ -11,26 +11,44 @@ import org.bson.Document
|
||||
import static com.mongodb.client.model.Filters.*
|
||||
|
||||
MongoCollection<Document> OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log")
|
||||
def startDate = DateUtil.parseDate("20210301", "yyyyMMdd")
|
||||
def endDate = DateUtil.parseDate("20210401", "yyyyMMdd")
|
||||
def startDate = DateUtil.parseDate("20210401", "yyyyMMdd")
|
||||
def endDate = DateUtil.parseDate("20210501", "yyyyMMdd")
|
||||
Calendar calendar = Calendar.getInstance()
|
||||
calendar.setTime(startDate)
|
||||
def count = 0
|
||||
def hashSet = []
|
||||
def data = [["用户ID", "用户名称", "IP", "访问链接", "访问时间", "dataStatus", "code", "msg", "参数", "resMap"]]
|
||||
def data = []
|
||||
def title = ["用户ID", "用户名称", "IP", "访问链接", "访问时间", "dataStatus", "code", "msg"]
|
||||
def param_keys = ["tid", "city", "district", "address", "name", "size", "propertyType"]
|
||||
param_keys.each {
|
||||
title << "参数_${it}"
|
||||
}
|
||||
def resMap_keys = ["city", "district", "name", "avgPrice", "totalPrice", "buildYear"]
|
||||
resMap_keys.each {
|
||||
title << "结果_${it}"
|
||||
}
|
||||
data << title
|
||||
def keys = new HashSet()
|
||||
while (startDate.before(endDate)) {
|
||||
calendar.add(Calendar.DATE, 1)
|
||||
def nextDate = calendar.getTime()
|
||||
count++
|
||||
OPEN_URI_LOG.find(and(eq("user_id", "1007721"), eq("request_uri", "/property/evaluate3"), eq("data_status", 1), lt("c_date", nextDate), gte("c_date", startDate))).each { Document doc ->
|
||||
def result = JSONObject.fromObject(doc.res_map.result)
|
||||
if(!result.buildYear || !result.avgPrice){
|
||||
if (!result.buildYear || !result.avgPrice) {
|
||||
return
|
||||
}
|
||||
def params = JSONObject.fromObject(doc.parameter_map)
|
||||
keys.addAll(params.keys())
|
||||
def key = "${params.address}_${params.size}".toString()
|
||||
if (!hashSet.contains(key)) {
|
||||
def item = ["1007721", "scjc", doc.ip, doc.request_uri, doc.c_date, doc.data_status, doc.code, doc.msg, JSONObject.fromObject(doc.parameter_map).toString(), result.toString()]
|
||||
def item = ["1007721", "scjc", doc.ip, doc.request_uri, doc.c_date.format("yyy"), doc.data_status, doc.code, doc.msg]
|
||||
param_keys.each {
|
||||
item << params[it]
|
||||
}
|
||||
resMap_keys.each {
|
||||
item << result[it]
|
||||
}
|
||||
data << item
|
||||
hashSet << key
|
||||
} else {
|
||||
|
||||
+47
-37
@@ -167,7 +167,7 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
Building matchedBuilding;
|
||||
//keywords使用aliyun接口返回的poi
|
||||
AliyunBo aliyunBo = null;
|
||||
if(params.isUseAliyunApi()){
|
||||
if(params.isUseAliyunApi() && AddressParserGoal.Match.equals(addr.getAddressParserGoal())){
|
||||
aliyunBo = aliyunService.addressStand(params.getAddress(), params.getCity());
|
||||
if(aliyunBo != null){
|
||||
String poi = ((aliyunBo.getPoi() == null ? "":aliyunBo.getPoi()) + (aliyunBo.getSubpoi() == null ? "":aliyunBo.getSubpoi())).replaceAll("\\s*", "");
|
||||
@@ -192,6 +192,16 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
}
|
||||
}
|
||||
}
|
||||
AddressMatchMetaData meta = null;
|
||||
if(StringUtils.isBlank(addr.getCity())){
|
||||
addr.addKeyword(addr.getOrgAddress());
|
||||
meta = getMapMeta(addr);
|
||||
if(meta != null){
|
||||
addr.setProvince(meta.getMapProvince());
|
||||
addr.setCity(meta.getMapCity());
|
||||
addr.setDistrict(meta.getDistrict());
|
||||
}
|
||||
}
|
||||
if(params.isUseMap()){
|
||||
matchedBuilding = findMatchedBuilding(addr, params.getBuildingType(), MetaDataType.MAP);
|
||||
}else{
|
||||
@@ -201,51 +211,50 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
matchedBuilding.setSearchAddress(addr);
|
||||
matchedBuilding.setSuggestName(getSuggestName(matchedBuilding));
|
||||
matchedBuilding.setSuggestAddress(getSuggestAddress(matchedBuilding));
|
||||
if(params.isUseAliyunApi() && aliyunBo != null){
|
||||
if(params.isUseAliyunApi() && aliyunBo != null && AddressParserGoal.Match.equals(addr.getAddressParserGoal())){
|
||||
completBuildingField(matchedBuilding, aliyunBo, params);
|
||||
}
|
||||
Address tempAddr = matchedBuilding.getSearchAddress();
|
||||
if(StringUtils.isBlank(tempAddr.getProvince()) || StringUtils.isBlank(tempAddr.getCity()) || StringUtils.isBlank(tempAddr.getDistrict())|| StringUtils.isBlank(tempAddr.getStreet())){
|
||||
// List<AddressMatchMetaData> metaDatas = addressRepoService.findAllByKeyword(null, params.getBuildingType(), new ArrayList<String>() {{add(tempAddr.getOrgAddress());}}, tempAddr.getLng(), tempAddr.getLat(), 100, false);
|
||||
tempAddr.addKeyword(tempAddr.getOrgAddress());
|
||||
List<AddressMatchMetaData> metaDatas = findMatchMetaData(tempAddr, params.getBuildingType(), MetaDataType.MAP, false);
|
||||
// String addressStr = (StringUtils.isBlank(tempAddr.getStreet())?"":tempAddr.getStreet()) + (StringUtils.isBlank(tempAddr.getStreetNumber())?"":tempAddr.getStreetNumber());
|
||||
Map<String,List<AddressMatchMetaData>> metaDataMap = new HashMap<String, List<AddressMatchMetaData>>();
|
||||
if(StringUtils.isBlank(tempAddr.getDistrict()) && !metaDatas.isEmpty()){
|
||||
for(AddressMatchMetaData metaData:metaDatas){
|
||||
if(StringUtils.isNotBlank(metaData.getMapCity())){
|
||||
List<AddressMatchMetaData> metaList = metaDataMap.containsKey(metaData.getMapCity()) ? metaDataMap.get(metaData.getMapCity()) : new ArrayList<AddressMatchMetaData>();
|
||||
metaList.add(metaData);
|
||||
metaDataMap.put(metaData.getMapCity(),metaList);
|
||||
}
|
||||
}
|
||||
String tempCity = "";
|
||||
if(StringUtils.isNotBlank(tempAddr.getCity()) && metaDataMap.containsKey(tempAddr.getCity())){
|
||||
tempCity = tempAddr.getCity();
|
||||
}else{
|
||||
int size = 0;
|
||||
for(String key:metaDataMap.keySet()){
|
||||
if(metaDataMap.get(key).size() > size){
|
||||
size = metaDataMap.get(key).size();
|
||||
tempCity = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(tempCity)){
|
||||
AddressMatchMetaData meta = metaDataMap.get(tempCity).get(0);
|
||||
tempAddr.setProvince(meta.getMapProvince());
|
||||
tempAddr.setCity(meta.getMapCity());
|
||||
tempAddr.setDistrict(meta.getDistrict());
|
||||
if((tempAddr.getKeywords()!=null && tempAddr.getKeywords().equals(meta.getMainName()))){
|
||||
matchedBuilding.setAddress(meta.getAddress());
|
||||
}
|
||||
}
|
||||
if(StringUtils.isBlank(tempAddr.getStreet()) && AddressParserGoal.Match.equals(addr.getAddressParserGoal())){
|
||||
if(meta != null && (tempAddr.getKeywords()!=null && tempAddr.getKeywords().equals(meta.getMainName()))){
|
||||
matchedBuilding.setAddress(meta.getAddress());
|
||||
}
|
||||
}
|
||||
matchedBuilding.setSearchAddress(tempAddr);
|
||||
return matchedBuilding;
|
||||
}
|
||||
|
||||
private AddressMatchMetaData getMapMeta(Address tempAddr){
|
||||
tempAddr.addKeyword(tempAddr.getOrgAddress());
|
||||
List<AddressMatchMetaData> metaDatas = findMatchMetaData(tempAddr, null, MetaDataType.MAP, false);
|
||||
Map<String,List<AddressMatchMetaData>> metaDataMap = new HashMap<String,List<AddressMatchMetaData>>();
|
||||
if(StringUtils.isBlank(tempAddr.getDistrict()) && !metaDatas.isEmpty()){
|
||||
for(AddressMatchMetaData metaData:metaDatas){
|
||||
if(StringUtils.isNotBlank(metaData.getMapCity())){
|
||||
List<AddressMatchMetaData> metaList = metaDataMap.containsKey(metaData.getMapCity()) ? metaDataMap.get(metaData.getMapCity()) : new ArrayList<AddressMatchMetaData>();
|
||||
metaList.add(metaData);
|
||||
metaDataMap.put(metaData.getMapCity(),metaList);
|
||||
}
|
||||
}
|
||||
String tempCity = "";
|
||||
if(StringUtils.isNotBlank(tempAddr.getCity()) && metaDataMap.containsKey(tempAddr.getCity())){
|
||||
tempCity = tempAddr.getCity();
|
||||
}else{
|
||||
int size = 0;
|
||||
for(String key:metaDataMap.keySet()){
|
||||
if(metaDataMap.get(key).size() > size){
|
||||
size = metaDataMap.get(key).size();
|
||||
tempCity = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(tempCity)){
|
||||
AddressMatchMetaData meta = metaDataMap.get(tempCity).get(0);
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 信息不全时使用阿里接口补全数据
|
||||
* @param matchedBuilding
|
||||
@@ -385,6 +394,7 @@ public class AddressParserServiceImpl implements AddressParserService {
|
||||
addr.setSuggestDistrict(params.getSuggestDistrict());
|
||||
addr.setSuggestName(params.getSuggestName());
|
||||
addr.setPreciseLevel(params.getPreciseLevel());
|
||||
addr.setAddressParserGoal(params.getAddressParserGoal());
|
||||
addr.setProvince(params.getProvince());
|
||||
addr.setDebugName(params.getDebugName());
|
||||
return AddressProcessors.process(addr);
|
||||
|
||||
@@ -78,6 +78,16 @@ public class Address {
|
||||
|
||||
private AliyunBo aliyunBo;
|
||||
|
||||
public AddressParserGoal getAddressParserGoal() {
|
||||
return addressParserGoal;
|
||||
}
|
||||
|
||||
public void setAddressParserGoal(AddressParserGoal addressParserGoal) {
|
||||
this.addressParserGoal = addressParserGoal;
|
||||
}
|
||||
|
||||
/**地址解析目的*/
|
||||
private AddressParserGoal addressParserGoal;
|
||||
public AliyunBo getAliyunBo() {
|
||||
return aliyunBo;
|
||||
}
|
||||
|
||||
+3
-3
@@ -52,8 +52,8 @@ public class CityProcessor extends AbstractAddressProcessor {
|
||||
}
|
||||
if(StringUtils.isNotBlank(city) && CityStatus.SURE != address.getCityStatus() ){
|
||||
String formatCity = RegionData.formatCity(city);
|
||||
String possibleCity = parseCityFromAddress(orgAddress, address);
|
||||
String confirmCity = null;
|
||||
String possibleCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) ? parseCityFromAddress(orgAddress, address) : null;
|
||||
String confirmCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) ? null : formatCity;
|
||||
/**如果省份和城市信息相互矛盾 则用区域推断城市*/
|
||||
if(StringUtils.isNotBlank(address.getProvince()) && !ProvinceData.belongTo(formatCity, address.getProvince())){
|
||||
List<String> possibleCities = speculateCityNameByRegion(address, city);
|
||||
@@ -62,7 +62,7 @@ public class CityProcessor extends AbstractAddressProcessor {
|
||||
confirmCity = formatCity;
|
||||
}
|
||||
}
|
||||
if(formatCity == null || !formatCity.equals(possibleCity)){
|
||||
if(AddressParserGoal.Match.equals(address.getAddressParserGoal()) && (formatCity == null || (possibleCity!=null && !formatCity.equals(possibleCity)))){
|
||||
confirmCity = possibleCity;
|
||||
}
|
||||
if(null != confirmCity){
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@ package com.fangjia.service.address.processor;
|
||||
|
||||
import com.fangjia.core.RegionData;
|
||||
import com.fangjia.service.address.mode.Address;
|
||||
import com.fangjia.service.address.mode.AddressParserGoal;
|
||||
import com.fangjia.service.address.mode.CityStatus;
|
||||
import com.fangjia.service.address.mode.ProvinceData;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -24,9 +25,9 @@ public class ProvinceProcessor extends AbstractAddressProcessor {
|
||||
|
||||
String orgAddress = address.getAddress();
|
||||
String[] provinceInfo = getProvince(orgAddress);
|
||||
/*if(provinceInfo == null && address.getCity() != null){
|
||||
if(provinceInfo == null && address.getCity() != null && !AddressParserGoal.Match.equals(address.getAddressParserGoal())){
|
||||
provinceInfo = getProvince(address.getCity());
|
||||
}*/
|
||||
}
|
||||
if (null != provinceInfo) {
|
||||
String province = provinceInfo[NAME_IDX];
|
||||
if (provinceInfo[FULL_NAME_IDX] != null) {//È«³ÆÆ¥Åä
|
||||
|
||||
+6
-4
@@ -2495,10 +2495,12 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
params.add(new QueryParam("visible", 0));
|
||||
params.add(new QueryParam("city", city));
|
||||
params.add(new QueryParam("category", "district"));
|
||||
params.add(new QueryParam("keyword", keyword));
|
||||
Query query = boostQueryDistrictPolicy.create(ServiceUtil.removeAndGetKeyword(params));
|
||||
if (query != null) {
|
||||
params.add(new QueryParam(QueryParam.SR_PARAM_NAME, new SrQuery(query)));
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
BooleanQuery query = new BooleanQuery();
|
||||
Query q1 = new TermQuery(new Term("keyword", keyword));
|
||||
q1.setBoost(0.99f);
|
||||
query.add(q1, Occur.SHOULD);
|
||||
params.add(new QueryParam("$sr", new SrQuery(query)));
|
||||
}
|
||||
return districtDao.findAllByParams(params, limit);
|
||||
}
|
||||
|
||||
@@ -284,5 +284,12 @@ public interface AddressService {
|
||||
* @return
|
||||
*/
|
||||
AddressCheckTruth aroundConsumeGrade(String city, String address);
|
||||
|
||||
|
||||
/**
|
||||
* 量地址相似度评级
|
||||
* @param result1
|
||||
* @param result2
|
||||
* @return 返回是否同一地址、输出级别(哪一级),相似度得分
|
||||
*/
|
||||
Map<String,Object> addressSimilarity(String result1, String result2);
|
||||
}
|
||||
|
||||
+159
-11
@@ -25,6 +25,9 @@ import java.util.concurrent.Future;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.fangjia.core.util.*;
|
||||
import com.fangjia.service.address.AddressParserUtil;
|
||||
import com.fangjia.service.address.mode.MatchResult;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@@ -49,18 +52,8 @@ import org.sothis.core.util.Closure;
|
||||
|
||||
import com.fangjia.core.BlockData;
|
||||
import com.fangjia.core.RegionData;
|
||||
import com.fangjia.core.util.AddressParser;
|
||||
import com.fangjia.core.util.AddressParserUtils;
|
||||
import com.fangjia.core.util.AddressResult;
|
||||
import com.fangjia.core.util.BeanUtils;
|
||||
import com.fangjia.core.util.CacheUtils;
|
||||
import com.fangjia.core.util.CacheUtils.CachePolicyEnum;
|
||||
import com.fangjia.core.util.DataUtil;
|
||||
import com.fangjia.core.util.DateUtil;
|
||||
import com.fangjia.core.util.GeoUtils;
|
||||
import com.fangjia.core.util.GeoUtils.GaussSphere;
|
||||
import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.core.util.LoggerFactory;
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.SdQuery;
|
||||
import com.fangjia.dal.SrQuery;
|
||||
@@ -5074,7 +5067,162 @@ public class AddressServiceImpl implements AddressService {
|
||||
}
|
||||
return checkTr;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> addressSimilarity(String result1, String result2) {
|
||||
JSONObject json1 = (JSONObject) JSONObject.fromObject(result1).get("result");
|
||||
JSONObject json2 = (JSONObject) JSONObject.fromObject(result2).get("result");
|
||||
Map<String,Object> resultMap = new HashMap<String, Object>();
|
||||
//判断是否同一地址
|
||||
boolean sameAddress = validSameAddress(json1, json2);
|
||||
String formatAddress1_pinyin = AddressParserUtil.toHanYuPinYin(getFromJson(json1, "formattedAddress"));
|
||||
String formatAddress2_pinyin = AddressParserUtil.toHanYuPinYin(getFromJson(json2,"formattedAddress"));
|
||||
double similar = AddressParserUtil.getSimilarityRatio(formatAddress1_pinyin, formatAddress2_pinyin);
|
||||
String level = getAddressSimilarityLevel(json1, json2);
|
||||
resultMap.put("isSameAddress", sameAddress);
|
||||
resultMap.put("score", similar);
|
||||
resultMap.put("level", level);
|
||||
resultMap.put("formattedAddress_1", getFromJson(json1,"formattedAddress"));
|
||||
resultMap.put("formattedAddress_2", getFromJson(json2,"formattedAddress"));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
private boolean validSameAddress(JSONObject json1, JSONObject json2){
|
||||
//标准化后地址完全一样
|
||||
if(getFromJson(json1, "formattedAddress").equals(getFromJson(json2, "formattedAddress"))){
|
||||
return true;
|
||||
}
|
||||
//判断判断省、市、区、乡镇、楼栋、单元、室号是否相同
|
||||
if(!verifySameField(getFromJson(json1,"province"), getFromJson(json2,"province"), false)
|
||||
|| !verifySameField(getFromJson(json1,"city"), getFromJson(json2,"city"), false)
|
||||
|| !verifySameField(getFromJson(json1,"district"), getFromJson(json2,"district"), false)
|
||||
|| !verifySameField(getFromJson(json1,"township"), getFromJson(json2,"township"), false)
|
||||
|| !verifySameField(getFromJson(json1,"buildingNumber"), getFromJson(json2,"buildingNumber"), true)
|
||||
|| !verifySameField(getFromJson(json1,"unitNumber"), getFromJson(json2,"unitNumber"), true)
|
||||
|| !verifySameField(getFromJson(json1,"roomNumber"), getFromJson(json2,"roomNumber"), true)){
|
||||
return false;
|
||||
}
|
||||
|
||||
String street1 = (StringUtils.isNotBlank(getFromJson(json1,"street")) ? getFromJson(json1,"street") : "") + (StringUtils.isNotBlank(getFromJson(json1,"streetNumber")) ? getFromJson(json1,"streetNumber") : "");
|
||||
String street2 = (StringUtils.isNotBlank(getFromJson(json2,"street")) ? getFromJson(json2,"street") : "") + (StringUtils.isNotBlank(getFromJson(json2,"streetNumber")) ? getFromJson(json2,"streetNumber") : "");
|
||||
String name1 = StringUtils.isNotBlank(getFromJson(json1,"name")) ? getFromJson(json1,"name") : "";
|
||||
String name2 = StringUtils.isNotBlank(getFromJson(json2,"name")) ? getFromJson(json2,"name") : "";
|
||||
//两个地址中路名+路号和poi全部为空时返回true
|
||||
if(StringUtils.isBlank(street1) && StringUtils.isBlank(street2) && StringUtils.isBlank(name1) && StringUtils.isBlank(name2)){
|
||||
return true;
|
||||
}
|
||||
//同一条地址里路名和poi不能全为空而另一条至少有一项有值
|
||||
if((StringUtils.isBlank(street1) && StringUtils.isBlank(name1)) || (StringUtils.isBlank(street2) && StringUtils.isBlank(name2))){
|
||||
return false;
|
||||
}
|
||||
//poi有任意一个为空则路名、路号必须完全一致
|
||||
if(StringUtils.isBlank(name1) || StringUtils.isBlank(name2)){
|
||||
if(StringUtils.isNotBlank(getFromJson(json1,"street")) && getFromJson(json1,"street").equals(getFromJson(json2,"street"))
|
||||
&& StringUtils.isNotBlank(getFromJson(json1,"streetNumber")) && getFromJson(json1,"streetNumber").equals(getFromJson(json2,"streetNumber"))){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//poi全不为空时,路名+路号一致(可为空),poi处理后一致
|
||||
if(verifySameField(street1, street2, false) && verifySamePoi(name1, name2)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getFromJson(JSONObject json, String key){
|
||||
if(json.containsKey(key)){
|
||||
return json.getString(key);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 获取两地址的相似度评级(最小颗粒度)
|
||||
* @return
|
||||
*/
|
||||
private String getAddressSimilarityLevel(JSONObject json1, JSONObject json2){
|
||||
if(StringUtils.isNotBlank(getFromJson(json1,"roomNumber")) || StringUtils.isNotBlank(getFromJson(json2,"roomNumber"))){
|
||||
return "roomNumber";
|
||||
}else if(StringUtils.isNotBlank(getFromJson(json1,"unitNumber")) || StringUtils.isNotBlank(getFromJson(json2,"unitNumber"))){
|
||||
return "unitNumber";
|
||||
}else if(StringUtils.isNotBlank(getFromJson(json1,"buildingNumber")) || StringUtils.isNotBlank(getFromJson(json2,"buildingNumber"))){
|
||||
return "buildingNumber";
|
||||
}else if(StringUtils.isNotBlank(getFromJson(json1,"name")) || StringUtils.isNotBlank(getFromJson(json2,"name"))){
|
||||
return "name";
|
||||
}else if(StringUtils.isNotBlank(getFromJson(json1,"street")) || StringUtils.isNotBlank(getFromJson(json2,"street"))){
|
||||
return "street";
|
||||
}else if(StringUtils.isNotBlank(getFromJson(json1,"township")) || StringUtils.isNotBlank(getFromJson(json2,"township"))){
|
||||
return "township";
|
||||
}else if(StringUtils.isNotBlank(getFromJson(json1,"district")) || StringUtils.isNotBlank(getFromJson(json2,"district"))){
|
||||
return "district";
|
||||
}else if(StringUtils.isNotBlank(getFromJson(json1,"city")) || StringUtils.isNotBlank(getFromJson(json2,"city"))){
|
||||
return "city";
|
||||
}else if(StringUtils.isNotBlank(getFromJson(json1,"province")) || StringUtils.isNotBlank(getFromJson(json2,"province"))){
|
||||
return "province";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 判断省、市、区、乡镇、楼栋、单元、室号是否相同(两者全为空时返回true)
|
||||
* @param str1
|
||||
* @param str2
|
||||
* @param flag true时严格判断 两者完全一致返回true(全为空或者全部有值并且值一致)
|
||||
* false时 两者完全一致或一方为空返回true(全为空或者全部有值并且值一致或任一方值为空)
|
||||
* @return
|
||||
*/
|
||||
private boolean verifySameField(String str1, String str2,boolean flag){
|
||||
if(flag){
|
||||
if(StringUtils.isBlank(str1) && StringUtils.isBlank(str2)){
|
||||
return true;
|
||||
}
|
||||
return StringUtils.isNotBlank(str1) ? str1.equals(str2) : false;
|
||||
}else{
|
||||
if(StringUtils.isBlank(str1) || StringUtils.isBlank(str2)){
|
||||
return true;
|
||||
}
|
||||
return str1.equals(str2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* //判断是否同一个poi(全部有数据时)
|
||||
* @param name1
|
||||
* @param name2
|
||||
* @return
|
||||
*/
|
||||
private boolean verifySamePoi(String name1, String name2){
|
||||
if(StringUtils.isBlank(name1) && StringUtils.isBlank(name2)){
|
||||
return false;
|
||||
}
|
||||
if(name1.equals(name2)){
|
||||
return true;
|
||||
}
|
||||
//分期
|
||||
String name1_stage = AddressParserUtil.match(AddressParserPatterns.STAGE_PATTERN,name1);
|
||||
String name2_stage = AddressParserUtil.match(AddressParserPatterns.STAGE_PATTERN,name2);
|
||||
//分区
|
||||
String name1_partition = AddressParserUtil.match(AddressParserPatterns.PARTITION_PATTERN,name1);
|
||||
String name2_partition = AddressParserUtil.match(AddressParserPatterns.PARTITION_PATTERN,name2);
|
||||
//数字
|
||||
String name1_number = AddressParserUtil.match(Pattern.compile("[\\d一二三四五六七八九十千百万]+"),name1);
|
||||
String name2_number = AddressParserUtil.match(Pattern.compile("[\\d一二三四五六七八九十千百万]+"),name2);
|
||||
if(!verifySameField(name1_stage, name2_stage, true) || !verifySameField(name1_partition, name2_partition, true)|| !verifySameField(name1_number, name2_number, true)){
|
||||
return false;
|
||||
}
|
||||
String name_1_pinyin = AddressParserUtil.toHanYuPinYin(name1);
|
||||
String name_2_pinyin = AddressParserUtil.toHanYuPinYin(name2);
|
||||
//拼音或文本数据包含并且
|
||||
boolean pinYinContains = (name_1_pinyin.contains(name_2_pinyin) || name_2_pinyin.contains(name_1_pinyin));
|
||||
if(pinYinContains){
|
||||
double similar = AddressParserUtil.getSimilarityRatio(name_1_pinyin, name_2_pinyin);
|
||||
if(similar > 0.5){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置区域消费指数
|
||||
* @param checkTr
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>org.sothis</groupId>
|
||||
<artifactId>sothis-core</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fangjia</groupId>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
FROM 192.168.0.19:9012/tomcat6:latest
|
||||
COPY target/*.war /home/goojia/webapps/ROOT.war
|
||||
@@ -51,7 +51,7 @@
|
||||
<dependency>
|
||||
<groupId>org.sothis</groupId>
|
||||
<artifactId>sothis-web</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
|
||||
+2
-8
@@ -22,14 +22,8 @@ public class DistrictController {
|
||||
private DistrictService districtService;
|
||||
|
||||
public Object loadDistrictAction(DistrictModel model, HttpServletRequest request){
|
||||
String url = openSearchService.createQueryUrl(model.getCityName(), model.getKeywords(), false);
|
||||
String content = openSearchService.findResultByUrl(url);
|
||||
List<String> regions = districtService.getRegionByCity(model.getCityName());
|
||||
Map<String, List<DistrictBo>> map = openSearchService.parseResult(content, regions, model.getKeywords());
|
||||
if(map.size() == 0){
|
||||
List<District> districts = districtService.findNewDistrict(model.getCityName(), model.getKeywords());
|
||||
map = openSearchService.createResult(districts);
|
||||
}
|
||||
List<District> districts = districtService.findDistrictByKeyword(model.getCityName(), model.getKeywords(), 10);
|
||||
Map<String, List<DistrictBo>> map = openSearchService.createResult(districts);
|
||||
JsonModel ret = new JsonModel();
|
||||
ret.setJsonModel(map);
|
||||
return ret;
|
||||
|
||||
@@ -155,11 +155,11 @@ public class BaseModel extends ModelAndViewSupport {
|
||||
}
|
||||
|
||||
public final String getRoot() {
|
||||
return (CONFIG.isDevelopmentEnvironment() ? "/geluke" : "");
|
||||
return "http://geluke.fangjia.com";
|
||||
}
|
||||
|
||||
public final String getWwwUrl() {
|
||||
return WWW_URL;
|
||||
return "http://geluke.fangjia.com";
|
||||
}
|
||||
|
||||
public final Date getNow() {
|
||||
@@ -270,7 +270,7 @@ public class BaseModel extends ModelAndViewSupport {
|
||||
}
|
||||
|
||||
public final String getCityUrl() {
|
||||
return CONFIG.getCityDomainName() + getRoot();
|
||||
return "http://geluke.fangjia.com";
|
||||
}
|
||||
|
||||
public final String getDomain() {
|
||||
|
||||
@@ -17,16 +17,32 @@ fangjia.auto.url=${fangjia.auto.host}:${fangjia.auto.port}/
|
||||
fangjia.file.mongo.host=fs.mongo.db.fangjia.com
|
||||
fangjia.file.mongo.port=27017
|
||||
|
||||
#fangjia.log.mongo.host=log.mongo.db.fangjia.com
|
||||
#fangjia.log.mongo.port=27017
|
||||
|
||||
fangjia.log.mongo.host=log.mongo.db.fangjia.com
|
||||
fangjia.log.mongo.port=27017
|
||||
fangjia.log.mongo.port=52002
|
||||
fangjia.log.mongodb.mongoUri=mongodb://${fangjia.log.mongo.host}:${fangjia.log.mongo.port}/
|
||||
|
||||
fangjia.mongo.host=mongo.db.fangjia.com
|
||||
fangjia.mongo.port=27017
|
||||
fangjia.mongo.port=28017
|
||||
fangjia.secondary.mongo.host=secondary.mongo.db.fangjia.com
|
||||
fangjia.secondary.mongo.port=28017
|
||||
fangjia.mongodb.mongoUri=mongodb://${fangjia.mongo.host}:${fangjia.mongo.port},${fangjia.secondary.mongo.host}:${fangjia.secondary.mongo.port}/
|
||||
|
||||
|
||||
fangjia.fs.mongo.host=fs.mongo.db.fangjia.com
|
||||
fangjia.fs.mongo.port=27017
|
||||
fangjia.fs.mongodb.mongoUri=mongodb://${fangjia.fs.mongo.host}:${fangjia.fs.mongo.port}/
|
||||
|
||||
fangjia.seabird.mongodb.mongoUri=mongodb://developer:G00IDCDEV12385@${fangjia.mongo.host}:${fangjia.mongo.port},${fangjia.secondary.mongo.host}:${fangjia.secondary.mongo.port}/
|
||||
|
||||
|
||||
fangjia.knowbase.host=knowbase.db.fangjia.com
|
||||
fangjia.knowbase.port=7180
|
||||
fangjia.knowbase.url=${fangjia.knowbase.host}:${fangjia.knowbase.port}/
|
||||
|
||||
|
||||
fangjia.environment=development
|
||||
#fangjia.environment=production
|
||||
|
||||
|
||||
@@ -18,8 +18,15 @@
|
||||
</bean>
|
||||
|
||||
<import resource="classpath:spring-service.xml" />
|
||||
|
||||
|
||||
<bean id="seabirdMongo" class="com.mongodb.MongoClient">
|
||||
<constructor-arg ref="seabirdMongoUri" />
|
||||
</bean>
|
||||
<bean id="seabirdMongoUri" class="com.mongodb.MongoClientURI">
|
||||
<constructor-arg type="java.lang.String" value="${fangjia.seabird.mongodb.mongoUri}"/>
|
||||
</bean>
|
||||
<bean id="seaweedDao" class="com.fangjia.dal.seaweed.dao.SeaweedDaoImpl">
|
||||
<property name="mongo" ref="seabirdMongo" />
|
||||
</bean>
|
||||
<bean id="dataStore" class="com.fangjia.datastore.driver.DataStore">
|
||||
<constructor-arg value="${fangjia.datastore.host}" />
|
||||
<constructor-arg value="${fangjia.datastore.port}" />
|
||||
@@ -29,20 +36,27 @@
|
||||
<constructor-arg value="${fangjia.seaweed.host}" />
|
||||
<constructor-arg value="${fangjia.seaweed.port}" />
|
||||
</bean>
|
||||
|
||||
<bean id="mongo" class="com.mongodb.Mongo">
|
||||
<constructor-arg index="0" value="${fangjia.mongo.host}" type="java.lang.String"/>
|
||||
<constructor-arg index="1" value="${fangjia.mongo.port}" type="int"/>
|
||||
|
||||
<bean id="mongoUri" class="com.mongodb.MongoClientURI">
|
||||
<constructor-arg type="java.lang.String" value="${fangjia.mongodb.mongoUri}"/>
|
||||
</bean>
|
||||
<bean id="mongo" class="com.mongodb.MongoClient">
|
||||
<constructor-arg ref="mongoUri" />
|
||||
</bean>
|
||||
|
||||
<bean id="logMongo" class="com.mongodb.Mongo">
|
||||
<constructor-arg index="0" value="${fangjia.log.mongo.host}" type="java.lang.String"/>
|
||||
<constructor-arg index="1" value="${fangjia.log.mongo.port}" type="int"/>
|
||||
|
||||
<bean id="logMongoUri" class="com.mongodb.MongoClientURI">
|
||||
<constructor-arg type="java.lang.String" value="${fangjia.log.mongodb.mongoUri}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="fileMongo" class="com.mongodb.Mongo">
|
||||
<constructor-arg index="0" value="${fangjia.file.mongo.host}" type="java.lang.String"/>
|
||||
<constructor-arg index="1" value="${fangjia.file.mongo.port}" type="int"/>
|
||||
<bean id="logMongo" class="com.mongodb.MongoClient">
|
||||
<constructor-arg ref="logMongoUri" />
|
||||
</bean>
|
||||
|
||||
<bean id="fileMongoUri" class="com.mongodb.MongoClientURI">
|
||||
<constructor-arg type="java.lang.String" value="${fangjia.fs.mongodb.mongoUri}"/>
|
||||
</bean>
|
||||
<bean id="fileMongo" class="com.mongodb.MongoClient">
|
||||
<constructor-arg ref="fileMongoUri" />
|
||||
</bean>
|
||||
|
||||
<context:component-scan base-package="com.fangjia.dal.datastore.dao"
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<filter-name>AccessLogFilter</filter-name>
|
||||
<filter-class>
|
||||
com.fangjia.geluke.filters.AccessLogFilter
|
||||
</filter-class>
|
||||
</filter>
|
||||
<!-- <filter>-->
|
||||
<!-- <filter-name>AccessLogFilter</filter-name>-->
|
||||
<!-- <filter-class>-->
|
||||
<!-- com.fangjia.geluke.filters.AccessLogFilter-->
|
||||
<!-- </filter-class>-->
|
||||
<!-- </filter>-->
|
||||
|
||||
<filter>
|
||||
<filter-name>SpiderValidateFilter</filter-name>
|
||||
@@ -47,20 +47,20 @@
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<filter-name>AnalyticsFilter</filter-name>
|
||||
<filter-class>
|
||||
org.springframework.web.filter.DelegatingFilterProxy
|
||||
</filter-class>
|
||||
<init-param>
|
||||
<param-name>targetBeanName</param-name>
|
||||
<param-value>analyticsFilter</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>targetFilterLifecycle</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<!-- <filter>-->
|
||||
<!-- <filter-name>AnalyticsFilter</filter-name>-->
|
||||
<!-- <filter-class>-->
|
||||
<!-- org.springframework.web.filter.DelegatingFilterProxy-->
|
||||
<!-- </filter-class>-->
|
||||
<!-- <init-param>-->
|
||||
<!-- <param-name>targetBeanName</param-name>-->
|
||||
<!-- <param-value>analyticsFilter</param-value>-->
|
||||
<!-- </init-param>-->
|
||||
<!-- <init-param>-->
|
||||
<!-- <param-name>targetFilterLifecycle</param-name>-->
|
||||
<!-- <param-value>true</param-value>-->
|
||||
<!-- </init-param>-->
|
||||
<!-- </filter>-->
|
||||
|
||||
<filter>
|
||||
<filter-name>sothis</filter-name>
|
||||
@@ -80,21 +80,21 @@
|
||||
<url-pattern>/*</url-pattern>
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
</filter-mapping>
|
||||
<filter-mapping>
|
||||
<filter-name>AccessLogFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
</filter-mapping>
|
||||
<!-- <filter-mapping>-->
|
||||
<!-- <filter-name>AccessLogFilter</filter-name>-->
|
||||
<!-- <url-pattern>/*</url-pattern>-->
|
||||
<!-- <dispatcher>REQUEST</dispatcher>-->
|
||||
<!-- </filter-mapping>-->
|
||||
<filter-mapping>
|
||||
<filter-name>SpiderValidateFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
</filter-mapping>
|
||||
<filter-mapping>
|
||||
<filter-name>AnalyticsFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
</filter-mapping>
|
||||
<!-- <filter-mapping>-->
|
||||
<!-- <filter-name>AnalyticsFilter</filter-name>-->
|
||||
<!-- <url-pattern>/*</url-pattern>-->
|
||||
<!-- <dispatcher>REQUEST</dispatcher>-->
|
||||
<!-- </filter-mapping>-->
|
||||
<filter-mapping>
|
||||
<filter-name>sothis</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
|
||||
@@ -23,58 +23,55 @@ id="changecity">
|
||||
<li>
|
||||
<div class="left">华东城市</div>
|
||||
<div class="right">
|
||||
<a name="shanghai" href="http://sh.${domain}${root}/">上海</a>
|
||||
<a name="hangzhou" href="http://hz.${domain}${root}/">杭州</a>
|
||||
<a name="nanjing" href="http://nj.${domain}${root}/">南京</a>
|
||||
<a name="ningbo" href="http://nb.${domain}${root}/">宁波</a>
|
||||
<a name="suzhou" href="http://suz.${domain}${root}/">苏州</a>
|
||||
<a name="wuxi" href="http://wx.${domain}${root}/">无锡</a>
|
||||
<a name="jinan" href="http://jn.${domain}${root}/">济南</a>
|
||||
<a name="qingdao" href="http://qd.${domain}${root}/">青岛</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E4%B8%8A%E6%B5%B7">上海</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E6%9D%AD%E5%B7%9E">杭州</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%8D%97%E4%BA%AC">南京</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%AE%81%E6%B3%A2">宁波</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E6%97%A0%E9%94%A1">无锡</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E6%B5%8E%E5%8D%97">济南</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E9%9D%92%E5%B2%9B">青岛</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="left">华北东北</div>
|
||||
<div class="right">
|
||||
<a name="beijing" href="http://bj.${domain}${root}/">北京</a>
|
||||
<a name="tianjin" href="http://tj.${domain}${root}/">天津</a>
|
||||
<a name="shenyang" href="http://sy.${domain}${root}/">沈阳</a>
|
||||
<a name="shijiazhuang" href="http://sjz.${domain}${root}/">石家庄</a>
|
||||
<a name="dalian" href="http://dl.${domain}${root}/">大连</a>
|
||||
<a name="taiyuan" href="http://ty.${domain}${root}/">太原</a>
|
||||
<a name="changchun" href="http://changchun.${domain}${root}/">长春</a>
|
||||
<a name="haerbin" href="http://haerbin.${domain}${root}/">哈尔滨</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%8C%97%E4%BA%AC">北京</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%A4%A9%E6%B4%A5">天津</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E6%B2%88%E9%98%B3">沈阳</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E7%9F%B3%E5%AE%B6%E5%BA%84">石家庄</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%A4%A7%E8%BF%9E">大连</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%A4%AA%E5%8E%9F">太原</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E9%95%BF%E6%98%A5">长春</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%93%88%E5%B0%94%E6%BB%A8">哈尔滨</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="left">华南华中</div>
|
||||
<div class="right">
|
||||
<a name="guangzhou" href="http://gz.${domain}${root}/">广州</a>
|
||||
<a name="shenzhen" href="http://sz.${domain}${root}/">深圳</a>
|
||||
<a name="wuhan" href="http://wh.${domain}${root}/">武汉</a>
|
||||
<a name="sanya" href="http://sanya.${domain}${root}/">三亚</a>
|
||||
<a name="fuzhou" href="http://fz.${domain}${root}/">福州</a>
|
||||
<a name="changsha" href="http://cs.${domain}${root}/">长沙</a>
|
||||
<a name="xiamen" href="http://xm.${domain}${root}/">厦门</a>
|
||||
<a name="zhengzhou" href="http://zz.${domain}${root}/">郑州</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%B9%BF%E5%B7%9E">广州</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E6%B7%B1%E5%9C%B3">深圳</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E6%AD%A6%E6%B1%89">武汉</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E4%B8%89%E4%BA%9A">三亚</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E7%A6%8F%E5%B7%9E">福州</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E9%95%BF%E6%B2%99">长沙</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%8E%A6%E9%97%A8">厦门</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E9%83%91%E5%B7%9E">郑州</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div class="left">西部城市</div>
|
||||
<div class="right">
|
||||
<a name="chengdu" href="http://cd.${domain}${root}/">成都</a>
|
||||
<a name="xian" href="http://xa.${domain}${root}/">西安</a>
|
||||
<a name="chongqing" href="http://cq.${domain}${root}/">重庆</a>
|
||||
<a name="guiyang" href="http://guiyang.${domain}${root}/">贵阳</a>
|
||||
<a name="kunming" href="http://kunming.${domain}${root}/">昆明</a>
|
||||
<a name="yinchuan" href="http://yinchuan.${domain}${root}/">银川</a>
|
||||
<a name="lanzhou" href="http://lanzhou.${domain}${root}/">兰州</a>
|
||||
<a name="wulumuqi" href="http://xj.${domain}${root}/">乌鲁木齐</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E6%88%90%E9%83%BD">成都</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E8%A5%BF%E5%AE%89">西安</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E9%87%8D%E5%BA%86">重庆</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E8%B4%B5%E9%98%B3">贵阳</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E6%98%86%E6%98%8E">昆明</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E9%93%B6%E5%B7%9D">银川</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E5%85%B0%E5%B7%9E">兰州</a>
|
||||
<a name="shanghai" href="http://geluke.fangjia.com/map/index?cityName=%E4%B9%8C%E9%B2%81%E6%9C%A8%E9%BD%90">乌鲁木齐</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li><div class="left"></div><div class="right"><span class="more"><a href="http://www.${domain}${root}/">更多城市>></a></span></div></li>
|
||||
</ul>
|
||||
</div>
|
||||
<#--地图城市切换 end-->
|
||||
@@ -28,7 +28,7 @@ $(document).ready(function(){
|
||||
$("#_h_logout").click(function(){
|
||||
jQuery.ajax({
|
||||
type: "get",
|
||||
url: "http://" + location.host + "${root}/user/logout",
|
||||
url: "http://geluke.fangjia.com/user/logout",
|
||||
dataType:'json',
|
||||
success: function(msg){
|
||||
location.href = '${cityUrl}';
|
||||
|
||||
@@ -200,27 +200,9 @@
|
||||
<script type="text/javascript">
|
||||
$(".tab-pane a, .hotcity a").click(function(){
|
||||
var cityName = this.innerHTML;
|
||||
// var userName = '${loginUserName!}';
|
||||
var name = this.name;
|
||||
|
||||
// if(cityName!='上海'&&userName=='xianlixiong'&&cityName!='北京'){
|
||||
// cityName = '上海';
|
||||
// name = 'sh';
|
||||
// }
|
||||
// if(cityName!='上海'&&userName=='pingping'){
|
||||
// cityName = '上海';
|
||||
// name = 'sh';
|
||||
// }
|
||||
// if((userName=='Angela'||userName=='jialun')&&cityName!='上海'&&cityName!='昆山'){
|
||||
// cityName = '上海';
|
||||
// name = 'sh';
|
||||
// }
|
||||
// $(".cityWidth").text(cityName);
|
||||
|
||||
var url = 'http://'+name+'.${domain}${root}/map/index?cityName='+encodeURIComponent(cityName)+"&t=" + new Date().getTime()
|
||||
var url = 'http://geluke.fangjia.com/map/index?cityName='+encodeURIComponent(cityName)+"&t=" + new Date().getTime()
|
||||
window.location.href = url;
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user