新增平米租金接口
This commit is contained in:
@@ -15,15 +15,15 @@ import com.fangjia.dal.MongoEntity;
|
||||
public class SqmetreRent implements MongoEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5525712882803653336L;
|
||||
private String id;
|
||||
private String city;
|
||||
private String region;
|
||||
private String districtName;
|
||||
private Integer avgPrice;
|
||||
private Integer calcAvgPrice;
|
||||
private Number avgPrice;
|
||||
private Number calcAvgPrice;
|
||||
private Double markup;
|
||||
private Date weekend;
|
||||
private String cat;
|
||||
@@ -74,20 +74,20 @@ public class SqmetreRent implements MongoEntity {
|
||||
}
|
||||
|
||||
@Column(name = "avg_price")
|
||||
public Integer getAvgPrice() {
|
||||
public Number getAvgPrice() {
|
||||
return avgPrice;
|
||||
}
|
||||
|
||||
public void setAvgPrice(Integer avgPrice) {
|
||||
public void setAvgPrice(Number avgPrice) {
|
||||
this.avgPrice = avgPrice;
|
||||
}
|
||||
|
||||
@Column(name = "calc_avg_price")
|
||||
public Integer getCalcAvgPrice() {
|
||||
public Number getCalcAvgPrice() {
|
||||
return calcAvgPrice;
|
||||
}
|
||||
|
||||
public void setCalcAvgPrice(Integer calcAvgPrice) {
|
||||
public void setCalcAvgPrice(Number calcAvgPrice) {
|
||||
this.calcAvgPrice = calcAvgPrice;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,5 @@ public class SqmetreRent implements MongoEntity {
|
||||
public void setCat(String cat) {
|
||||
this.cat = cat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+5671
-5615
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -203,7 +203,7 @@ public class RentController {
|
||||
private Double getSqmetreRent(District district){
|
||||
SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(district.getCity(), district.getRegion(), district.getName(), null, "district");
|
||||
if(null != sqmetreRent){
|
||||
return Double.valueOf(sqmetreRent.getAvgPrice());
|
||||
return Double.valueOf(sqmetreRent.getAvgPrice().intValue());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,15 @@ public class AvgPriceQueryModel {
|
||||
Integer periodCount;
|
||||
String periodType;
|
||||
Integer houseType;
|
||||
String cat;
|
||||
|
||||
public String getCat() {
|
||||
return cat;
|
||||
}
|
||||
|
||||
public void setCat(String cat) {
|
||||
this.cat = cat;
|
||||
}
|
||||
|
||||
public Integer getPeriodCount() {
|
||||
return periodCount;
|
||||
|
||||
+1
-1
@@ -1038,7 +1038,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
||||
|
||||
SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(district.getCity(), district.getRegion(), district.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
||||
if(sqmetreRent!=null){
|
||||
long totalPrice = evaluationRateService.evaluationRent(sqmetreRent.getAvgPrice(), evaluation);
|
||||
long totalPrice = evaluationRateService.evaluationRent(sqmetreRent.getAvgPrice().intValue(), evaluation);
|
||||
|
||||
evaluation.setTotalPrice(((Number) (totalPrice)).intValue());
|
||||
|
||||
|
||||
+3
-3
@@ -194,7 +194,7 @@ public class HouseReportServiceImpl implements HouseReportService{
|
||||
SqmetreRent citySqmetreRent = sqmetreRentService.findNearestSqmetreRent(city, null, null, "city");
|
||||
RegionStat cityRegionStat = regionStatService.findByCity(city);
|
||||
if(null != citySqmetreRent && null != cityRegionStat){
|
||||
Double rate = DataUtil.getDoubleRound(2, citySqmetreRent.getAvgPrice()*12*100/cityRegionStat.getAvgPrice());
|
||||
Double rate = DataUtil.getDoubleRound(2, citySqmetreRent.getAvgPrice().intValue()*12*100/cityRegionStat.getAvgPrice());
|
||||
return rate;
|
||||
}
|
||||
return null;
|
||||
@@ -205,7 +205,7 @@ public class HouseReportServiceImpl implements HouseReportService{
|
||||
SqmetreRent regionSqmetreRent = sqmetreRentService.findNearestSqmetreRent(city, region, null, "region");
|
||||
RegionStat regionStat = regionStatService.findRegionStat(city, region);
|
||||
if(null != regionSqmetreRent && null != regionStat){
|
||||
Double rate = DataUtil.getDoubleRound(2, regionSqmetreRent.getAvgPrice()*12*100/regionStat.getAvgPrice());
|
||||
Double rate = DataUtil.getDoubleRound(2, regionSqmetreRent.getAvgPrice().intValue()*12*100/regionStat.getAvgPrice());
|
||||
return rate;
|
||||
}
|
||||
return null;
|
||||
@@ -224,7 +224,7 @@ public class HouseReportServiceImpl implements HouseReportService{
|
||||
distAvgPrice = statBo.getVillaDistrictStat().getAvgPrice();
|
||||
}
|
||||
if(distAvgPrice > 0){
|
||||
Double rate = DataUtil.getDoubleRound(2, distSqmetreRent.getAvgPrice()*12*100/distAvgPrice);
|
||||
Double rate = DataUtil.getDoubleRound(2, distSqmetreRent.getAvgPrice().intValue()*12*100/distAvgPrice);
|
||||
return rate;
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -126,6 +126,13 @@ public class SqmetreRentServiceImpl implements SqmetreRentService{
|
||||
if(StringUtils.isNotBlank(cat)){
|
||||
params.add(new QueryParam("cat", cat));
|
||||
}
|
||||
if(null != startDate){
|
||||
params.add(new QueryParam("weekend",QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||
}
|
||||
|
||||
if(null != endDate){
|
||||
params.add(new QueryParam("weekend",QueryParam.LESS_THAN_EQUAL_OPERATOR, endDate));
|
||||
}
|
||||
|
||||
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||
sortParams.add(new SortParam("weekend", true));
|
||||
|
||||
Reference in New Issue
Block a user