优化无样本估值
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.fangjia.dal.mongo.model;
|
||||
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@@ -16,6 +17,7 @@ public class OfficeRentStat implements MongoEntity {
|
||||
private Integer date;
|
||||
private Double avgPrice;
|
||||
private String name;
|
||||
@JsonIgnore
|
||||
private Object location;
|
||||
|
||||
@Id
|
||||
|
||||
@@ -282,6 +282,7 @@ public class OfficeController {
|
||||
districtPriceMap.put("district", evaluation.getRegion());
|
||||
districtPriceMap.put("name", evaluation.getName());
|
||||
districtPriceMap.put("samples", evaluation.getSeawater());
|
||||
districtPriceMap.put("refOffices", evaluation.getOffice());
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
||||
try {
|
||||
|
||||
+2
-34
@@ -354,9 +354,8 @@ public class OfficeServiceImpl implements OfficeService {
|
||||
// 评估逻辑
|
||||
String location = getLocation(evaluation.getCity(), evaluation.getAddress());
|
||||
evaluation.setLocation(location);
|
||||
OfficeEvaluationDto officeEvaluationDto = rentEvaluateByLocation(evaluation);
|
||||
|
||||
return officeEvaluationDto;
|
||||
return rentEvaluateByLocation(evaluation);
|
||||
}
|
||||
|
||||
private OfficeEvaluationDto rentEvaluateByLocation(Evaluation evaluation) {
|
||||
@@ -419,43 +418,12 @@ public class OfficeServiceImpl implements OfficeService {
|
||||
}
|
||||
Double avgPrice = DataUtil.roundDouble(totalPrice / count * factor, 2);
|
||||
officeEvaluationDto.setUnitPrice(avgPrice);
|
||||
officeEvaluationDto.setOffices(infos);
|
||||
officeEvaluationDto.setOffice(infos);
|
||||
officeEvaluationDto.setCity(evaluation.getCity());
|
||||
officeEvaluationDto.setDistrict(evaluation.getRegion());
|
||||
officeEvaluationDto.setName(evaluation.getDistrictName());
|
||||
return officeEvaluationDto;
|
||||
}
|
||||
|
||||
// // 查询Seawater样本
|
||||
// List<Seawater> seawaters;
|
||||
// SeawaterQuery query = new SeawaterQuery();
|
||||
// query.setLat(lat);
|
||||
// query.setLng(lng);
|
||||
// query.setCat("office_rent");
|
||||
// query.setRadius(3000);
|
||||
//
|
||||
// Integer endDate = Integer.valueOf(DateUtil.formatByPattern(new Date(), "yyyyMMdd"));
|
||||
// Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||
// query.setStartDate(startDate);
|
||||
// query.setEndDate(endDate);
|
||||
// query.setEstateType(TYPE_MAP.get(evaluation.getType()));
|
||||
// query.setLevel(LEVEL_MAP.get(evaluation.getLevel()));
|
||||
// query.setCityDisplay(evaluation.getCity());
|
||||
// Pager pager = new Pager();
|
||||
// pager.setStartRow(0);
|
||||
// pager.setPageSize(10);
|
||||
// query.setPager(pager);
|
||||
// query.setTable("latest_seawater");
|
||||
// seawaters = seawaterService.findSeawatersByQuery(query);
|
||||
// // 如果同等级同类型没有查到,则放开
|
||||
// if (CollectionUtils.isEmpty(seawaters)) {
|
||||
// query.setEstateType(null);
|
||||
// query.setLevel(null);
|
||||
// seawaters = seawaterService.findSeawatersByQuery(query);
|
||||
// }
|
||||
// if (CollectionUtils.isNotEmpty(seawaters)) {
|
||||
// return getOfficeEvaluationDtoWithFactor(seawaters, evaluation);
|
||||
// }
|
||||
}
|
||||
return officeEvaluationDto;
|
||||
}
|
||||
|
||||
+5
-5
@@ -15,7 +15,7 @@ public class OfficeEvaluationDto extends Evaluation {
|
||||
private Double unitPrice;
|
||||
|
||||
private List<Seawater> seawater;
|
||||
private List<OfficeRentStat> offices;
|
||||
private List<OfficeRentStat> office;
|
||||
|
||||
private String district;
|
||||
private String name;
|
||||
@@ -52,11 +52,11 @@ public class OfficeEvaluationDto extends Evaluation {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<OfficeRentStat> getOffices() {
|
||||
return offices;
|
||||
public List<OfficeRentStat> getOffice() {
|
||||
return office;
|
||||
}
|
||||
|
||||
public void setOffices(List<OfficeRentStat> offices) {
|
||||
this.offices = offices;
|
||||
public void setOffice(List<OfficeRentStat> office) {
|
||||
this.office = office;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user