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