评估添加解析楼层
This commit is contained in:
@@ -1463,6 +1463,13 @@ public class DataUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isNumber(String s) {
|
||||
if (s != null && !"".equals(s.trim()))
|
||||
return s.matches("^[0-9]*$");
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public static double roundDouble(double d, int scale) {
|
||||
try {
|
||||
double ret = new BigDecimal(String.valueOf(d)).setScale(scale, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
|
||||
+26
@@ -37,6 +37,8 @@ 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.district.*;
|
||||
import com.fangjia.service.mongo.fangjia.*;
|
||||
import com.fangjia.service.open.*;
|
||||
@@ -1085,6 +1087,15 @@ public class PropertyController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
if(model.getFloor() == null){
|
||||
JSONObject structureOb = addressMatchProxyService.addressStructure(district.getCity(), model.getAddress());
|
||||
if(structureOb != null){
|
||||
model.setBuildingNumber(structureOb.getString("buildingNumber"));
|
||||
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 +1119,8 @@ public class PropertyController {
|
||||
} else {
|
||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||
}
|
||||
|
||||
|
||||
Evaluation evaluation = evaluationService.evaluate(district, buildEvaluation(model, request),
|
||||
model.getCalDate());
|
||||
Double cityPriceCredit = null;
|
||||
@@ -4057,6 +4070,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());
|
||||
|
||||
+4
@@ -84,5 +84,9 @@ public interface AddressMatchProxyService {
|
||||
* @return
|
||||
*/
|
||||
MatchDistrictResult checkMatchDistrictCorrect(CheckMatchDistrictCorrectParam param);
|
||||
|
||||
|
||||
|
||||
JSONObject addressStructure(String city, String address);
|
||||
|
||||
}
|
||||
|
||||
+23
-1
@@ -271,7 +271,29 @@ public class AddressMatchProxyServiceImpl extends AbstractHttpApiService impleme
|
||||
}
|
||||
return matchResult;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject addressStructure(String city, String address) {
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", city);
|
||||
params.put("address", address);
|
||||
try {
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure/v2", params, "UTF-8");
|
||||
if (json != null) {
|
||||
int code = json.getInt("status");
|
||||
String msg = json.getString("msg");
|
||||
if (json.containsKey("result")) {
|
||||
return (JSONObject) json.get("result");
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
LOGGER.error("µØÖ·±ê×¼»¯Ê§°Ü", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取高德中分数最高的信息
|
||||
* @param city
|
||||
|
||||
Reference in New Issue
Block a user