Merge branch 'master' of http://gitlab.fangjia.com/dev0/main into new_fjw
# Conflicts: # projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/SaleLeadsController.java # projects/fangjia-coresite/src/main/webapp/index.ftl # projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java
This commit is contained in:
+586
-14
@@ -1,6 +1,9 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.dal.common.DistrictKey;
|
||||
import com.fangjia.dal.mongo.model.VillageIdentify;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.open.dto.addressGovernance.*;
|
||||
import com.fangjia.open.interceptors.Authority;
|
||||
import com.fangjia.open.interceptors.Role;
|
||||
@@ -9,9 +12,33 @@ import com.fangjia.open.model.AddressModel;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
import com.fangjia.open.util.CommonDtoUtils;
|
||||
import com.fangjia.service.bo.DistrictStatBo;
|
||||
import com.fangjia.service.datastore.DistrictService;
|
||||
import com.fangjia.service.district.DistrictStatService;
|
||||
import com.fangjia.service.mongo.fangjia.VillageIdentifyService;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.sothis.core.util.Pager;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Authenticator;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.Proxy;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -24,6 +51,10 @@ import java.util.Map;
|
||||
@Authority(role = Role.USER)
|
||||
public class AddrSvcController {
|
||||
|
||||
private DistrictStatService districtStatService;
|
||||
private DistrictService districtService;
|
||||
private VillageIdentifyService villageIdentifyService;
|
||||
|
||||
/**
|
||||
* 地址结构化
|
||||
*
|
||||
@@ -179,7 +210,7 @@ public class AddrSvcController {
|
||||
/**
|
||||
* 地址匹配
|
||||
*/
|
||||
public Object matchAction(AddesssMatchModel model) {
|
||||
public Object matchAction(AddesssMatchModel model) throws Exception {
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getAddress())) {
|
||||
@@ -195,18 +226,13 @@ public class AddrSvcController {
|
||||
params.put("category", model.getCategory());
|
||||
params.put("district", model.getSuggestDistrict());
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/match", params, "UTF-8");
|
||||
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(CommonDtoUtils.transformV(MatchedBuildingDto.class, json.get("result")));
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
} else {
|
||||
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||
//新匹配接口
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8");
|
||||
BasicModel basicModel = new BasicModel(200, "ok");
|
||||
if (json != null && json.size() > 0) {
|
||||
basicModel.setResult(CommonDtoUtils.transformV(MatchedBuildingDto.class, json));
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||
@@ -226,7 +252,7 @@ public class AddrSvcController {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("城市不能为空"));
|
||||
return mav;
|
||||
}
|
||||
if (StringUtils.isBlank(model.getKeyword())) {
|
||||
if (StringUtils.isBlank(model.getKeywords())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("关键字不能为空"));
|
||||
return mav;
|
||||
}
|
||||
@@ -236,7 +262,7 @@ public class AddrSvcController {
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", model.getCity());
|
||||
params.put("region", model.getRegion());
|
||||
params.put("keywords", model.getKeyword());
|
||||
params.put("keywords", model.getKeywords());
|
||||
params.put("page", "0");
|
||||
params.put("size", String.valueOf(model.getMax() == 0 ? 20 : (model.getMax() > 100 ? 100 : model.getMax())));
|
||||
try {
|
||||
@@ -262,9 +288,555 @@ public class AddrSvcController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
public static void main(String[] args) {
|
||||
String address = "江西省南康市蓉江街道办事处麻田村石桥19号";
|
||||
String townShip = "蓉江街道";
|
||||
System.out.println(address.substring(address.indexOf(townShip)+townShip.length()));
|
||||
=======
|
||||
public Object avgPriceAction(AddressModel 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", model.getCity());
|
||||
params.put("address", model.getAddress());
|
||||
params.put("category", model.getCategory());
|
||||
params.put("useMap", String.valueOf(model.isUseMap()));
|
||||
// params.put("district", model.getSuggestDistrict());//接口没有此参数
|
||||
try {
|
||||
//新匹配接口
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8");
|
||||
BasicModel basicModel = new BasicModel(200, "ok");
|
||||
if (json != null && json.size() > 0) {
|
||||
MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, json);
|
||||
|
||||
District district = districtService.findByNameAndAlias(dto.getCity(), dto.getDistrict(), dto.getName(), "district");
|
||||
if (null != district) {
|
||||
DistrictStatBo statBo = districtStatService.findCurrentDistrictStat(new DistrictKey(dto.getCity(), dto.getDistrict(), dto.getName()));
|
||||
if (null != statBo) {
|
||||
if (statBo.getDistrictStat() != null) {
|
||||
dto.setAvgPrice(statBo.getDistrictStat().getAvgPrice());
|
||||
} else if (statBo.getVillaDistrictStat() != null) {
|
||||
dto.setAvgPrice(statBo.getVillaDistrictStat().getAvgPrice());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
basicModel.setResult(dto);
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||
}
|
||||
|
||||
return mav;
|
||||
}
|
||||
|
||||
/**
|
||||
* 五级地址标准化
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object fiveLevelStructureAction(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() : null);
|
||||
params.put("refCity", StringUtils.isNotBlank(model.getRefCity()) ? model.getRefCity() : null);
|
||||
params.put("address", model.getAddress());
|
||||
// 默认不输出省市区的代码
|
||||
params.put("showCode", StringUtils.isNotBlank(model.getShowCode()) ? model.getShowCode() : "0");
|
||||
params.put("complete", "true");
|
||||
params.put("addressAssessment", "true");
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v3/structure", params, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v3/structure", params, "UTF-8");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("msgCode");
|
||||
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;
|
||||
}
|
||||
|
||||
private static final Map<String, String> areaMap = new HashMap<String, String>() {
|
||||
{
|
||||
// 添加键值对到 Map 中
|
||||
put("111", "主城区");
|
||||
put("112", "城乡结合区");
|
||||
put("121", "镇中心区");
|
||||
put("122", "镇乡结合区");
|
||||
put("123", "特殊区域");
|
||||
put("210", "乡中心区");
|
||||
put("220", "村庄");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 涉农识别-新规则-南京银行
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object njcbVillageIdentifyAction(AddressModel 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() : null);
|
||||
String address = model.getAddress();
|
||||
params.put("address", address);
|
||||
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
|
||||
params.put("type", type);
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("msgCode");
|
||||
String msg = json.getString("msg");
|
||||
BasicModel basicModel = new BasicModel(code, msg);
|
||||
if (json.containsKey("result")) {
|
||||
//我们的结果
|
||||
JSONObject result = json.getJSONObject("result");
|
||||
//我们省级及以上有开发区,直接用我们的结果
|
||||
if (result.containsKey("devDistrictName")) {
|
||||
basicModel.setResult(result);
|
||||
|
||||
} else {
|
||||
try {
|
||||
//如果是江苏省或者浙江省 调用齐梁的结果
|
||||
if ("江苏省".equals(result.getString("province")) || "浙江省".equals(result.getString("province"))) {
|
||||
//结果比较,如果涉农结果不一致
|
||||
//调用齐梁 type :1 对公 0 对私
|
||||
//我们 type :1 对私 2 对共
|
||||
String qltype = "2".equals(type) ? "1" : "0";
|
||||
Map<String, String> map = senRequest(address, qltype);
|
||||
// 涉农结果不一样
|
||||
if (!map.get("verifyFlag").equals(result.get("verifyFlag"))) {
|
||||
//城市不一样 用我们
|
||||
if (result.containsKey("city")) {
|
||||
if ((!result.get("city").equals(map.get("city")) && StringUtils.isNotBlank(result.getString("city")))) {
|
||||
basicModel.setResult(result);
|
||||
} else {
|
||||
map.put("addrVerify", "地址有效");
|
||||
map.put("typeName", areaMap.get(map.get("typeCode")));
|
||||
basicModel.setResult(map);
|
||||
}
|
||||
} else {
|
||||
map.put("addrVerify", "地址有效");
|
||||
map.put("typeName", areaMap.get(map.get("typeCode")));
|
||||
basicModel.setResult(map);
|
||||
}
|
||||
|
||||
} else {
|
||||
basicModel.setResult(result);
|
||||
}
|
||||
|
||||
} else {
|
||||
basicModel.setResult(result);
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
basicModel.setResult(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
} else {
|
||||
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 涉农识别-新规则-基础版本
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object villageIdentifyAction(AddressModel 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() : null);
|
||||
String address = model.getAddress();
|
||||
params.put("address", address);
|
||||
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
|
||||
String villageType = "2".equals(model.getType()) ? "对公" : "对私";
|
||||
params.put("type", type);
|
||||
params.put("showFullValue", "2");
|
||||
Pager pager = new Pager(1, 1);
|
||||
VillageIdentify villageResult = villageIdentifyService.findAll(villageType, model.getCity(), model.getAddress(), pager).get(0);
|
||||
if (villageResult != null && StringUtils.isNotBlank(villageResult.getVerifyFlag())) {
|
||||
Map<String, String> resultMap = new HashMap<String, String>();
|
||||
resultMap.put("province",villageResult.getProvince());
|
||||
resultMap.put("city",villageResult.getCity1());
|
||||
resultMap.put("district",villageResult.getDistrict());
|
||||
resultMap.put("town",villageResult.getTown());
|
||||
resultMap.put("committee",villageResult.getCommittee());
|
||||
resultMap.put("provinceCode",villageResult.getCityCode());
|
||||
resultMap.put("cityCode",villageResult.getCityCode());
|
||||
resultMap.put("districtCode",villageResult.getDistrictCode());
|
||||
resultMap.put("townCode",villageResult.getTownCode());
|
||||
resultMap.put("committeeCode",villageResult.getCommitteeCode());
|
||||
resultMap.put("typeCode",villageResult.getTypeCode());
|
||||
resultMap.put("typeName",villageResult.getTypeName());
|
||||
resultMap.put("verifyFlag",villageResult.getVerifyFlag());
|
||||
resultMap.put("addrVerify", villageResult.getAddrVerify());
|
||||
resultMap.put("countyLevelCity",villageResult.getCountyLevelCity());
|
||||
resultMap.put("administrativeTowns",villageResult.getAdministrativeTowns());
|
||||
resultMap.put("countyGov",villageResult.getCountyGov());
|
||||
resultMap.put("devDistrict",villageResult.getDevDistrict());
|
||||
resultMap.put("devDistrictName",villageResult.getDevDistrictName());
|
||||
resultMap.put("devLevel",villageResult.getDevLevel());
|
||||
resultMap.put("addrArea",villageResult.getAddrArea());
|
||||
BasicModel basicModel = new BasicModel(200, "OK");
|
||||
basicModel.setResult(resultMap);
|
||||
mav.setModel(basicModel);
|
||||
} else {
|
||||
// params.put("showTestValue", "2");
|
||||
Integer radius = model.getRadius();
|
||||
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("msgCode");
|
||||
String msg = json.getString("msg");
|
||||
BasicModel basicModel = new BasicModel(code, msg);
|
||||
if (json.containsKey("result")) {
|
||||
//我们的结果
|
||||
JSONObject result = json.getJSONObject("result");
|
||||
//我们省级及以上有开发区,直接用我们的结果
|
||||
if (result.containsKey("devDistrictName")) {
|
||||
basicModel.setResult(result);
|
||||
|
||||
} else {
|
||||
try {
|
||||
//如果是江苏省或者浙江省 调用齐梁的结果
|
||||
if ("江苏省".equals(result.getString("province")) || "浙江省".equals(result.getString("province"))) {
|
||||
|
||||
//结果比较,如果涉农结果不一致
|
||||
//调用齐梁 type :1 对公 0 对私
|
||||
//我们 type :1 对私 2 对共
|
||||
String qltype = "2".equals(type) ? "1" : "0";
|
||||
Map<String, String> map = senRequest(address, qltype);
|
||||
// 涉农结果不一样
|
||||
if (!map.get("verifyFlag").equals(result.get("verifyFlag"))) {
|
||||
//有市辖建制镇, 或者城市不一样 用我们
|
||||
if (result.containsKey("city")) {
|
||||
if ("是".equals(result.get("administrativeTowns")) || (!result.get("city").equals(map.get("city")) && StringUtils.isNotBlank(result.getString("city")))) {
|
||||
basicModel.setResult(result);
|
||||
} else {
|
||||
map.put("addrVerify", "地址有效");
|
||||
map.put("typeName", areaMap.get(map.get("typeCode")));
|
||||
basicModel.setResult(map);
|
||||
}
|
||||
} else {
|
||||
map.put("addrVerify", "地址有效");
|
||||
map.put("typeName", areaMap.get(map.get("typeCode")));
|
||||
basicModel.setResult(map);
|
||||
}
|
||||
|
||||
} else {
|
||||
basicModel.setResult(result);
|
||||
}
|
||||
|
||||
} else {
|
||||
basicModel.setResult(result);
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
basicModel.setResult(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
} else {
|
||||
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||
}
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
private static Map<String, String> senRequest(String address, String type) throws IOException {
|
||||
String targetURL = "http://146.56.217.44:9010/uams/farmer/all/v3/sign";
|
||||
String proxyHost = "tunnel2.qg.net";
|
||||
int proxyPort = 14186;
|
||||
final String proxyUsername = "113BBC06";
|
||||
final String proxyPassword = "3B2FBD05B0AF";
|
||||
String jsonData = "{\"address\":\"" + address + "\",\"type\":\"" + type + "\"}";
|
||||
String authKey = proxyUsername;
|
||||
String password = proxyPassword;
|
||||
String auth = authKey + ":" + password;
|
||||
String authHeader = "Basic " + new BASE64Encoder().encode(auth.getBytes(Charset.forName("UTF-8")));
|
||||
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(targetURL);
|
||||
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(proxyUsername, proxyPassword.toCharArray());
|
||||
}
|
||||
});
|
||||
httpPost.setHeader("Content-Type", "application/json");
|
||||
httpPost.setHeader("Accept", "*/*");
|
||||
httpPost.setHeader("Host", "146.56.217.44:9010");
|
||||
httpPost.setHeader("Proxy-Authorization", authHeader);
|
||||
StringEntity stringEntity = new StringEntity(jsonData, ContentType.APPLICATION_JSON);
|
||||
httpPost.setEntity(stringEntity);
|
||||
|
||||
CloseableHttpResponse httpResponse = null;
|
||||
int retryCount = 2; // 设置重试次数
|
||||
int retryDelay = 10; // 设置重试延迟时间(毫秒)
|
||||
boolean success = false;
|
||||
for (int i = 0; i < retryCount; i++) {
|
||||
try {
|
||||
httpResponse = httpClient.execute(httpPost);
|
||||
success = true;
|
||||
break;
|
||||
} catch (IOException e) {
|
||||
System.err.println("代理请求失败,进行重试...");
|
||||
try {
|
||||
Thread.sleep(retryDelay);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (success) {
|
||||
HttpEntity responseEntity = httpResponse.getEntity();
|
||||
String responseString = EntityUtils.toString(responseEntity);
|
||||
|
||||
// 使用 Gson 解析 JSON 字符串
|
||||
Gson gson = new Gson();
|
||||
JsonObject jsonObject = gson.fromJson(responseString, JsonObject.class);
|
||||
|
||||
|
||||
// 创建 Map 存储各个值
|
||||
Map<String, String> dataMap = new HashMap<String, String>();
|
||||
|
||||
// 获取各个值并放入 Map
|
||||
// dataMap.put("code", jsonObject.get("code").getAsString());
|
||||
// dataMap.put("msg", jsonObject.get("msg").getAsString());
|
||||
JsonElement dataElement = jsonObject.get("data");
|
||||
if (dataElement != null && !dataElement.isJsonNull() && dataElement.isJsonObject()) {
|
||||
JsonObject data = dataElement.getAsJsonObject();
|
||||
// 在这里继续处理 data 对象
|
||||
|
||||
if (data != null && !data.isJsonNull()) {
|
||||
|
||||
// dataMap.put("version", data.get("version").getAsString());
|
||||
dataMap.put("province", data.get("province").getAsString());
|
||||
dataMap.put("city", data.get("city").getAsString());
|
||||
dataMap.put("district", data.get("district").getAsString());
|
||||
dataMap.put("town", data.get("town").getAsString());
|
||||
dataMap.put("committee", data.get("village").getAsString());
|
||||
dataMap.put("provinceCode", data.get("provinceCode").getAsString());
|
||||
dataMap.put("cityCode", data.get("cityCode").getAsString());
|
||||
dataMap.put("districtCode", data.get("districtCode").getAsString());
|
||||
dataMap.put("townCode", data.get("townCode").getAsString());
|
||||
dataMap.put("committeeCode", data.get("villageCode").getAsString());
|
||||
dataMap.put("typeCode", data.get("areaCode").getAsString());
|
||||
dataMap.put("verifyFlag", "0".equals(data.get("farmer").getAsString()) ? "非农" : "农");
|
||||
dataMap.put("countyGov", "0".equals(data.get("isGovt").getAsString()) ? "否" : "是");
|
||||
// dataMap.put("govtAddr", data.get("govtAddr").isJsonNull() ? null : data.get("govtAddr").getAsString()); // 对于可能为 null 的值,需要判断是否为空
|
||||
JsonArray indusParkList = data.get("indusParkList").isJsonNull() ? null : data.get("indusParkList").getAsJsonArray();
|
||||
|
||||
if (indusParkList != null) {
|
||||
JsonObject jsonObject1 = gson.fromJson(indusParkList.get(0), JsonObject.class);
|
||||
dataMap.put("devDistrictName", jsonObject1.get("indusParkName").getAsString());
|
||||
dataMap.put("devLevel", jsonObject1.get("indusParkLevel").getAsString());
|
||||
dataMap.put("devDistrict", "是");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
httpResponse.close();
|
||||
return dataMap;
|
||||
} else {
|
||||
System.err.println("重试次数已用完,请求失败。");
|
||||
}
|
||||
|
||||
httpClient.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 涉农识别-新规则-标准版
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object villageIdentifyStandardAction(AddressModel 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() : null);
|
||||
params.put("address", model.getAddress());
|
||||
params.put("type", StringUtils.isNotBlank(model.getType()) ? model.getType() : null);
|
||||
params.put("showFullValue", StringUtils.isNotBlank(model.getShowFullValue()) ? model.getShowFullValue() : null);
|
||||
params.put("showTestValue", StringUtils.isNotBlank(model.getShowTestValue()) ? model.getShowTestValue() : null);
|
||||
Integer radius = model.getRadius();
|
||||
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("msgCode");
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 地址联想-PRO
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object addressAssociationAction(AddressModel model) {
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getKeywords()) && (StringUtils.isBlank(model.getLat()) && StringUtils.isBlank(model.getLng()))) {
|
||||
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() : null);
|
||||
params.put("district", StringUtils.isNotBlank(model.getDistrict()) ? model.getDistrict() : null);
|
||||
params.put("keywords", StringUtils.isNotBlank(model.getKeywords()) ? model.getKeywords() : null);
|
||||
if (StringUtils.isNotBlank(model.getLng()) && StringUtils.isNotBlank(model.getLat())) {
|
||||
params.put("lat", model.getLat());
|
||||
params.put("lng", model.getLng());
|
||||
}
|
||||
Integer radius = model.getRadius();
|
||||
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v2/addressAssociation", params, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v2/addressAssociation", params, "UTF-8");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("msgCode");
|
||||
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;
|
||||
}
|
||||
|
||||
public void setDistrictStatService(DistrictStatService districtStatService) {
|
||||
this.districtStatService = districtStatService;
|
||||
}
|
||||
|
||||
public void setDistrictService(DistrictService districtService) {
|
||||
this.districtService = districtService;
|
||||
}
|
||||
|
||||
public void setVillageIdentifyService(VillageIdentifyService villageIdentifyService) {
|
||||
this.villageIdentifyService = villageIdentifyService;
|
||||
>>>>>>> c7c2bae298951f01848f2b654c4c5e7fdba454c0
|
||||
}
|
||||
}
|
||||
|
||||
+3283
-3278
File diff suppressed because it is too large
Load Diff
+1359
File diff suppressed because it is too large
Load Diff
@@ -55,38 +55,44 @@ public class Controller {
|
||||
return mav;
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存刷新接口
|
||||
* @return
|
||||
*/
|
||||
@Authority(role = Role.NONE)
|
||||
public Object refreshCacheAction(RefreshCacheModel model){
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
Token token = FangjiaApiUtil.parse2Token(model.getToken());
|
||||
if(token == null){
|
||||
mav.setModel(BasicModel.buildUnAuthorizedModel().setMsg("非法的Token"));
|
||||
return mav;
|
||||
}
|
||||
final ThreadLocalData threadLocalData = ThreadLocalData.getInstance();
|
||||
threadLocalData.put(ThreadLocalKey.DisableCache, "1");
|
||||
// 在验证appKey
|
||||
ApiUser apiUser = this.apiUserService.findApiUserById(token.getUserId());
|
||||
if(apiUser == null){
|
||||
mav.setModel(BasicModel.buildUnAuthorizedModel().setMsg("非法的Token"));
|
||||
return mav;
|
||||
}
|
||||
try {
|
||||
apiUserAuthorityService.findByUserId(apiUser.getId());
|
||||
if(StringUtils.isNotBlank(model.getViewConfigUrl())){
|
||||
apiUserAuthorityService.findViewConfig(apiUser.getId(), model.getViewConfigUrl());
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mav.setModel(BasicModel.buildOKModel().setMsg("缓存刷新成功"));
|
||||
return mav;
|
||||
}
|
||||
/**
|
||||
* 缓存刷新接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Authority(role = Role.NONE)
|
||||
public Object refreshCacheAction(RefreshCacheModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
Token token = FangjiaApiUtil.parse2Token(model.getToken());
|
||||
if (token == null) {
|
||||
mav.setModel(BasicModel.buildUnAuthorizedModel().setMsg("非法的Token"));
|
||||
return mav;
|
||||
}
|
||||
final ThreadLocalData threadLocalData = ThreadLocalData.getInstance();
|
||||
threadLocalData.put(ThreadLocalKey.DisableCache, "1");
|
||||
// 在验证appKey
|
||||
ApiUser apiUser = this.apiUserService.findApiUserById(token.getUserId());
|
||||
if (apiUser == null) {
|
||||
mav.setModel(BasicModel.buildUnAuthorizedModel().setMsg("非法的Token"));
|
||||
return mav;
|
||||
}
|
||||
try {
|
||||
// 获取用户
|
||||
User user = userService.findById(apiUser.getId());
|
||||
if (null != user && StringUtils.isNotBlank(user.getUserName())) {
|
||||
userService.findByUserName(user.getUserName());
|
||||
}
|
||||
apiUserAuthorityService.findByUserId(apiUser.getId());
|
||||
if (StringUtils.isNotBlank(model.getViewConfigUrl())) {
|
||||
apiUserAuthorityService.findViewConfig(apiUser.getId(), model.getViewConfigUrl());
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mav.setModel(BasicModel.buildOKModel().setMsg("缓存刷新成功"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+38
-1
@@ -7,9 +7,12 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.fangjia.core.RegionData;
|
||||
import com.fangjia.core.util.DateUtil;
|
||||
import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.dal.mongo.model.*;
|
||||
import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
|
||||
import com.fangjia.open.model.AvgPriceQueryModel;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.util.CommonDtoUtils;
|
||||
import com.fangjia.service.datastore.RegionStatService;
|
||||
import com.fangjia.service.district.DistrictFacilitysService;
|
||||
import com.fangjia.service.district.DistrictStatRentService;
|
||||
@@ -1164,7 +1167,41 @@ public class DistrictController {
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Object addrFacilitysAction(DistrictSearchModel model, @Param(name = "city") String city, @Param(name = "address") String address) throws Exception{
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (StringUtils.isBlank(address)) {
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "地址必须输入"));
|
||||
return mav;
|
||||
} else {
|
||||
String cat = "district";
|
||||
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", city);
|
||||
params.put("address", address);
|
||||
params.put("category", "property");
|
||||
//新匹配接口
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8");
|
||||
District property = null;
|
||||
if (json != null && json.size() > 0) {
|
||||
MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, json);
|
||||
property = districtService.findByNameAndAlias(dto.getCity(), dto.getDistrict(), dto.getName(), cat);
|
||||
if (null == property) {
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "小区数据不存在"));
|
||||
return mav;
|
||||
}
|
||||
DistrictFacilitys facilitys = districtFacilitysService.findByDistrict(property);
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(facilitys));
|
||||
}else{
|
||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "小区数据不存在"));
|
||||
}
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+258
@@ -0,0 +1,258 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.open.interceptors.Authority;
|
||||
import com.fangjia.open.interceptors.Role;
|
||||
import com.fangjia.open.model.AddressModel;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Authenticator;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.Proxy;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 光大接口
|
||||
*/
|
||||
@Authority(role = Role.USER)
|
||||
public class GdBankController {
|
||||
|
||||
private static final Map<String, String> areaMap = new HashMap<String, String>() {
|
||||
{
|
||||
// 添加键值对到 Map 中
|
||||
put("111", "主城区");
|
||||
put("112", "城乡结合区");
|
||||
put("121", "镇中心区");
|
||||
put("122", "镇乡结合区");
|
||||
put("123", "特殊区域");
|
||||
put("210", "乡中心区");
|
||||
put("220", "村庄");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 涉农识别-新规则-光大银行
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object villageIdentifyAction(AddressModel model) {
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getAddress())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
|
||||
return mav;
|
||||
}
|
||||
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
|
||||
String address = model.getAddress();
|
||||
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
|
||||
params.put("type", type);
|
||||
params.put("redis", (model.getRadius() != null && model.getRadius() != 0) ? model.getRadius().toString() : null);
|
||||
params.put("address", model.getAddress());
|
||||
params.put("showFullValue", "2");
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (json != null) {
|
||||
int code = json.getInt("msgCode");
|
||||
String msg = json.getString("msg");
|
||||
BasicModel basicModel = new BasicModel(code, msg);
|
||||
if (json.containsKey("result")) {
|
||||
//我们的结果
|
||||
JSONObject result = json.getJSONObject("result");
|
||||
if (("是").equals(result.get("countyLevelCity"))) {
|
||||
result.put("prefectureLevelCity", "否");
|
||||
} else if (("否").equals(result.get("countyLevelCity"))) {
|
||||
result.put("prefectureLevelCity", "是");
|
||||
}
|
||||
// 如果是无效信息或者没有行政区划,则用我们的
|
||||
if (result.containsKey("addrVerify") && ("无效".equals(result.getString("addrVerify")) || "没有行政区划".equals(result.getString("addrVerify")))) {
|
||||
basicModel.setResult(result);
|
||||
//我们省级及以上有开发区,直接用我们的结果
|
||||
} else if (result.containsKey("devDistrictName")) {
|
||||
basicModel.setResult(result);
|
||||
} else {
|
||||
try {
|
||||
//如果是江苏省或者浙江省 调用齐梁的结果
|
||||
if ("江苏省".equals(result.getString("province")) || "浙江省".equals(result.getString("province"))) {
|
||||
|
||||
//结果比较,如果涉农结果不一致
|
||||
//调用齐梁 type :1 对公 0 对私
|
||||
//我们 type :1 对私 2 对共
|
||||
String qltype = "2".equals(type) ? "1" : "0";
|
||||
Map<String, String> map = senRequest(address, qltype);
|
||||
// 涉农结果不一样
|
||||
if (!map.get("verifyFlag").equals(result.get("verifyFlag"))) {
|
||||
//有市辖建制镇, 或者城市不一样 用我们
|
||||
if (result.containsKey("city") && ("是".equals(result.get("administrativeTowns")) || (!result.get("city").equals(map.get("city"))
|
||||
&& StringUtils.isNotBlank(result.getString("city"))))) {
|
||||
basicModel.setResult(result);
|
||||
} else {
|
||||
if (("是").equals(result.get("countyLevelCity"))) {
|
||||
map.put("prefectureLevelCity", "否");
|
||||
} else if (("否").equals(result.get("countyLevelCity"))) {
|
||||
map.put("prefectureLevelCity", "是");
|
||||
}
|
||||
map.put("addrVerify", "地址有效");
|
||||
if (result.containsKey("countyLevelCity")) {
|
||||
map.put("countyLevelCity", result.getString("countyLevelCity"));
|
||||
}
|
||||
map.put("typeName", areaMap.get(map.get("typeCode")));
|
||||
basicModel.setResult(map);
|
||||
}
|
||||
} else {
|
||||
basicModel.setResult(result);
|
||||
}
|
||||
|
||||
} else {
|
||||
basicModel.setResult(result);
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
basicModel.setResult(result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
} else {
|
||||
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
private static Map<String, String> senRequest(String address, String type) throws IOException {
|
||||
String targetURL = "http://146.56.217.44:9010/uams/farmer/all/v3/sign";
|
||||
String proxyHost = "tunnel2.qg.net";
|
||||
int proxyPort = 14186;
|
||||
final String proxyUsername = "113BBC06";
|
||||
final String proxyPassword = "3B2FBD05B0AF";
|
||||
String jsonData = "{\"address\":\"" + address + "\",\"type\":\"" + type + "\"}";
|
||||
String authKey = proxyUsername;
|
||||
String password = proxyPassword;
|
||||
String auth = authKey + ":" + password;
|
||||
String authHeader = "Basic " + new BASE64Encoder().encode(auth.getBytes(Charset.forName("UTF-8")));
|
||||
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(targetURL);
|
||||
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(proxyUsername, proxyPassword.toCharArray());
|
||||
}
|
||||
});
|
||||
httpPost.setHeader("Content-Type", "application/json");
|
||||
httpPost.setHeader("Accept", "*/*");
|
||||
httpPost.setHeader("Host", "146.56.217.44:9010");
|
||||
httpPost.setHeader("Proxy-Authorization", authHeader);
|
||||
StringEntity stringEntity = new StringEntity(jsonData, ContentType.APPLICATION_JSON);
|
||||
httpPost.setEntity(stringEntity);
|
||||
|
||||
CloseableHttpResponse httpResponse = null;
|
||||
int retryCount = 2; // 设置重试次数
|
||||
int retryDelay = 10; // 设置重试延迟时间(毫秒)
|
||||
boolean success = false;
|
||||
for (int i = 0; i < retryCount; i++) {
|
||||
try {
|
||||
httpResponse = httpClient.execute(httpPost);
|
||||
success = true;
|
||||
break;
|
||||
} catch (IOException e) {
|
||||
System.err.println("代理请求失败,进行重试...");
|
||||
try {
|
||||
Thread.sleep(retryDelay);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (success) {
|
||||
HttpEntity responseEntity = httpResponse.getEntity();
|
||||
String responseString = EntityUtils.toString(responseEntity);
|
||||
|
||||
// 使用 Gson 解析 JSON 字符串
|
||||
Gson gson = new Gson();
|
||||
JsonObject jsonObject = gson.fromJson(responseString, JsonObject.class);
|
||||
|
||||
|
||||
// 创建 Map 存储各个值
|
||||
Map<String, String> dataMap = new HashMap<String, String>();
|
||||
|
||||
// 获取各个值并放入 Map
|
||||
// dataMap.put("code", jsonObject.get("code").getAsString());
|
||||
// dataMap.put("msg", jsonObject.get("msg").getAsString());
|
||||
JsonElement dataElement = jsonObject.get("data");
|
||||
if (dataElement != null && !dataElement.isJsonNull() && dataElement.isJsonObject()) {
|
||||
JsonObject data = dataElement.getAsJsonObject();
|
||||
// 在这里继续处理 data 对象
|
||||
|
||||
if (data != null && !data.isJsonNull()) {
|
||||
|
||||
// dataMap.put("version", data.get("version").getAsString());
|
||||
dataMap.put("province", data.get("province").getAsString());
|
||||
dataMap.put("city", data.get("city").getAsString());
|
||||
dataMap.put("district", data.get("district").getAsString());
|
||||
dataMap.put("town", data.get("town").getAsString());
|
||||
dataMap.put("committee", data.get("village").getAsString());
|
||||
dataMap.put("provinceCode", data.get("provinceCode").getAsString());
|
||||
dataMap.put("cityCode", data.get("cityCode").getAsString());
|
||||
dataMap.put("districtCode", data.get("districtCode").getAsString());
|
||||
dataMap.put("townCode", data.get("townCode").getAsString());
|
||||
dataMap.put("committeeCode", data.get("villageCode").getAsString());
|
||||
dataMap.put("typeCode", data.get("areaCode").getAsString());
|
||||
dataMap.put("verifyFlag", "0".equals(data.get("farmer").getAsString()) ? "非农" : "农");
|
||||
dataMap.put("countyGov", "0".equals(data.get("isGovt").getAsString()) ? "否" : "是");
|
||||
// dataMap.put("govtAddr", data.get("govtAddr").isJsonNull() ? null : data.get("govtAddr").getAsString()); // 对于可能为 null 的值,需要判断是否为空
|
||||
JsonArray indusParkList = data.get("indusParkList").isJsonNull() ? null : data.get("indusParkList").getAsJsonArray();
|
||||
|
||||
if (indusParkList != null) {
|
||||
JsonObject jsonObject1 = gson.fromJson(indusParkList.get(0), JsonObject.class);
|
||||
dataMap.put("devDistrictName", jsonObject1.get("indusParkName").getAsString());
|
||||
dataMap.put("devDistrict", "是");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
httpResponse.close();
|
||||
return dataMap;
|
||||
} else {
|
||||
System.err.println("重试次数已用完,请求失败。");
|
||||
}
|
||||
|
||||
httpClient.close();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -4,6 +4,8 @@ import java.util.Date;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.fangjia.dal.sql.model.User;
|
||||
import com.fangjia.service.sql.UserService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bson.types.ObjectId;
|
||||
|
||||
@@ -39,6 +41,7 @@ public class GuzhiController {
|
||||
private EvaluationService evaluationService;
|
||||
private SmsService smsService;
|
||||
private DistrictService districtService;
|
||||
private UserService userService;
|
||||
|
||||
private static final String DING_MSG_ROBOT_ID = "58c62a54d92790b58177c6d6";
|
||||
|
||||
@@ -150,7 +153,9 @@ public class GuzhiController {
|
||||
UniversalDto dto = UniversalDto.newDto();
|
||||
dto.append("caseId", model.getCaseId());
|
||||
mv.setModel(BasicModel.buildOKModel().setResult(dto));
|
||||
String msg = "【房价网-人工估值】接收到新的人工询价,请求请及时处理!城市:" + evaluation.getCity()
|
||||
|
||||
User user = userService.findById(token.getUserId());
|
||||
String msg = "【房价网-人工估值】客户: "+user.getDisplayName()+" 提交新的人工询价,请求请及时处理!城市:" + evaluation.getCity()
|
||||
+ " 区域:" + evaluation.getRegion() + " 小区名:" + evaluation.getDistrictName();
|
||||
DingDingMessageUtil.sendTextMessage("065f4a05d5f87eb39a9f9e048eeefb80c1f7560446f8926441de80453c160c60", msg);
|
||||
return mv;
|
||||
@@ -183,4 +188,8 @@ public class GuzhiController {
|
||||
public void setDistrictService(DistrictService districtService) {
|
||||
this.districtService = districtService;
|
||||
}
|
||||
|
||||
public void setUserService(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
}
|
||||
|
||||
+164
-1
@@ -20,14 +20,18 @@ import com.fangjia.open.FangjiaApiUtil;
|
||||
import com.fangjia.open.HttpCode;
|
||||
import com.fangjia.open.OpenHttpCodeEnum;
|
||||
import com.fangjia.open.dto.HouseDto;
|
||||
import com.fangjia.open.dto.UniversalDto;
|
||||
import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
|
||||
import com.fangjia.open.interceptors.Authority;
|
||||
import com.fangjia.open.interceptors.Role;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.model.HousePublishModel;
|
||||
import com.fangjia.open.model.HouseSearchModel;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
import com.fangjia.open.util.CommonDtoUtils;
|
||||
import com.fangjia.open.util.FileDao;
|
||||
import com.fangjia.open.ws.query.CollateralSampleQuery;
|
||||
import com.fangjia.open.ws.query.SampleQuery;
|
||||
import com.fangjia.open.ws.query.ShopCollateralSampleQuery;
|
||||
import com.fangjia.service.address.AddressParser;
|
||||
import com.fangjia.service.bo.Collateral;
|
||||
@@ -55,6 +59,7 @@ import com.fangjia.service.open.HousePojo;
|
||||
import com.fangjia.service.sql.ApiUserService;
|
||||
import com.fangjia.service.sql.UserService;
|
||||
import com.fangjia.service.web.MenuService;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bson.types.ObjectId;
|
||||
import org.sothis.core.util.Closure;
|
||||
@@ -65,7 +70,6 @@ import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Authority(role = Role.USER)
|
||||
public class HouseController {
|
||||
|
||||
@@ -322,6 +326,117 @@ public class HouseController {
|
||||
return queryBeans;
|
||||
}
|
||||
|
||||
|
||||
private List<CollateralSampleQueryBean> convertSampileQueryToBean(SampleQuery... queries) throws Exception{
|
||||
|
||||
List<CollateralSampleQueryBean> queryBeans = new ArrayList<CollateralSampleQueryBean>(queries.length);
|
||||
for(SampleQuery q : queries){
|
||||
|
||||
CollateralSampleQueryBean queryBean = new CollateralSampleQueryBean();
|
||||
BeanUtils.copyProperties(q, queryBean);
|
||||
// String propertyTypeCode = queryBean.getPropertyTypeCode();
|
||||
// if(!Arrays.asList("01", "02", "03").contains(propertyTypeCode)){
|
||||
// throw new Exception("propertyTypeCode取值非法");
|
||||
// }
|
||||
String cat = "district";
|
||||
|
||||
if(StringUtils.isNotBlank(queryBean.getCity()) && StringUtils.isNotBlank(queryBean.getDistrict()) && StringUtils.isNotBlank(queryBean.getBuildingName())){
|
||||
District property = districtService.findByNameAndAlias(queryBean.getCity(), queryBean.getDistrict(), queryBean.getBuildingName(), cat);
|
||||
if(property == null){
|
||||
throw new Exception("未找到该小区");
|
||||
}
|
||||
queryBean.setProperty(property);
|
||||
}else if(StringUtils.isNotBlank(queryBean.getAddress())){
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
String address = queryBean.getAddress().replace(" ","").replace("%","");
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", queryBean.getCity());
|
||||
params.put("address", address);
|
||||
params.put("category", "property");
|
||||
//新匹配接口
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8");
|
||||
if (json != null && json.size()>0) {
|
||||
MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, json);
|
||||
District property = districtService.findByNameAndAlias(dto.getCity(), dto.getDistrict(), dto.getName(), cat);
|
||||
if(property == null){
|
||||
throw new Exception("未找到该小区");
|
||||
}
|
||||
queryBean.setProperty(property);
|
||||
}else{
|
||||
throw new Exception("未找到该小区");
|
||||
}
|
||||
}
|
||||
String estateType = queryBean.getProperty().getEstateType2();
|
||||
queryBean.setPropertyTypeCode("01");
|
||||
if(StringUtils.isNotBlank(estateType)){
|
||||
if(estateType.equals("普通住宅")){
|
||||
queryBean.setPropertyTypeCode("01");
|
||||
}else if(estateType.equals("别墅")){
|
||||
queryBean.setPropertyTypeCode("02");
|
||||
}else if(estateType.equals("商住")){
|
||||
queryBean.setPropertyTypeCode("03");
|
||||
}
|
||||
}
|
||||
|
||||
Integer decrCondCode = queryBean.getDecrCondCode();
|
||||
if(decrCondCode == null){
|
||||
decrCondCode = 2;
|
||||
}
|
||||
if(decrCondCode > 5 || decrCondCode < 1){
|
||||
throw new Exception("decrCondCode取值非法");
|
||||
}
|
||||
Integer towardDirectCode = queryBean.getTowardDirectCode();
|
||||
if(towardDirectCode == null){
|
||||
towardDirectCode = 3;
|
||||
}
|
||||
if(towardDirectCode > 10 || towardDirectCode < 1){
|
||||
throw new Exception("towardDirectCode取值非法");
|
||||
}
|
||||
queryBeans.add(queryBean);
|
||||
}
|
||||
return queryBeans;
|
||||
}
|
||||
|
||||
|
||||
// private List<CollateralSampleQueryBean> convertSampileQueryToBean(SampleQuery... queries) throws Exception{
|
||||
//
|
||||
// List<CollateralSampleQueryBean> queryBeans = new ArrayList<CollateralSampleQueryBean>(queries.length);
|
||||
// for(SampleQuery q : queries){
|
||||
//
|
||||
// CollateralSampleQueryBean queryBean = new CollateralSampleQueryBean();
|
||||
// BeanUtils.copyProperties(q, queryBean);
|
||||
//
|
||||
//
|
||||
// String propertyTypeCode = queryBean.getPropertyTypeCode();
|
||||
// if(!Arrays.asList("01", "02", "03").contains(propertyTypeCode)){
|
||||
// throw new Exception("propertyTypeCode取值非法");
|
||||
// }
|
||||
// String cat = "district";
|
||||
// District property = districtService.findByNameAndAlias(queryBean.getCity(), queryBean.getDistrict(), queryBean.getBuildingName(), cat);
|
||||
// if(property == null){
|
||||
// throw new Exception("未找到该小区");
|
||||
// }
|
||||
// queryBean.setProperty(property);
|
||||
// Integer decrCondCode = queryBean.getDecrCondCode();
|
||||
// if(decrCondCode == null){
|
||||
// decrCondCode = 2;
|
||||
// }
|
||||
// if(decrCondCode > 5 || decrCondCode < 1){
|
||||
// throw new Exception("decrCondCode取值非法");
|
||||
// }
|
||||
// Integer towardDirectCode = queryBean.getTowardDirectCode();
|
||||
// if(towardDirectCode == null){
|
||||
// towardDirectCode = 3;
|
||||
// }
|
||||
// if(towardDirectCode > 10 || towardDirectCode < 1){
|
||||
// throw new Exception("towardDirectCode取值非法");
|
||||
// }
|
||||
// queryBeans.add(queryBean);
|
||||
// }
|
||||
// return queryBeans;
|
||||
// }
|
||||
|
||||
public Object detailAction(HousePublishModel model){
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
@@ -774,6 +889,54 @@ public class HouseController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
public Object caseAction(@Valid SampleQuery sampleQuery){
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
List<CollateralSampleQueryBean> querys = null;
|
||||
try{
|
||||
querys = convertSampileQueryToBean(sampleQuery);
|
||||
}catch (Exception e){
|
||||
mav.setModel(BasicModel.buildBadRequestModel(e.getMessage()));
|
||||
return mav;
|
||||
}
|
||||
if(null == sampleQuery.getMax()){
|
||||
sampleQuery.setMax(10);
|
||||
}
|
||||
long start = System.currentTimeMillis();
|
||||
List<Collateral> collaterals = czbankSampleService.findSample2(querys, sampleQuery.getMax());
|
||||
long end = System.currentTimeMillis();
|
||||
System.out.println("用时:"+(end-start));
|
||||
Collateral collateral = collaterals.get(0);
|
||||
List<Sample> samples = collateral.getSample();
|
||||
UniversalDto dto = UniversalDto.newDto();
|
||||
if(null != collateral.getMaxPrice()){
|
||||
dto.append("maxUnitPrice", collateral.getMaxPrice());
|
||||
}
|
||||
if(null != collateral.getMinPrice()){
|
||||
dto.append("minUnitPrice", collateral.getMinPrice());
|
||||
}
|
||||
|
||||
dto.append("datas", samples);
|
||||
// if(samples!= null && samples.size()>=2){
|
||||
// Sample minSample = samples.get(samples.size()-2);
|
||||
// Sample maxSample = samples.get(samples.size()-1);
|
||||
// dto.append("minUnitPrice", minSample.getUnitPrice());
|
||||
// dto.append("maxUnitPrice", maxSample.getUnitPrice());
|
||||
// }
|
||||
// if(samples.size()>2){
|
||||
// dto.append("datas", samples.subList(0, samples.size()-2));
|
||||
// }else{
|
||||
// dto.append("datas", samples);
|
||||
// }
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(dto));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private List<HousePojo> fillDistrictInfoForHouse(FacetQueryResult<com.fangjia.service.bo.HouseBo> houseList, Date endDate,
|
||||
District district, boolean showDetail, boolean matchModel) {
|
||||
FacetQueryResult<HousePojo> list = new FacetQueryResult<HousePojo>();
|
||||
|
||||
+101
-46
@@ -1,6 +1,7 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import com.fangjia.core.RegionData;
|
||||
import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.dal.mongo.model.AmapPoi;
|
||||
import com.fangjia.dal.mongo.model.CbmRegion;
|
||||
import com.fangjia.dal.mongo.model.elastic.CbmAmapPoi;
|
||||
@@ -8,10 +9,7 @@ import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.open.dto.UniversalDto;
|
||||
import com.fangjia.open.interceptors.Authority;
|
||||
import com.fangjia.open.interceptors.Role;
|
||||
import com.fangjia.open.model.AntiFraudQuestionModel;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.model.PoiSuggestModel;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
import com.fangjia.open.model.*;
|
||||
import com.fangjia.service.address.AddressParserService;
|
||||
import com.fangjia.service.address.AddressParserUtil;
|
||||
import com.fangjia.service.address.mode.Address;
|
||||
@@ -19,6 +17,7 @@ import com.fangjia.service.api.AmapPoiService;
|
||||
import com.fangjia.service.bo.Point;
|
||||
import com.fangjia.service.datastore.DistrictService;
|
||||
import com.fangjia.service.mongo.fangjia.CbmRegionService;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -33,14 +32,14 @@ public class PoiController {
|
||||
private DistrictService districtService;
|
||||
private static final String[] PROPERTY_SEARCH_API_FIELDS = {"address", "city", "region", "name", "addrAlias"};
|
||||
|
||||
public Object getAntiFraudQuestionAction(@Valid AntiFraudQuestionModel model){
|
||||
public Object getAntiFraudQuestionAction(@Valid AntiFraudQuestionModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
Point point = amapPoiService.geocode(model.getCity(), model.getAddress());
|
||||
if(point != null){
|
||||
if (point != null) {
|
||||
List<AmapPoi> poiList = amapPoiService.findAntiFraudPoisAction(point, model.getActualPoiSelectRadius(),
|
||||
model.getFraudPoiSelectMinRadius(), model.getActualCount(), model.getFraudCount());
|
||||
List<UniversalDto> pois = new ArrayList<UniversalDto>();
|
||||
for(AmapPoi poi : poiList){
|
||||
for (AmapPoi poi : poiList) {
|
||||
UniversalDto dto = UniversalDto.newDto();
|
||||
dto.append("id", poi.getId());
|
||||
dto.append("city", poi.getCityname());
|
||||
@@ -54,22 +53,22 @@ public class PoiController {
|
||||
pois.add(dto);
|
||||
}
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(pois));
|
||||
}else{
|
||||
} else {
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(Collections.emptyList()));
|
||||
}
|
||||
return mav;
|
||||
|
||||
}
|
||||
|
||||
public Object cmbTipsAction(@Valid PoiSuggestModel poiSuggestModel){
|
||||
public Object cmbTipsAction(@Valid PoiSuggestModel poiSuggestModel) {
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
String city = RegionData.formatCity(poiSuggestModel.getCity());
|
||||
if(city != null){
|
||||
if (city != null) {
|
||||
String region = RegionData.formatRegion(city, poiSuggestModel.getRegion());
|
||||
if(!RegionData.isRegion(city, region) && RegionData.getRegionByCity(city) != null){
|
||||
for(String r : RegionData.getRegionByCity(city)){
|
||||
if(region.startsWith(r)){
|
||||
if (!RegionData.isRegion(city, region) && RegionData.getRegionByCity(city) != null) {
|
||||
for (String r : RegionData.getRegionByCity(city)) {
|
||||
if (region.startsWith(r)) {
|
||||
region = r;
|
||||
break;
|
||||
}
|
||||
@@ -78,71 +77,71 @@ public class PoiController {
|
||||
poiSuggestModel.setCity(city);
|
||||
poiSuggestModel.setRegion(region);
|
||||
}
|
||||
if(!RegionData.isRegion(poiSuggestModel.getCity(), poiSuggestModel.getRegion()) || !RegionData.isCity(poiSuggestModel.getCity())){
|
||||
if (!RegionData.isRegion(poiSuggestModel.getCity(), poiSuggestModel.getRegion()) || !RegionData.isCity(poiSuggestModel.getCity())) {
|
||||
CbmRegion cbmRegion = cbmRegionService.findCbmRegion(poiSuggestModel.getCity(), poiSuggestModel.getRegion());
|
||||
if(cbmRegion != null){
|
||||
if (cbmRegion != null) {
|
||||
poiSuggestModel.setCity(cbmRegion.getCity());
|
||||
poiSuggestModel.setRegion(cbmRegion.getRegion());
|
||||
}
|
||||
}
|
||||
if(city == null){
|
||||
if (city == null) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("city·Ç·¨"));
|
||||
return mav;
|
||||
}
|
||||
Address address = addressParserService.standardizeForSearch(poiSuggestModel.getCity(), poiSuggestModel.getKeywords());
|
||||
String keywords = poiSuggestModel.getKeywords();
|
||||
if(StringUtils.isNotBlank(address.getEffectiveAddress())){
|
||||
if (StringUtils.isNotBlank(address.getEffectiveAddress())) {
|
||||
poiSuggestModel.setKeywords(address.getEffectiveAddress());
|
||||
poiSuggestModel.setCity(address.getCity());
|
||||
if(StringUtils.isNotBlank(address.getDistrict())){
|
||||
if (StringUtils.isNotBlank(address.getDistrict())) {
|
||||
poiSuggestModel.setRegion(address.getDistrict());
|
||||
}
|
||||
}
|
||||
List<District> districts = districtService.cmbSearch(poiSuggestModel.getCity(), poiSuggestModel.getRegion(), poiSuggestModel.getKeywords(), PROPERTY_SEARCH_API_FIELDS, poiSuggestModel.getLimit());
|
||||
List<UniversalDto> dtos = new ArrayList<UniversalDto>();
|
||||
Set<String> keys = new HashSet<String>();
|
||||
for(District district : districts){
|
||||
for (District district : districts) {
|
||||
UniversalDto dto = new UniversalDto();
|
||||
dto.append("city", district.getCity());
|
||||
dto.append("region", district.getRegion());
|
||||
if(district.getName().contains(poiSuggestModel.getKeywords()) || district.getAlias() == null){
|
||||
if (district.getName().contains(poiSuggestModel.getKeywords()) || district.getAlias() == null) {
|
||||
dto.append("name", district.getName());
|
||||
keys.add(district.getName());
|
||||
dto.append("address", district.getAddress());
|
||||
}else{
|
||||
} else {
|
||||
dto.append("name", getLookLikeString(poiSuggestModel.getKeywords(), district.getAlias(), district.getName()));
|
||||
keys.add((String)dto.get("name"));
|
||||
if(district.getAddress() == null || district.getAddress().contains(poiSuggestModel.getKeywords()) || district.getAddrAlias() == null){
|
||||
keys.add((String) dto.get("name"));
|
||||
if (district.getAddress() == null || district.getAddress().contains(poiSuggestModel.getKeywords()) || district.getAddrAlias() == null) {
|
||||
dto.append("address", district.getAddress());
|
||||
}else{
|
||||
} else {
|
||||
dto.append("address", getLookLikeString(poiSuggestModel.getKeywords(), district.getAddrAlias(), district.getAddress()));
|
||||
}
|
||||
}
|
||||
dtos.add(dto);
|
||||
}
|
||||
if(dtos.size() == poiSuggestModel.getLimit()){
|
||||
if (dtos.size() == poiSuggestModel.getLimit()) {
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(dtos));
|
||||
return mav;
|
||||
}
|
||||
List<AmapPoi> amapPois = amapPoiService.inputtips(poiSuggestModel.getCity(), poiSuggestModel.getRegion(), keywords, poiSuggestModel.getLimit(), false);
|
||||
for(AmapPoi amapPoi : amapPois){
|
||||
if(!keys.contains(amapPoi.getName())){
|
||||
for (AmapPoi amapPoi : amapPois) {
|
||||
if (!keys.contains(amapPoi.getName())) {
|
||||
UniversalDto dto = new UniversalDto();
|
||||
if(amapPoi.getCity() == null){
|
||||
if (amapPoi.getCity() == null) {
|
||||
dto.append("city", poiSuggestModel.getCity());
|
||||
}else{
|
||||
} else {
|
||||
dto.append("city", amapPoi.getCity());
|
||||
}
|
||||
if(amapPoi.getRegion() == null){
|
||||
if (amapPoi.getRegion() == null) {
|
||||
dto.append("region", poiSuggestModel.getRegion());
|
||||
}else{
|
||||
} else {
|
||||
dto.append("region", amapPoi.getRegion());
|
||||
}
|
||||
dto.append("name", amapPoi.getName());
|
||||
dto.append("address", amapPoi.getAddress());
|
||||
dtos.add(dto);
|
||||
}
|
||||
if(dtos.size() >= poiSuggestModel.getLimit()){
|
||||
if (dtos.size() >= poiSuggestModel.getLimit()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -150,16 +149,16 @@ public class PoiController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
String getLookLikeString(String orgStr, List<String> list, String extend){
|
||||
if(list == null){
|
||||
String getLookLikeString(String orgStr, List<String> list, String extend) {
|
||||
if (list == null) {
|
||||
list = new ArrayList<String>();
|
||||
}
|
||||
list.add(extend);
|
||||
String targetStr = extend;
|
||||
double similar = 0;
|
||||
for(String item : list){
|
||||
for (String item : list) {
|
||||
double s = AddressParserUtil.getSimilarityRatio(orgStr, item);
|
||||
if(s > similar){
|
||||
if (s > similar) {
|
||||
targetStr = item;
|
||||
similar = s;
|
||||
}
|
||||
@@ -167,14 +166,14 @@ public class PoiController {
|
||||
return targetStr;
|
||||
}
|
||||
|
||||
public Object cmbTips2Action(@Valid PoiSuggestModel poiSuggestModel){
|
||||
public Object cmbTips2Action(@Valid PoiSuggestModel poiSuggestModel) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
String city = RegionData.formatCity(poiSuggestModel.getCity());
|
||||
if(city != null){
|
||||
if (city != null) {
|
||||
String region = RegionData.formatRegion(city, poiSuggestModel.getRegion());
|
||||
if(!RegionData.isRegion(city, region) && RegionData.getRegionByCity(city) != null){
|
||||
for(String r : RegionData.getRegionByCity(city)){
|
||||
if(region.startsWith(r)){
|
||||
if (!RegionData.isRegion(city, region) && RegionData.getRegionByCity(city) != null) {
|
||||
for (String r : RegionData.getRegionByCity(city)) {
|
||||
if (region.startsWith(r)) {
|
||||
region = r;
|
||||
break;
|
||||
}
|
||||
@@ -183,28 +182,28 @@ public class PoiController {
|
||||
poiSuggestModel.setCity(city);
|
||||
poiSuggestModel.setRegion(region);
|
||||
}
|
||||
if(!RegionData.isRegion(poiSuggestModel.getCity(), poiSuggestModel.getRegion()) || !RegionData.isCity(poiSuggestModel.getCity())){
|
||||
if (!RegionData.isRegion(poiSuggestModel.getCity(), poiSuggestModel.getRegion()) || !RegionData.isCity(poiSuggestModel.getCity())) {
|
||||
CbmRegion cbmRegion = cbmRegionService.findCbmRegion(poiSuggestModel.getCity(), poiSuggestModel.getRegion());
|
||||
poiSuggestModel.setCity(cbmRegion.getCity());
|
||||
poiSuggestModel.setRegion(cbmRegion.getRegion());
|
||||
}
|
||||
Address address = addressParserService.standardizeForSearch(poiSuggestModel.getCity(), poiSuggestModel.getKeywords());
|
||||
if(StringUtils.isNotBlank(address.getEffectiveAddress())){
|
||||
if (StringUtils.isNotBlank(address.getEffectiveAddress())) {
|
||||
poiSuggestModel.setKeywords(address.getEffectiveAddress());
|
||||
poiSuggestModel.setCity(address.getCity());
|
||||
poiSuggestModel.setRegion(address.getDistrict());
|
||||
}
|
||||
List<CbmAmapPoi> amapPois = amapPoiService.cmbTips(poiSuggestModel.getCity(), poiSuggestModel.getRegion(), poiSuggestModel.getKeywords());
|
||||
List<UniversalDto> dtos = new ArrayList<UniversalDto>();
|
||||
for(CbmAmapPoi poi : amapPois){
|
||||
for (CbmAmapPoi poi : amapPois) {
|
||||
UniversalDto dto = UniversalDto.newDto();
|
||||
dto.append("city", poi.getCityname());
|
||||
dto.append("region", poi.getAdname());
|
||||
dto.append("name", poi.getName());
|
||||
dto.append("address", poi.getAddress());
|
||||
if(!poi.getName().startsWith(poiSuggestModel.getKeywords()) && poi.getAlias() != null && poi.getAlias().contains(poi.getText())){
|
||||
if (!poi.getName().startsWith(poiSuggestModel.getKeywords()) && poi.getAlias() != null && poi.getAlias().contains(poi.getText())) {
|
||||
dto.append("name", poi.getText());
|
||||
}else if((poi.getAddress() != null && !poi.getAddress().startsWith(poiSuggestModel.getKeywords())) && poi.getAddrAlias() != null && poi.getAddrAlias().contains(poi.getText())){
|
||||
} else if ((poi.getAddress() != null && !poi.getAddress().startsWith(poiSuggestModel.getKeywords())) && poi.getAddrAlias() != null && poi.getAddrAlias().contains(poi.getText())) {
|
||||
dto.append("address", poi.getText());
|
||||
}
|
||||
dtos.add(dto);
|
||||
@@ -213,6 +212,62 @@ public class PoiController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
/**
|
||||
* POI搜索服务
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object searchAction(AddressModel model) {
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getLocation()) || StringUtils.isBlank(model.getCity())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("城市和经纬度为必填项"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", model.getCity());
|
||||
params.put("location", model.getLocation());
|
||||
params.put("types", StringUtils.isNotBlank(model.getTypes()) ? model.getTypes() : null);
|
||||
Integer radius = model.getRadius();
|
||||
if (radius != null && radius > 0) {
|
||||
params.put("radius", radius.toString());
|
||||
}
|
||||
Integer offset = model.getOffset();
|
||||
if (offset != null && offset > 0) {
|
||||
params.put("offset", offset.toString());
|
||||
}
|
||||
Integer page = model.getPage();
|
||||
if (page != null && page > 0) {
|
||||
params.put("page", page.toString());
|
||||
}
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/poi/search", params, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/poi/search", params, "UTF-8");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("msgCode");
|
||||
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;
|
||||
}
|
||||
|
||||
public void setAmapPoiService(AmapPoiService amapPoiService) {
|
||||
this.amapPoiService = amapPoiService;
|
||||
}
|
||||
|
||||
+161
-35
@@ -10,17 +10,7 @@ import java.net.URLEncoder;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -30,6 +20,7 @@ import javax.validation.Valid;
|
||||
|
||||
import com.fangjia.core.util.*;
|
||||
import com.fangjia.dal.*;
|
||||
import com.fangjia.dal.mongo.dao.AliasFangDao;
|
||||
import com.fangjia.dal.mongo.model.*;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityBasePrice;
|
||||
import com.fangjia.dal.mongo.open.model.CommunityPoi;
|
||||
@@ -37,6 +28,9 @@ import com.fangjia.dal.mongo.open.model.EvaluateRatio;
|
||||
import com.fangjia.dal.seawater.dao.SeawaterDao;
|
||||
import com.fangjia.dal.seawater.model.Seawater;
|
||||
import com.fangjia.open.dto.*;
|
||||
import com.fangjia.open.dto.addressGovernance.StructureDto;
|
||||
import com.fangjia.open.util.CommonDtoUtils;
|
||||
import com.fangjia.service.address.AddressParserUtil;
|
||||
import com.fangjia.service.district.*;
|
||||
import com.fangjia.service.mongo.fangjia.*;
|
||||
import com.fangjia.service.open.*;
|
||||
@@ -136,7 +130,6 @@ import com.mongodb.DBObject;
|
||||
|
||||
@Authority(role = Role.USER)
|
||||
public class PropertyController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PropertyController.class);
|
||||
private DistrictService districtService;
|
||||
private AddressParser addressParser;
|
||||
@@ -184,7 +177,7 @@ public class PropertyController {
|
||||
|
||||
private FileDao fileDao = FileDao.getInstance();
|
||||
private static final int DEFAULT_PAGE_SIZE = 20;
|
||||
private static final String[] PROPERTY_SEARCH_API_FIELDS = { "address", "city", "region", "name", "lat2", "lng2","lat", "lng", "block", "estateType2", "addrAlias" };
|
||||
private static final String[] PROPERTY_SEARCH_API_FIELDS = { "address", "city", "region", "name", "lat2", "lng2","lat", "lng", "block", "estateType2", "addrAlias", "alias" };
|
||||
static final int BAI_DU_GEO = 1;// 百度系坐标
|
||||
static final int GAO_DE_GEO = 2;// 高德系坐标
|
||||
|
||||
@@ -194,6 +187,7 @@ public class PropertyController {
|
||||
private DistrictRoomSqmetreRentService districtRoomSqmetreRentService;
|
||||
private RentDealPriceService rentDealPriceService;
|
||||
private EvaluateRatioService evaluateRatioService;
|
||||
private AliasFangService aliasFangService;
|
||||
|
||||
private static final int EVALUATE_SHOW_DETAIL = 1;
|
||||
private static final Map<String, String> PROPERTY_TYPES = new HashMap<String, String>() {
|
||||
@@ -607,6 +601,25 @@ public class PropertyController {
|
||||
dto.setBlock(district.getBlock());
|
||||
}
|
||||
dto.setPropertyType(district.getEstateType2());
|
||||
if (CollectionUtils.isNotEmpty(district.getAlias())) {
|
||||
// 将最相近的别名输出给用户
|
||||
String alias = null;
|
||||
double similarity = 0;
|
||||
if (StringUtils.isNotBlank(model.getKeyword())) {
|
||||
for (String mappingAlias : district.getAlias()) {
|
||||
double curr = AddressParserUtil.getSimilarityRatio(mappingAlias, model.getKeyword());
|
||||
if (curr > similarity ) {
|
||||
similarity = curr;
|
||||
alias = mappingAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(alias)) {
|
||||
dto.setAlias(alias);
|
||||
} else {
|
||||
dto.setAlias(district.getAlias().get(0));
|
||||
}
|
||||
}
|
||||
list.add(dto);
|
||||
}
|
||||
|
||||
@@ -878,8 +891,13 @@ public class PropertyController {
|
||||
districtInfoDto.setAddressAlias(district.getAddrAlias());
|
||||
if (district.getLat2() != null && district.getLat2() != 0 && district.getLng2() != null
|
||||
&& district.getLng2() != 0) {
|
||||
districtInfoDto.setLat(district.getLat2() / 10000000000D);
|
||||
districtInfoDto.setLng(district.getLng2() / 10000000000D);
|
||||
districtInfoDto.setLat2(district.getLat2() / 10000000000D);
|
||||
districtInfoDto.setLng2(district.getLng2() / 10000000000D);
|
||||
}
|
||||
if (district.getLat() != null && district.getLat() != 0 && district.getLng() != null
|
||||
&& district.getLng() != 0) {
|
||||
districtInfoDto.setLat(district.getLat() / 10000000000D);
|
||||
districtInfoDto.setLng(district.getLng() / 10000000000D);
|
||||
}
|
||||
districtInfoDto.setPropertyType(district.getEstateType2());
|
||||
if (HouseValidator.validateBuildingType(district.getBuildType())) {
|
||||
@@ -1085,6 +1103,21 @@ public class PropertyController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
if(model.getFloor() == null){
|
||||
JSONObject structureOb = addressMatchProxyService.addressStructure(district.getCity(), model.getAddress());
|
||||
if(structureOb != null){
|
||||
if(structureOb.containsKey("buildingNumber")){
|
||||
model.setBuildingNumber(structureOb.getString("buildingNumber"));
|
||||
}
|
||||
|
||||
if(structureOb.containsKey("roomNumber")){
|
||||
String roomNumber = structureOb.getString("roomNumber");
|
||||
model.setFloor(getFloor(roomNumber));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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()){
|
||||
@@ -1108,6 +1141,8 @@ public class PropertyController {
|
||||
} else {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||
}
|
||||
|
||||
|
||||
Evaluation evaluation = evaluationService.evaluate(district, buildEvaluation(model, request),
|
||||
model.getCalDate());
|
||||
Double cityPriceCredit = null;
|
||||
@@ -1549,6 +1584,9 @@ public class PropertyController {
|
||||
model.setDistrict(fangjiaOfficialAreaMap.getFangjiaDistrict());
|
||||
}
|
||||
}
|
||||
|
||||
boolean villaFlag = DataUtil.isVilla(model.getSize(), model.getName(), model.getHeight(), model.getRoom());
|
||||
|
||||
District district = null;
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("city", model.getCity());
|
||||
@@ -1566,7 +1604,14 @@ public class PropertyController {
|
||||
if(json.getInt("code")==200){
|
||||
Map<String, Object> map = (Map<String, Object>) json.get("result");
|
||||
if((Integer)map.get("precise")>=0){
|
||||
district = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name"), "district");
|
||||
String propertyType = (String) map.get("propertyType");
|
||||
if(villaFlag && StringUtils.isNotBlank(propertyType) && !propertyType.equals("别墅")){
|
||||
district = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name")+"别墅", "district");
|
||||
}
|
||||
if(null == district){
|
||||
district = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name"), "district");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2482,7 +2527,7 @@ public class PropertyController {
|
||||
model.setMax(100);
|
||||
}
|
||||
|
||||
List<String> districtNames = new ArrayList<String>();
|
||||
Set<String> districtNames = new HashSet<String>();
|
||||
if (null == district) {
|
||||
districtNames.add(model.getName());
|
||||
} else {
|
||||
@@ -2490,14 +2535,56 @@ public class PropertyController {
|
||||
if (district.getAlias() != null) {
|
||||
districtNames.addAll(district.getAlias());
|
||||
}
|
||||
}
|
||||
List<DealPrice> dealPrices = null;
|
||||
for (String name : districtNames) {
|
||||
dealPrices = findDealPricesByName(model.getCity(), model.getDistrict(), name, model.getMax() * 5, model);
|
||||
if (!dealPrices.isEmpty()) {
|
||||
break;
|
||||
final String masterDistrictName = district.getMasterDistrictName();
|
||||
if (StringUtils.isNotBlank(masterDistrictName)) {
|
||||
List<District> districts;
|
||||
if ("master".equals(masterDistrictName)) {
|
||||
// 所有的分期数据
|
||||
districts = districtService.findSlaves(model.getCity(), model.getDistrict(), model.getName());
|
||||
} else {
|
||||
// 根据主小区名查询所有名称
|
||||
districts = districtService.findSlaves(model.getCity(), model.getDistrict(), masterDistrictName);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(districts)) {
|
||||
for (District districtTemp : districts) {
|
||||
districtNames.add(districtTemp.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// districtNames 不包含 主小区名,加进去
|
||||
if (!districtNames.contains(masterDistrictName)){
|
||||
districtNames.add(masterDistrictName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 将搜房中的别名与名称加入查询集合
|
||||
try {
|
||||
List<AliasFang> aliasFangs = aliasFangService.findFangByNameAndAlias(model.getCity(), model.getDistrict(), districtNames);
|
||||
Set<String> aliasSet = new HashSet<String>();
|
||||
for (AliasFang aliasFang : aliasFangs) {
|
||||
if (StringUtils.isNotBlank(aliasFang.getName())) {
|
||||
aliasSet.add(aliasFang.getName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(aliasFang.getAlias())) {
|
||||
aliasSet.add(aliasFang.getAlias());
|
||||
}
|
||||
}
|
||||
districtNames.addAll(aliasSet);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
// List<DealPrice> dealPrices = new ArrayList<DealPrice>();
|
||||
// 将主名与映射别名查得成交加入 存在不能查出最新成交问题
|
||||
// for (String name : districtNames) {
|
||||
// List<DealPrice> dealPricesTempList = findDealPricesByName(model.getCity(), model.getDistrict(), name, model.getMax() * 5, model);
|
||||
// if (CollectionUtils.isNotEmpty(dealPricesTempList)) {
|
||||
// dealPrices.addAll(dealPricesTempList);
|
||||
// }
|
||||
// }
|
||||
List<DealPrice> dealPrices = findDealPricesByNames(model.getCity(), model.getDistrict(), new ArrayList<String>(districtNames), model.getMax() * 5, model);
|
||||
if (model.getSize() != null) {
|
||||
Collections.sort(dealPrices, new Comparator<DealPrice>() {
|
||||
@Override
|
||||
@@ -2546,15 +2633,9 @@ public class PropertyController {
|
||||
}
|
||||
deal = new LinkedHashMap<String, Object>();
|
||||
dealPrice.setId(null);
|
||||
if (district != null) {
|
||||
deal.put("city", district.getCity());
|
||||
deal.put("district", district.getRegion());
|
||||
deal.put("name", district.getName());
|
||||
} else {
|
||||
deal.put("city", dealPrice.getCity());
|
||||
deal.put("district", dealPrice.getRegion());
|
||||
deal.put("name", dealPrice.getDistrictName());
|
||||
}
|
||||
deal.put("city", dealPrice.getCity());
|
||||
deal.put("district", dealPrice.getRegion());
|
||||
deal.put("name", dealPrice.getDistrictName());
|
||||
if (dealPrice.getArea() == null) {
|
||||
deal.put("size", "");
|
||||
} else {
|
||||
@@ -2773,7 +2854,7 @@ public class PropertyController {
|
||||
evaluation.setOtherFactor(model.getOtherFactor());
|
||||
}
|
||||
evaluation.setRegion(model.getDistrict());
|
||||
if (0 != model.getRoom()) {
|
||||
if (null != model.getRoom()) {
|
||||
evaluation.setRoom(model.getRoom());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getRoomNumber())) {
|
||||
@@ -3467,6 +3548,33 @@ public class PropertyController {
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<DealPrice> findDealPricesByNames(String city, String region, List<String> names, int max,
|
||||
DealPriceModel model) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("city", city));
|
||||
params.add(new QueryParam("region", region));
|
||||
params.add(new QueryParam("districtName", QueryParam.IN_OPERATOR, names));
|
||||
if (model.getRoom() != null) {
|
||||
params.add(new QueryParam("room", model.getRoom()));
|
||||
}
|
||||
if (model.getHall() != null) {
|
||||
params.add(new QueryParam("hall", model.getHall()));
|
||||
}
|
||||
// 18年之后抓住的数据没有score字段
|
||||
// params.add(new QueryParam("score", QueryParam.GREATER_THAN_OPERATOR, 200000000000l));
|
||||
List<DealPrice> dealPrices = dealPriceService.findDealPrices(params, max);
|
||||
List<DealPrice> distinctDealPrices = new ArrayList<DealPrice>();
|
||||
for (DealPrice dealPrice : dealPrices) {
|
||||
if (dealPrice.getAvgPrice() == null) {
|
||||
dealPrice.setAvgPrice((int) (dealPrice.getTotalPrice() / dealPrice.getArea()));
|
||||
}
|
||||
if (!checkExists(distinctDealPrices, dealPrice)) {
|
||||
distinctDealPrices.add(dealPrice);
|
||||
}
|
||||
}
|
||||
return distinctDealPrices;
|
||||
}
|
||||
|
||||
private List<DealPrice> findDealPricesByName(String city, String region, String name, int max,
|
||||
DealPriceModel model) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
@@ -3479,7 +3587,8 @@ public class PropertyController {
|
||||
if (model.getHall() != null) {
|
||||
params.add(new QueryParam("hall", model.getHall()));
|
||||
}
|
||||
params.add(new QueryParam("score", QueryParam.GREATER_THAN_OPERATOR, 200000000000l));
|
||||
// 18年之后抓住的数据没有score字段
|
||||
// params.add(new QueryParam("score", QueryParam.GREATER_THAN_OPERATOR, 200000000000l));
|
||||
List<DealPrice> dealPrices = dealPriceService.findDealPrices(params, max);
|
||||
List<DealPrice> distinctDealPrices = new ArrayList<DealPrice>();
|
||||
for (DealPrice dealPrice : dealPrices) {
|
||||
@@ -4057,6 +4166,19 @@ public class PropertyController {
|
||||
return "fangjia.com";
|
||||
}
|
||||
|
||||
private Integer getFloor(String roomNumber){
|
||||
if(StringUtils.isNotBlank(roomNumber) && DataUtil.isNumber(roomNumber)){
|
||||
if(roomNumber.length() == 3){
|
||||
return Integer.valueOf(roomNumber.substring(0,1));
|
||||
}else if(roomNumber.length() == 4){
|
||||
return Integer.valueOf(roomNumber.substring(0,2));
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean checkExists(FacetQueryResult<NewHousePojo> houseBoList, NewHousePojo house) {
|
||||
for (NewHousePojo bo : houseBoList) {
|
||||
boolean sameName = bo.getName().equals(house.getName());
|
||||
@@ -5517,7 +5639,7 @@ public class PropertyController {
|
||||
|
||||
//周边相似小区租金
|
||||
Integer room = null;
|
||||
if(model.getRoom()!=0){
|
||||
if(model.getRoom()!=null && model.getRoom()>0){
|
||||
room = model.getRoom();
|
||||
}else{
|
||||
room = houseService.getDistrictRoomType((float)model.getSize());
|
||||
@@ -5911,4 +6033,8 @@ public class PropertyController {
|
||||
public void setCommunityBasePriceService(CommunityBasePriceService communityBasePriceService) {
|
||||
this.communityBasePriceService = communityBasePriceService;
|
||||
}
|
||||
|
||||
public void setAliasFangService(AliasFangService aliasFangService) {
|
||||
this.aliasFangService = aliasFangService;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
//package com.fangjia.open.controllers;
|
||||
//
|
||||
//import com.google.gson.Gson;
|
||||
//import com.google.gson.JsonArray;
|
||||
//import com.google.gson.JsonObject;
|
||||
//import org.apache.http.HttpEntity;
|
||||
//import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
//import org.apache.http.client.methods.HttpPost;
|
||||
//import org.apache.http.entity.ContentType;
|
||||
//import org.apache.http.entity.StringEntity;
|
||||
//import org.apache.http.impl.client.CloseableHttpClient;
|
||||
//import org.apache.http.impl.client.HttpClients;
|
||||
//import org.apache.http.util.EntityUtils;
|
||||
//import sun.misc.BASE64Encoder;
|
||||
//
|
||||
//import java.io.IOException;
|
||||
//import java.net.Authenticator;
|
||||
//import java.net.InetSocketAddress;
|
||||
//import java.net.PasswordAuthentication;
|
||||
//import java.net.Proxy;
|
||||
//import java.nio.charset.Charset;
|
||||
//import java.nio.charset.StandardCharsets;
|
||||
//import java.util.Base64;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.Map;
|
||||
//
|
||||
////public class Test {
|
||||
//// public static void main(String[] args) throws IOException {
|
||||
//// // 目标URL
|
||||
//// String targetURL = "http://146.56.217.44:9010/uams/farmer/all/v3/sign";
|
||||
////
|
||||
//// // 设置代理
|
||||
//// String proxyHost = "tunnel2.qg.net";
|
||||
//// int proxyPort = 14186;
|
||||
////
|
||||
//// // 设置代理用户名和密码
|
||||
//// final String proxyUsername = "113BBC06";
|
||||
//// final String proxyPassword = "3B2FBD05B0AF";
|
||||
////
|
||||
//// // 设置请求的JSON数据
|
||||
//// String address = "江苏省扬州市宝应县安宜镇宝应大道88号";
|
||||
//// String type = "1";
|
||||
//// String jsonData = "{\"address\":\"" + address + "\",\"type\":\"" + type + "\"}";
|
||||
////
|
||||
//// // 设置HTTP基本认证
|
||||
//// String authKey = proxyUsername;
|
||||
//// String password = proxyPassword;
|
||||
//// String auth = authKey + ":" + password;
|
||||
//// String authHeader = "Basic " + new BASE64Encoder().encode(auth.getBytes(Charset.forName("UTF-8")));
|
||||
////
|
||||
//// // 创建HTTP客户端
|
||||
//// CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
//// HttpPost httpPost = new HttpPost(targetURL);
|
||||
////
|
||||
//// // 设置代理
|
||||
//// Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
|
||||
////
|
||||
//// // 设置代理认证
|
||||
//// Authenticator.setDefault(new Authenticator() {
|
||||
//// protected PasswordAuthentication getPasswordAuthentication() {
|
||||
//// return new PasswordAuthentication(proxyUsername, proxyPassword.toCharArray());
|
||||
//// }
|
||||
//// });
|
||||
////
|
||||
//// // 设置请求头
|
||||
//// httpPost.setHeader("Content-Type", "application/json");
|
||||
//// httpPost.setHeader("Accept", "*/*");
|
||||
//// httpPost.setHeader("Host", "146.56.217.44:9010");
|
||||
//// httpPost.setHeader("Proxy-Authorization", authHeader);
|
||||
////
|
||||
//// // 设置请求体
|
||||
//// StringEntity stringEntity = new StringEntity(jsonData, ContentType.APPLICATION_JSON);
|
||||
//// httpPost.setEntity(stringEntity);
|
||||
////
|
||||
//// // 发送POST请求
|
||||
//// CloseableHttpResponse httpResponse = httpClient.execute(httpPost);
|
||||
////
|
||||
//// // 获取响应
|
||||
//// HttpEntity responseEntity = httpResponse.getEntity();
|
||||
//// String responseString = EntityUtils.toString(responseEntity);
|
||||
//// System.out.println(responseString);
|
||||
////
|
||||
//// // 关闭连接
|
||||
//// httpResponse.close();
|
||||
//// httpClient.close();
|
||||
//// }
|
||||
////}
|
||||
//
|
||||
//public class Test {
|
||||
// public static void main(String[] args) throws IOException {
|
||||
// Map<String, String> map = senRequest("江苏省泰州市靖江市通江路37号", "1");
|
||||
// System.out.println(map);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private static Map<String, String> senRequest(String address, String type) throws IOException {
|
||||
// String targetURL = "http://146.56.217.44:9010/uams/farmer/all/v3/sign";
|
||||
// String proxyHost = "tunnel2.qg.net";
|
||||
// int proxyPort = 14186;
|
||||
// final String proxyUsername = "113BBC06";
|
||||
// final String proxyPassword = "3B2FBD05B0AF";
|
||||
// String jsonData = "{\"address\":\"" + address + "\",\"type\":\"" + type + "\"}";
|
||||
// String authKey = proxyUsername;
|
||||
// String password = proxyPassword;
|
||||
// String auth = authKey + ":" + password;
|
||||
// String authHeader = "Basic " + new BASE64Encoder().encode(auth.getBytes(Charset.forName("UTF-8")));
|
||||
//
|
||||
// CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
// HttpPost httpPost = new HttpPost(targetURL);
|
||||
// Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
|
||||
// Authenticator.setDefault(new Authenticator() {
|
||||
// protected PasswordAuthentication getPasswordAuthentication() {
|
||||
// return new PasswordAuthentication(proxyUsername, proxyPassword.toCharArray());
|
||||
// }
|
||||
// });
|
||||
// httpPost.setHeader("Content-Type", "application/json");
|
||||
// httpPost.setHeader("Accept", "*/*");
|
||||
// httpPost.setHeader("Host", "146.56.217.44:9010");
|
||||
// httpPost.setHeader("Proxy-Authorization", authHeader);
|
||||
// StringEntity stringEntity = new StringEntity(jsonData, ContentType.APPLICATION_JSON);
|
||||
// httpPost.setEntity(stringEntity);
|
||||
//
|
||||
// CloseableHttpResponse httpResponse = null;
|
||||
// int retryCount = 2; // 设置重试次数
|
||||
// int retryDelay = 10; // 设置重试延迟时间(毫秒)
|
||||
// boolean success = false;
|
||||
// for (int i = 0; i < retryCount; i++) {
|
||||
// try {
|
||||
// httpResponse = httpClient.execute(httpPost);
|
||||
// success = true;
|
||||
// break;
|
||||
// } catch (IOException e) {
|
||||
// System.err.println("代理请求失败,进行重试...");
|
||||
// try {
|
||||
// Thread.sleep(retryDelay);
|
||||
// } catch (InterruptedException ex) {
|
||||
// Thread.currentThread().interrupt();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (success) {
|
||||
// HttpEntity responseEntity = httpResponse.getEntity();
|
||||
// String responseString = EntityUtils.toString(responseEntity);
|
||||
//
|
||||
// // 使用 Gson 解析 JSON 字符串
|
||||
// Gson gson = new Gson();
|
||||
// JsonObject jsonObject = gson.fromJson(responseString, JsonObject.class);
|
||||
//
|
||||
//
|
||||
// // 创建 Map 存储各个值
|
||||
// Map<String, String> dataMap = new HashMap<String, String>();
|
||||
//
|
||||
// // 获取各个值并放入 Map
|
||||
// dataMap.put("code", jsonObject.get("code").getAsString());
|
||||
// dataMap.put("msg", jsonObject.get("msg").getAsString());
|
||||
// JsonObject data = jsonObject.getAsJsonObject("data");
|
||||
// dataMap.put("version", data.get("version").getAsString());
|
||||
// dataMap.put("province", data.get("province").getAsString());
|
||||
// dataMap.put("city", data.get("city").getAsString());
|
||||
// dataMap.put("district", data.get("district").getAsString());
|
||||
// dataMap.put("town", data.get("town").getAsString());
|
||||
// dataMap.put("village", data.get("village").getAsString());
|
||||
// dataMap.put("provinceCode", data.get("provinceCode").getAsString());
|
||||
// dataMap.put("cityCode", data.get("cityCode").getAsString());
|
||||
// dataMap.put("districtCode", data.get("districtCode").getAsString());
|
||||
// dataMap.put("townCode", data.get("townCode").getAsString());
|
||||
// dataMap.put("villageCode", data.get("villageCode").getAsString());
|
||||
// dataMap.put("areaCode", data.get("areaCode").getAsString());
|
||||
// dataMap.put("farmer", data.get("farmer").getAsString());
|
||||
// dataMap.put("isGovt", data.get("isGovt").getAsString());
|
||||
// dataMap.put("govtAddr", data.get("govtAddr").isJsonNull() ? null : data.get("govtAddr").getAsString()); // 对于可能为 null 的值,需要判断是否为空
|
||||
// JsonArray indusParkList = data.get("indusParkList").isJsonNull() ? null : data.get("indusParkList").getAsJsonArray();
|
||||
// if (indusParkList != null) {
|
||||
// JsonObject jsonObject1 = gson.fromJson(indusParkList.get(0), JsonObject.class);
|
||||
// dataMap.put("devName",jsonObject1.get("indusParkName").getAsString());
|
||||
// dataMap.put("devLevel",jsonObject1.get("indusParkLevel").getAsString());
|
||||
// }
|
||||
//
|
||||
// httpResponse.close();
|
||||
// return dataMap;
|
||||
// } else {
|
||||
// System.err.println("重试次数已用完,请求失败。");
|
||||
// }
|
||||
//
|
||||
// httpClient.close();
|
||||
// return null;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
+1608
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -542,7 +542,7 @@ public class UserController {
|
||||
String code = usersInfoService.randomCode();
|
||||
System.out.println(code);
|
||||
try {
|
||||
smsService.send(model.getMobile(), "【房价网】你的验证码是" + code + ",请立即验证。");
|
||||
smsService.send(model.getMobile(), "【百盛评估】你的验证码是" + code + ",请立即验证。");
|
||||
resultModel.setResult(Message.RESULT_SUCCESS);
|
||||
CookieUtils.setCookie(mobile + "_" + type, code, "/", 60 * 60 * 24 *7, resp);
|
||||
CacheUtils.putValue(CachePolicyEnum.TINY, FjtUsers.class, mobile, new Date().getTime());
|
||||
|
||||
+13
-8
@@ -1282,15 +1282,20 @@ public class WeiXinEvaluationController {
|
||||
Point point = new Point(Double.valueOf(ll[0]), Double.valueOf(ll[1]));
|
||||
points.add(point);
|
||||
}
|
||||
Point point = new Point(district.getLng2()/10000000000.0, district.getLat2()/10000000000.0);
|
||||
//boolean flag = InsidePolygon.aboutZone(point, points);
|
||||
//boolean flag = InsidePolygon.isPtInPoly(point.getLon(), point.getLat(), points);
|
||||
boolean flag = InsidePolygon2.checkIsInPolygon(point, points);
|
||||
if(flag){
|
||||
pbObj = pb;
|
||||
System.out.println(district.getRegion()+" "+district.getName()+" "+pb.getName());
|
||||
break;
|
||||
Point point = null;
|
||||
if(district.getLng2()!=null){
|
||||
point = new Point(district.getLng2()/10000000000.0, district.getLat2()/10000000000.0);
|
||||
|
||||
//boolean flag = InsidePolygon.aboutZone(point, points);
|
||||
//boolean flag = InsidePolygon.isPtInPoly(point.getLon(), point.getLat(), points);
|
||||
boolean flag = InsidePolygon2.checkIsInPolygon(point, points);
|
||||
if(flag){
|
||||
pbObj = pb;
|
||||
System.out.println(district.getRegion()+" "+district.getName()+" "+pb.getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Integer yearAge = getBuildYear(district.getFinishBuildingDate());
|
||||
if(pbObj!=null){
|
||||
|
||||
@@ -7,7 +7,8 @@ import com.fangjia.dal.mongo.model.CityNewPrice;
|
||||
import com.fangjia.dal.mongo.model.RegionSellStat;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class CityNewPriceDto implements Serializable{
|
||||
public class
|
||||
CityNewPriceDto implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -26,8 +26,14 @@ public class DistrictInfoDto {
|
||||
private List<String> alias;
|
||||
private List<String> addressAlias;
|
||||
private String videoUrl;
|
||||
//高德坐标
|
||||
//维度
|
||||
private Double lat;
|
||||
//经度
|
||||
private Double lng;
|
||||
// 百度坐标
|
||||
private Double lat2;
|
||||
private Double lng2;
|
||||
private String developer;
|
||||
private String buildType;
|
||||
private String estateCompany;
|
||||
@@ -102,7 +108,22 @@ public class DistrictInfoDto {
|
||||
private String township;
|
||||
private String landProperty;
|
||||
|
||||
|
||||
public Double getLat2() {
|
||||
return lat2;
|
||||
}
|
||||
|
||||
public void setLat2(Double lat2) {
|
||||
this.lat2 = lat2;
|
||||
}
|
||||
|
||||
public Double getLng2() {
|
||||
return lng2;
|
||||
}
|
||||
|
||||
public void setLng2(Double lng2) {
|
||||
this.lng2 = lng2;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.fangjia.open.dto;
|
||||
|
||||
import com.fangjia.dal.mongo.model.DistrictFacilitys;
|
||||
import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 13607
|
||||
* @since 2023/12/12 10:47
|
||||
*/
|
||||
public class HouseValueInformationDto {
|
||||
// 原小区均价返回值
|
||||
private MatchedBuildingDto communityAvgPrice;
|
||||
// 原房屋价值评估返回值
|
||||
private Map<String, Object> addressValue;
|
||||
|
||||
//原房源样本返回值
|
||||
private UniversalDto houseCase;
|
||||
|
||||
//原周边POI返回值
|
||||
private DistrictFacilitys surroundingPoi;
|
||||
|
||||
public MatchedBuildingDto getCommunityAvgPrice() {
|
||||
return communityAvgPrice;
|
||||
}
|
||||
|
||||
public void setCommunityAvgPrice(MatchedBuildingDto communityAvgPrice) {
|
||||
this.communityAvgPrice = communityAvgPrice;
|
||||
}
|
||||
|
||||
public Map<String, Object> getAddressValue() {
|
||||
return addressValue;
|
||||
}
|
||||
|
||||
public void setAddressValue(Map<String, Object> addressValue) {
|
||||
this.addressValue = addressValue;
|
||||
}
|
||||
|
||||
public UniversalDto getHouseCase() {
|
||||
return houseCase;
|
||||
}
|
||||
|
||||
public void setHouseCase(UniversalDto houseCase) {
|
||||
this.houseCase = houseCase;
|
||||
}
|
||||
|
||||
public DistrictFacilitys getSurroundingPoi() {
|
||||
return surroundingPoi;
|
||||
}
|
||||
|
||||
public void setSurroundingPoi(DistrictFacilitys surroundingPoi) {
|
||||
this.surroundingPoi = surroundingPoi;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ public class PropertyDto {
|
||||
private String propertyType;
|
||||
private String block;
|
||||
private String distance;
|
||||
/**
|
||||
* 新增小区别名
|
||||
*/
|
||||
private String alias;
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -88,4 +92,12 @@ public class PropertyDto {
|
||||
public void setDistance(String distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
}
|
||||
|
||||
public void setAlias(String alias) {
|
||||
this.alias = alias;
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -46,6 +46,11 @@ public class MatchedBuildingDto {
|
||||
*/
|
||||
private String propertyType;
|
||||
|
||||
/**
|
||||
* ¾ù¼Û
|
||||
*/
|
||||
private Integer avgPrice;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -125,4 +130,12 @@ public class MatchedBuildingDto {
|
||||
public void setPropertyType(String propertyType) {
|
||||
this.propertyType = propertyType;
|
||||
}
|
||||
|
||||
public Integer getAvgPrice() {
|
||||
return avgPrice;
|
||||
}
|
||||
|
||||
public void setAvgPrice(Integer avgPrice) {
|
||||
this.avgPrice = avgPrice;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.hibernate.validator.constraints.NotBlank;
|
||||
public class AddesssMatchModel extends FangjiaApiModel {
|
||||
|
||||
private String city;
|
||||
private String refCity;
|
||||
@NotBlank
|
||||
private String address;
|
||||
private String suggestDistrict;
|
||||
@@ -24,6 +25,14 @@ public class AddesssMatchModel extends FangjiaApiModel {
|
||||
|
||||
private String showCode;
|
||||
|
||||
public String getRefCity() {
|
||||
return refCity;
|
||||
}
|
||||
|
||||
public void setRefCity(String refCity) {
|
||||
this.refCity = refCity;
|
||||
}
|
||||
|
||||
public String getAddress_1() {
|
||||
return address_1;
|
||||
}
|
||||
|
||||
@@ -33,13 +33,27 @@ public class AddressModel extends FangjiaApiModel {
|
||||
private Integer radius;
|
||||
// 查询数量
|
||||
private Integer number;
|
||||
private Integer offset;
|
||||
// 查询页码
|
||||
private Integer pageNo;
|
||||
private Integer page;
|
||||
// 是否用于检查
|
||||
private String dataLevel;
|
||||
|
||||
private String keyword;
|
||||
private String keywords;
|
||||
//是否使用地图poi数据
|
||||
private boolean useMap;
|
||||
|
||||
//涉农到区之后,是否显式后面的字段值
|
||||
private String showFullValue;
|
||||
//是否显示涉农测试用字段值
|
||||
private String showTestValue;
|
||||
|
||||
private String lat;
|
||||
private String lng;
|
||||
|
||||
private String location;
|
||||
private String types;
|
||||
public boolean isContainsLocation() {
|
||||
return containsLocation;
|
||||
}
|
||||
@@ -233,12 +247,12 @@ public class AddressModel extends FangjiaApiModel {
|
||||
this.dataLevel = dataLevel;
|
||||
}
|
||||
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
public String getKeywords() {
|
||||
return keywords;
|
||||
}
|
||||
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
public void setKeywords(String keywords) {
|
||||
this.keywords = keywords;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
@@ -248,4 +262,76 @@ public class AddressModel extends FangjiaApiModel {
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public boolean isUseMap() {
|
||||
return useMap;
|
||||
}
|
||||
|
||||
public void setUseMap(boolean useMap) {
|
||||
this.useMap = useMap;
|
||||
}
|
||||
|
||||
public String getShowFullValue() {
|
||||
return showFullValue;
|
||||
}
|
||||
|
||||
public void setShowFullValue(String showFullValue) {
|
||||
this.showFullValue = showFullValue;
|
||||
}
|
||||
|
||||
public String getShowTestValue() {
|
||||
return showTestValue;
|
||||
}
|
||||
|
||||
public void setShowTestValue(String showTestValue) {
|
||||
this.showTestValue = showTestValue;
|
||||
}
|
||||
|
||||
public String getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(String lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public String getLng() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
public void setLng(String lng) {
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getTypes() {
|
||||
return types;
|
||||
}
|
||||
|
||||
public void setTypes(String types) {
|
||||
this.types = types;
|
||||
}
|
||||
|
||||
public Integer getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public void setOffset(Integer offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
public Integer getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,941 @@
|
||||
package com.fangjia.open.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 13607
|
||||
* @since 2023/12/12 14:27
|
||||
*/
|
||||
public class HouseInfomationModel extends FangjiaApiModel {
|
||||
private String city;
|
||||
private String address;
|
||||
private String category;
|
||||
private boolean useMap;
|
||||
|
||||
/**
|
||||
* 判断是不是有房估价
|
||||
*/
|
||||
private boolean isYouFang;
|
||||
|
||||
/**
|
||||
* 判断是不是友达
|
||||
*/
|
||||
private boolean isYouDa;
|
||||
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
private String region;
|
||||
|
||||
/**
|
||||
* 区域(新版本估价)
|
||||
**/
|
||||
private String district;
|
||||
|
||||
/**
|
||||
* 小区名
|
||||
*/
|
||||
private String districtName;
|
||||
/**
|
||||
* 小区名(新版本)
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 楼号
|
||||
*/
|
||||
private String unitNumber;
|
||||
/**
|
||||
* 新楼号
|
||||
*/
|
||||
private String houseNumber;
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* 室号
|
||||
*/
|
||||
private String roomNumber;
|
||||
|
||||
/**
|
||||
* 面积
|
||||
*/
|
||||
private double size;
|
||||
|
||||
/**
|
||||
* 所在楼层
|
||||
*/
|
||||
private Integer floor;
|
||||
|
||||
/**
|
||||
* 总楼层
|
||||
*/
|
||||
private Integer height;
|
||||
|
||||
/**
|
||||
* 室数
|
||||
*/
|
||||
private Integer room;
|
||||
|
||||
/**
|
||||
* 厅数
|
||||
*/
|
||||
private int hall;
|
||||
|
||||
/**
|
||||
* 卫数
|
||||
*/
|
||||
private int toilet;
|
||||
|
||||
/**
|
||||
* 估价时间
|
||||
*/
|
||||
private Date calDate;
|
||||
|
||||
private String propertyType;
|
||||
|
||||
|
||||
/**
|
||||
* 建筑类型
|
||||
*/
|
||||
private String buildType;
|
||||
|
||||
/**
|
||||
* 朝向
|
||||
*/
|
||||
private String direction;
|
||||
|
||||
/**
|
||||
* 装修情况
|
||||
*/
|
||||
private String fitment;
|
||||
|
||||
/**
|
||||
* 装修价格
|
||||
*/
|
||||
private int fitmentCharge;
|
||||
|
||||
/**
|
||||
* 景观情况
|
||||
*/
|
||||
private String view;
|
||||
|
||||
/**
|
||||
* 噪音情况
|
||||
*/
|
||||
private String noise;
|
||||
|
||||
/**
|
||||
* 花园面积
|
||||
*/
|
||||
private Double gardenArea;
|
||||
|
||||
/**
|
||||
* 地下室面积
|
||||
*/
|
||||
private Double basementArea;
|
||||
|
||||
/**
|
||||
* 厌恶因素
|
||||
*/
|
||||
private String[] worryFactor;
|
||||
|
||||
/**
|
||||
* 房龄
|
||||
*/
|
||||
private int age;
|
||||
|
||||
/**
|
||||
* 自有车位
|
||||
*/
|
||||
private String carport;
|
||||
|
||||
/**
|
||||
* 小区配套
|
||||
*/
|
||||
private String facilities;
|
||||
|
||||
/**
|
||||
* 小区位置
|
||||
*/
|
||||
private String insidepos;
|
||||
|
||||
/**
|
||||
* 装修年限
|
||||
*/
|
||||
private int fitmentAge;
|
||||
|
||||
/**
|
||||
* 采光通风
|
||||
*/
|
||||
private String lightingVentilation;
|
||||
|
||||
/**
|
||||
* 边套装置
|
||||
*/
|
||||
private String sideset;
|
||||
|
||||
/**
|
||||
* 建筑质量
|
||||
*/
|
||||
private String[] buildQuality;
|
||||
|
||||
/**
|
||||
* 厌恶设施
|
||||
*/
|
||||
private String worryFacility;
|
||||
|
||||
/**
|
||||
* 产权属性
|
||||
*/
|
||||
private String houseProperty;
|
||||
|
||||
/**
|
||||
* 其他因素
|
||||
*/
|
||||
private String otherFactor;
|
||||
|
||||
/**
|
||||
* 门面开间
|
||||
*/
|
||||
private String facade;
|
||||
|
||||
/**
|
||||
* 公共交通
|
||||
*/
|
||||
private String traffice;
|
||||
|
||||
/**
|
||||
* 形状
|
||||
*/
|
||||
private String shape;
|
||||
|
||||
/**
|
||||
* 障碍物
|
||||
*/
|
||||
private String obstacle;
|
||||
|
||||
/**
|
||||
* 经营性质
|
||||
*/
|
||||
private String industry;
|
||||
|
||||
/**
|
||||
* 配套设备
|
||||
*/
|
||||
private String supportDevice;
|
||||
|
||||
/**
|
||||
* 距离扶梯位置
|
||||
*/
|
||||
private String leftPosition;
|
||||
|
||||
/**
|
||||
* 商铺类型
|
||||
*/
|
||||
private String shopType;
|
||||
|
||||
/**
|
||||
* 商铺唯一性
|
||||
*/
|
||||
private String shopUnique;
|
||||
|
||||
/**
|
||||
* 商铺位置
|
||||
*/
|
||||
private String location;
|
||||
|
||||
private String kind;
|
||||
|
||||
private boolean isNewDistrict;
|
||||
|
||||
private Integer carportPrice;
|
||||
|
||||
private String keyword;
|
||||
|
||||
private String buildingNumber;
|
||||
|
||||
private Integer maxFloor;
|
||||
|
||||
private String decoration;
|
||||
|
||||
private Integer decorationCost;
|
||||
|
||||
private Double gardenSize;
|
||||
private Double basementSize;
|
||||
private Double outerSize;
|
||||
private Double atticSize;
|
||||
private String negativeFactor;
|
||||
private String insidePosition;
|
||||
private int decorationAge;
|
||||
|
||||
private boolean convert;
|
||||
|
||||
private String estateType;
|
||||
private String periodType;
|
||||
private Integer periodCount;
|
||||
|
||||
|
||||
private Integer houseType;
|
||||
private String clientNo;
|
||||
private int scope;
|
||||
|
||||
private Integer maxPrice;
|
||||
private Integer minPrice;
|
||||
|
||||
private Integer radius;
|
||||
private Integer limit;
|
||||
private String app;
|
||||
|
||||
private String user;
|
||||
|
||||
private Integer avgPrice;
|
||||
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public boolean isUseMap() {
|
||||
return useMap;
|
||||
}
|
||||
|
||||
public void setUseMap(boolean useMap) {
|
||||
this.useMap = useMap;
|
||||
}
|
||||
|
||||
public boolean isYouFang() {
|
||||
return isYouFang;
|
||||
}
|
||||
|
||||
public void setYouFang(boolean youFang) {
|
||||
isYouFang = youFang;
|
||||
}
|
||||
|
||||
public boolean isYouDa() {
|
||||
return isYouDa;
|
||||
}
|
||||
|
||||
public void setYouDa(boolean youDa) {
|
||||
isYouDa = youDa;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getDistrictName() {
|
||||
return districtName;
|
||||
}
|
||||
|
||||
public void setDistrictName(String districtName) {
|
||||
this.districtName = districtName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnitNumber() {
|
||||
return unitNumber;
|
||||
}
|
||||
|
||||
public void setUnitNumber(String unitNumber) {
|
||||
this.unitNumber = unitNumber;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public String getRoomNumber() {
|
||||
return roomNumber;
|
||||
}
|
||||
|
||||
public void setRoomNumber(String roomNumber) {
|
||||
this.roomNumber = roomNumber;
|
||||
}
|
||||
|
||||
public double getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(double size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public Integer getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
public void setFloor(Integer floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
public Integer getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(Integer height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public Integer getRoom() {
|
||||
return room;
|
||||
}
|
||||
|
||||
public void setRoom(Integer room) {
|
||||
this.room = room;
|
||||
}
|
||||
|
||||
public int getHall() {
|
||||
return hall;
|
||||
}
|
||||
|
||||
public void setHall(int hall) {
|
||||
this.hall = hall;
|
||||
}
|
||||
|
||||
public int getToilet() {
|
||||
return toilet;
|
||||
}
|
||||
|
||||
public void setToilet(int toilet) {
|
||||
this.toilet = toilet;
|
||||
}
|
||||
|
||||
public Date getCalDate() {
|
||||
return calDate;
|
||||
}
|
||||
|
||||
public void setCalDate(Date calDate) {
|
||||
this.calDate = calDate;
|
||||
}
|
||||
|
||||
public String getPropertyType() {
|
||||
return propertyType;
|
||||
}
|
||||
|
||||
public void setPropertyType(String propertyType) {
|
||||
this.propertyType = propertyType;
|
||||
}
|
||||
|
||||
public String getBuildType() {
|
||||
return buildType;
|
||||
}
|
||||
|
||||
public void setBuildType(String buildType) {
|
||||
this.buildType = buildType;
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public String getFitment() {
|
||||
return fitment;
|
||||
}
|
||||
|
||||
public void setFitment(String fitment) {
|
||||
this.fitment = fitment;
|
||||
}
|
||||
|
||||
public int getFitmentCharge() {
|
||||
return fitmentCharge;
|
||||
}
|
||||
|
||||
public void setFitmentCharge(int fitmentCharge) {
|
||||
this.fitmentCharge = fitmentCharge;
|
||||
}
|
||||
|
||||
public String getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
public void setView(String view) {
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
public String getNoise() {
|
||||
return noise;
|
||||
}
|
||||
|
||||
public void setNoise(String noise) {
|
||||
this.noise = noise;
|
||||
}
|
||||
|
||||
public Double getGardenArea() {
|
||||
return gardenArea;
|
||||
}
|
||||
|
||||
public void setGardenArea(Double gardenArea) {
|
||||
this.gardenArea = gardenArea;
|
||||
}
|
||||
|
||||
public Double getBasementArea() {
|
||||
return basementArea;
|
||||
}
|
||||
|
||||
public void setBasementArea(Double basementArea) {
|
||||
this.basementArea = basementArea;
|
||||
}
|
||||
|
||||
public String[] getWorryFactor() {
|
||||
return worryFactor;
|
||||
}
|
||||
|
||||
public void setWorryFactor(String[] worryFactor) {
|
||||
this.worryFactor = worryFactor;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public String getCarport() {
|
||||
return carport;
|
||||
}
|
||||
|
||||
public void setCarport(String carport) {
|
||||
this.carport = carport;
|
||||
}
|
||||
|
||||
public String getFacilities() {
|
||||
return facilities;
|
||||
}
|
||||
|
||||
public void setFacilities(String facilities) {
|
||||
this.facilities = facilities;
|
||||
}
|
||||
|
||||
public String getInsidepos() {
|
||||
return insidepos;
|
||||
}
|
||||
|
||||
public void setInsidepos(String insidepos) {
|
||||
this.insidepos = insidepos;
|
||||
}
|
||||
|
||||
public int getFitmentAge() {
|
||||
return fitmentAge;
|
||||
}
|
||||
|
||||
public void setFitmentAge(int fitmentAge) {
|
||||
this.fitmentAge = fitmentAge;
|
||||
}
|
||||
|
||||
public String getLightingVentilation() {
|
||||
return lightingVentilation;
|
||||
}
|
||||
|
||||
public void setLightingVentilation(String lightingVentilation) {
|
||||
this.lightingVentilation = lightingVentilation;
|
||||
}
|
||||
|
||||
public String getSideset() {
|
||||
return sideset;
|
||||
}
|
||||
|
||||
public void setSideset(String sideset) {
|
||||
this.sideset = sideset;
|
||||
}
|
||||
|
||||
public String[] getBuildQuality() {
|
||||
return buildQuality;
|
||||
}
|
||||
|
||||
public void setBuildQuality(String[] buildQuality) {
|
||||
this.buildQuality = buildQuality;
|
||||
}
|
||||
|
||||
public String getWorryFacility() {
|
||||
return worryFacility;
|
||||
}
|
||||
|
||||
public void setWorryFacility(String worryFacility) {
|
||||
this.worryFacility = worryFacility;
|
||||
}
|
||||
|
||||
public String getHouseProperty() {
|
||||
return houseProperty;
|
||||
}
|
||||
|
||||
public void setHouseProperty(String houseProperty) {
|
||||
this.houseProperty = houseProperty;
|
||||
}
|
||||
|
||||
public String getOtherFactor() {
|
||||
return otherFactor;
|
||||
}
|
||||
|
||||
public void setOtherFactor(String otherFactor) {
|
||||
this.otherFactor = otherFactor;
|
||||
}
|
||||
|
||||
public String getFacade() {
|
||||
return facade;
|
||||
}
|
||||
|
||||
public void setFacade(String facade) {
|
||||
this.facade = facade;
|
||||
}
|
||||
|
||||
public String getTraffice() {
|
||||
return traffice;
|
||||
}
|
||||
|
||||
public void setTraffice(String traffice) {
|
||||
this.traffice = traffice;
|
||||
}
|
||||
|
||||
public String getShape() {
|
||||
return shape;
|
||||
}
|
||||
|
||||
public void setShape(String shape) {
|
||||
this.shape = shape;
|
||||
}
|
||||
|
||||
public String getObstacle() {
|
||||
return obstacle;
|
||||
}
|
||||
|
||||
public void setObstacle(String obstacle) {
|
||||
this.obstacle = obstacle;
|
||||
}
|
||||
|
||||
public String getIndustry() {
|
||||
return industry;
|
||||
}
|
||||
|
||||
public void setIndustry(String industry) {
|
||||
this.industry = industry;
|
||||
}
|
||||
|
||||
public String getSupportDevice() {
|
||||
return supportDevice;
|
||||
}
|
||||
|
||||
public void setSupportDevice(String supportDevice) {
|
||||
this.supportDevice = supportDevice;
|
||||
}
|
||||
|
||||
public String getLeftPosition() {
|
||||
return leftPosition;
|
||||
}
|
||||
|
||||
public void setLeftPosition(String leftPosition) {
|
||||
this.leftPosition = leftPosition;
|
||||
}
|
||||
|
||||
public String getShopType() {
|
||||
return shopType;
|
||||
}
|
||||
|
||||
public void setShopType(String shopType) {
|
||||
this.shopType = shopType;
|
||||
}
|
||||
|
||||
public String getShopUnique() {
|
||||
return shopUnique;
|
||||
}
|
||||
|
||||
public void setShopUnique(String shopUnique) {
|
||||
this.shopUnique = shopUnique;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getKind() {
|
||||
return kind;
|
||||
}
|
||||
|
||||
public void setKind(String kind) {
|
||||
this.kind = kind;
|
||||
}
|
||||
|
||||
public boolean isNewDistrict() {
|
||||
return isNewDistrict;
|
||||
}
|
||||
|
||||
public void setNewDistrict(boolean newDistrict) {
|
||||
isNewDistrict = newDistrict;
|
||||
}
|
||||
|
||||
public Integer getCarportPrice() {
|
||||
return carportPrice;
|
||||
}
|
||||
|
||||
public void setCarportPrice(Integer carportPrice) {
|
||||
this.carportPrice = carportPrice;
|
||||
}
|
||||
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public String getBuildingNumber() {
|
||||
return buildingNumber;
|
||||
}
|
||||
|
||||
public void setBuildingNumber(String buildingNumber) {
|
||||
this.buildingNumber = buildingNumber;
|
||||
}
|
||||
|
||||
public Integer getMaxFloor() {
|
||||
return maxFloor;
|
||||
}
|
||||
|
||||
public void setMaxFloor(Integer maxFloor) {
|
||||
this.maxFloor = maxFloor;
|
||||
}
|
||||
|
||||
public String getDecoration() {
|
||||
return decoration;
|
||||
}
|
||||
|
||||
public void setDecoration(String decoration) {
|
||||
this.decoration = decoration;
|
||||
}
|
||||
|
||||
public Integer getDecorationCost() {
|
||||
return decorationCost;
|
||||
}
|
||||
|
||||
public void setDecorationCost(Integer decorationCost) {
|
||||
this.decorationCost = decorationCost;
|
||||
}
|
||||
|
||||
public Double getGardenSize() {
|
||||
return gardenSize;
|
||||
}
|
||||
|
||||
public void setGardenSize(Double gardenSize) {
|
||||
this.gardenSize = gardenSize;
|
||||
}
|
||||
|
||||
public Double getBasementSize() {
|
||||
return basementSize;
|
||||
}
|
||||
|
||||
public void setBasementSize(Double basementSize) {
|
||||
this.basementSize = basementSize;
|
||||
}
|
||||
|
||||
public Double getOuterSize() {
|
||||
return outerSize;
|
||||
}
|
||||
|
||||
public void setOuterSize(Double outerSize) {
|
||||
this.outerSize = outerSize;
|
||||
}
|
||||
|
||||
public Double getAtticSize() {
|
||||
return atticSize;
|
||||
}
|
||||
|
||||
public void setAtticSize(Double atticSize) {
|
||||
this.atticSize = atticSize;
|
||||
}
|
||||
|
||||
public String getNegativeFactor() {
|
||||
return negativeFactor;
|
||||
}
|
||||
|
||||
public void setNegativeFactor(String negativeFactor) {
|
||||
this.negativeFactor = negativeFactor;
|
||||
}
|
||||
|
||||
public String getInsidePosition() {
|
||||
return insidePosition;
|
||||
}
|
||||
|
||||
public void setInsidePosition(String insidePosition) {
|
||||
this.insidePosition = insidePosition;
|
||||
}
|
||||
|
||||
public int getDecorationAge() {
|
||||
return decorationAge;
|
||||
}
|
||||
|
||||
public void setDecorationAge(int decorationAge) {
|
||||
this.decorationAge = decorationAge;
|
||||
}
|
||||
|
||||
public boolean isConvert() {
|
||||
return convert;
|
||||
}
|
||||
|
||||
public void setConvert(boolean convert) {
|
||||
this.convert = convert;
|
||||
}
|
||||
|
||||
public String getEstateType() {
|
||||
return estateType;
|
||||
}
|
||||
|
||||
public void setEstateType(String estateType) {
|
||||
this.estateType = estateType;
|
||||
}
|
||||
|
||||
public String getPeriodType() {
|
||||
return periodType;
|
||||
}
|
||||
|
||||
public void setPeriodType(String periodType) {
|
||||
this.periodType = periodType;
|
||||
}
|
||||
|
||||
public Integer getPeriodCount() {
|
||||
return periodCount;
|
||||
}
|
||||
|
||||
public void setPeriodCount(Integer periodCount) {
|
||||
this.periodCount = periodCount;
|
||||
}
|
||||
|
||||
public Integer getHouseType() {
|
||||
return houseType;
|
||||
}
|
||||
|
||||
public void setHouseType(Integer houseType) {
|
||||
this.houseType = houseType;
|
||||
}
|
||||
|
||||
public String getClientNo() {
|
||||
return clientNo;
|
||||
}
|
||||
|
||||
public void setClientNo(String clientNo) {
|
||||
this.clientNo = clientNo;
|
||||
}
|
||||
|
||||
public int getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(int scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public Integer getMaxPrice() {
|
||||
return maxPrice;
|
||||
}
|
||||
|
||||
public void setMaxPrice(Integer maxPrice) {
|
||||
this.maxPrice = maxPrice;
|
||||
}
|
||||
|
||||
public Integer getMinPrice() {
|
||||
return minPrice;
|
||||
}
|
||||
|
||||
public void setMinPrice(Integer minPrice) {
|
||||
this.minPrice = minPrice;
|
||||
}
|
||||
|
||||
public Integer getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public void setRadius(Integer radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public Integer getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(Integer limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public Integer getAvgPrice() {
|
||||
return avgPrice;
|
||||
}
|
||||
|
||||
public void setAvgPrice(Integer avgPrice) {
|
||||
this.avgPrice = avgPrice;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -70,12 +70,12 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
|
||||
/**
|
||||
* 总楼层
|
||||
*/
|
||||
private int height;
|
||||
private Integer height;
|
||||
|
||||
/**
|
||||
* 室数
|
||||
*/
|
||||
private int room;
|
||||
private Integer room;
|
||||
|
||||
/**
|
||||
* 厅数
|
||||
@@ -345,19 +345,19 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
public Integer getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
public void setHeight(Integer height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public int getRoom() {
|
||||
public Integer getRoom() {
|
||||
return room;
|
||||
}
|
||||
|
||||
public void setRoom(int room) {
|
||||
public void setRoom(Integer room) {
|
||||
this.room = room;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.fangjia.open;
|
||||
|
||||
public class test {
|
||||
public static void main(String[] args) {
|
||||
String a = "123545";
|
||||
String b ="i980";
|
||||
System.out.println(a.matches("\\d+"));
|
||||
System.out.println(b.matches("\\d+"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
package com.fangjia.open.ws.query;
|
||||
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
public class SampleQuery {
|
||||
|
||||
|
||||
/**城市*/
|
||||
// @NotBlank
|
||||
private String city;
|
||||
|
||||
/**区域*/
|
||||
// @NotBlank
|
||||
private String district;
|
||||
|
||||
// @NotBlank
|
||||
/**小区名*/
|
||||
private String buildingName;
|
||||
/**楼栋名称*/
|
||||
private String buildingNoName;
|
||||
/**物业类型编码*/
|
||||
private String propertyTypeCode;
|
||||
/**是否有电梯 0:无 1:有*/
|
||||
private Integer isElevator;
|
||||
/**总楼层*/
|
||||
private Integer aboveFloorAmount;
|
||||
/**所在楼层*/
|
||||
private Integer floorNumber;
|
||||
/**
|
||||
* 装修情况编码
|
||||
* 1:毛坯
|
||||
* 2:简装(默认)
|
||||
* 3:精装
|
||||
* 4:豪装
|
||||
* */
|
||||
private Integer decrCondCode;
|
||||
/**面积**/
|
||||
private Double strctureArea;
|
||||
/**
|
||||
* 朝向情况编码
|
||||
* 1:西南
|
||||
* 2:东南
|
||||
* 3:南(默认)
|
||||
* 4:西北
|
||||
* 5:东北
|
||||
* 6:东
|
||||
* 7:西
|
||||
* 8:北
|
||||
* 9:东西
|
||||
* 10:南北
|
||||
* */
|
||||
private Integer towardDirectCode;
|
||||
|
||||
private Date updateDate;
|
||||
|
||||
@NotBlank
|
||||
private String address;
|
||||
|
||||
@Min(1)
|
||||
@Max(10)
|
||||
private Integer max;
|
||||
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getBuildingName() {
|
||||
return buildingName;
|
||||
}
|
||||
|
||||
public void setBuildingName(String buildingName) {
|
||||
this.buildingName = buildingName;
|
||||
}
|
||||
|
||||
public String getBuildingNoName() {
|
||||
return buildingNoName;
|
||||
}
|
||||
|
||||
public void setBuildingNoName(String buildingNoName) {
|
||||
this.buildingNoName = buildingNoName;
|
||||
}
|
||||
|
||||
public String getPropertyTypeCode() {
|
||||
return propertyTypeCode;
|
||||
}
|
||||
|
||||
public void setPropertyTypeCode(String propertyTypeCode) {
|
||||
this.propertyTypeCode = propertyTypeCode;
|
||||
}
|
||||
|
||||
public Integer getIsElevator() {
|
||||
return isElevator;
|
||||
}
|
||||
|
||||
public void setIsElevator(Integer isElevator) {
|
||||
this.isElevator = isElevator;
|
||||
}
|
||||
|
||||
public Integer getAboveFloorAmount() {
|
||||
return aboveFloorAmount;
|
||||
}
|
||||
|
||||
public void setAboveFloorAmount(Integer aboveFloorAmount) {
|
||||
this.aboveFloorAmount = aboveFloorAmount;
|
||||
}
|
||||
|
||||
public Integer getFloorNumber() {
|
||||
return floorNumber;
|
||||
}
|
||||
|
||||
public void setFloorNumber(Integer floorNumber) {
|
||||
this.floorNumber = floorNumber;
|
||||
}
|
||||
|
||||
public Double getStrctureArea() {
|
||||
return strctureArea;
|
||||
}
|
||||
|
||||
public void setStrctureArea(Double strctureArea) {
|
||||
this.strctureArea = strctureArea;
|
||||
}
|
||||
|
||||
public Integer getDecrCondCode() {
|
||||
return decrCondCode;
|
||||
}
|
||||
|
||||
public void setDecrCondCode(Integer decrCondCode) {
|
||||
this.decrCondCode = decrCondCode;
|
||||
}
|
||||
|
||||
public Integer getTowardDirectCode() {
|
||||
return towardDirectCode;
|
||||
}
|
||||
|
||||
public void setTowardDirectCode(Integer towardDirectCode) {
|
||||
this.towardDirectCode = towardDirectCode;
|
||||
}
|
||||
|
||||
public Date getUpdateDate() {
|
||||
return updateDate;
|
||||
}
|
||||
|
||||
public void setUpdateDate(Date updateDate) {
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
|
||||
public Integer getMax() {
|
||||
return max;
|
||||
}
|
||||
|
||||
public void setMax(Integer max) {
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.fangjia;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class test {
|
||||
public static void main(String[] args) {
|
||||
while (true){
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
String password = scanner.nextLine();
|
||||
String p =DigestUtils.md5Hex(password);
|
||||
System.out.println(p);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -109,9 +109,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<p><a href="../weiXinEvaluation/form?id=${id}" class="button button-big button-fill evaluation_btn external">房产评估</a></p>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<p>
|
||||
<a href="../weiXinEvaluation/form?id=${id}" class="button button-big button-fill evaluation_btn external">房产评估</a>
|
||||
</p>
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 641 KiB |
@@ -21,12 +21,12 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- 替换百盛图片 -->
|
||||
<div class="page-group">
|
||||
<div class="page page-current">
|
||||
<div class="content login_bg2">
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/9nf1iubwu6.jpg" style="width: 80%;height: 50px;margin: 30px auto;"></div>
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/bh1.png" id="bannersDiv" style="width: 100%;height: 220px;"></div>
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/baisheng_logo.jpg" style="width: 80%;height: 50px;margin: 30px auto;"></div>
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/bs_bananer.jpg" id="bannersDiv" style="width: 100%;height: 220px;"></div>
|
||||
<div class="login_content" style="margin-top: 8%;">
|
||||
<div class="login_input" id="bhFrom">
|
||||
<div class="inputInfo01">
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">产证建筑面积:</div>
|
||||
<div class="item-input">
|
||||
<input type="number" placeholder="请输入建筑面积" id="houseArea" min="0" max="1000"
|
||||
<input type="number" placeholder="请输入建筑面积" id="houseArea" min="0" max="3000"
|
||||
name="fjtEvaluation.houseArea" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user