工具类修改
This commit is contained in:
@@ -69,6 +69,7 @@ public class DataUtil {
|
||||
|
||||
private static final String hanziReg = "[\\u4e00-\\u9fa5]";
|
||||
private static final String englishReg = "[A-Za-z]";
|
||||
public static String[] TAGS =new String[]{"独栋", "联排", "叠加", "双拼", "花园面积", "泳池", "别墅", "带花园", "洋房", "叠拼", "独院", "联体", "微墅", "大平墅"};
|
||||
|
||||
public static String replaceAll(String original, String with, Pattern... pattern) {
|
||||
if (StringUtils.isNotBlank(original)) {
|
||||
@@ -1841,6 +1842,38 @@ public class DataUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是别墅
|
||||
* @return
|
||||
*/
|
||||
public static boolean isVilla(Double area, String name, Integer height, Integer room) {
|
||||
if (area == null) {
|
||||
return false;
|
||||
}
|
||||
if (area >= 150 && StringUtils.indexOfAny(name, TAGS) > -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean ret = false;
|
||||
if (height != null && room != null) {
|
||||
if (height <= 3) {
|
||||
if (area > 200 && room >= 5) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
} else if (height == null && room != null) {
|
||||
if (area > 360 && room >= 6) {
|
||||
ret = true;
|
||||
}
|
||||
} else if (height == null && room == null) {
|
||||
if (area > 500) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-4
@@ -280,10 +280,8 @@ public class AddressMatchProxyServiceImpl extends AbstractHttpApiService impleme
|
||||
params.put("city", city);
|
||||
params.put("address", address);
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure/v2", params, "UTF-8");
|
||||
if (json != null) {
|
||||
int code = json.getInt("status");
|
||||
String msg = json.getString("msg");
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v2/structure", params, "UTF-8");
|
||||
if (json != null && json.containsKey("msgCode") && json.getInt("msgCode") == 200) {
|
||||
if (json.containsKey("result")) {
|
||||
return (JSONObject) json.get("result");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user