新增写字楼估值估值接口
This commit is contained in:
+20
@@ -1,6 +1,8 @@
|
||||
package com.fangjia.service.datastore;
|
||||
|
||||
import com.fangjia.dal.mongo.model.Evaluation;
|
||||
import com.fangjia.dal.mongo.model.OfficeRentStat;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,6 +14,8 @@ public interface OfficeService {
|
||||
|
||||
|
||||
/**
|
||||
* 租金均价
|
||||
*
|
||||
* @param city
|
||||
* @param region
|
||||
* @param startDate
|
||||
@@ -20,4 +24,20 @@ public interface OfficeService {
|
||||
*/
|
||||
List<OfficeRentStat> findOfficeRentStat(final String city, final String region, final Integer startDate, final Integer endDate);
|
||||
|
||||
/**
|
||||
* 租金评估
|
||||
*
|
||||
* @param district
|
||||
* @param evaluation
|
||||
* @return
|
||||
*/
|
||||
Evaluation evaluateRent(District district, Evaluation evaluation);
|
||||
|
||||
/**
|
||||
* 租金地址维度评估
|
||||
*
|
||||
* @param evaluation
|
||||
* @return
|
||||
*/
|
||||
Evaluation addressEvaluateRent(Evaluation evaluation);
|
||||
}
|
||||
|
||||
+28
@@ -4,13 +4,17 @@ import com.fangjia.core.util.CacheUtils;
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.SortParam;
|
||||
import com.fangjia.dal.mongo.dao.office.OfficeRentStatDao;
|
||||
import com.fangjia.dal.mongo.model.Evaluation;
|
||||
import com.fangjia.dal.mongo.model.OfficeRentStat;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import org.sothis.core.util.Closure;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 写字楼相关服务类
|
||||
*
|
||||
* @author shenjian
|
||||
* @since 2025/1/21
|
||||
*/
|
||||
@@ -18,6 +22,30 @@ public class OfficeServiceImpl implements OfficeService {
|
||||
|
||||
private OfficeRentStatDao officeRentStatDao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Evaluation evaluateRent(District district, Evaluation evaluation) {
|
||||
if (null == evaluation.getFloor() || 0 == evaluation.getFloor() || null == evaluation.getHeight() || 0 == evaluation.getHeight()) {
|
||||
evaluation.setFloor(null);
|
||||
evaluation.setHeight(null);
|
||||
}
|
||||
// 评估逻辑
|
||||
evaluation.setUnitPrice(3.04);
|
||||
return evaluation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Evaluation addressEvaluateRent(Evaluation evaluation) {
|
||||
if (null == evaluation.getFloor() || 0 == evaluation.getFloor() || null == evaluation.getHeight() || 0 == evaluation.getHeight()) {
|
||||
evaluation.setFloor(null);
|
||||
evaluation.setHeight(null);
|
||||
}
|
||||
// 评估逻辑
|
||||
evaluation.setUnitPrice(3.05);
|
||||
return evaluation;
|
||||
}
|
||||
|
||||
public List<OfficeRentStat> findOfficeRentStat(final String city, final String region, final Integer startDate, final Integer endDate) {
|
||||
return CacheUtils.getValue(this.getClass(), "findOfficeRentStat", city + region + startDate + endDate,
|
||||
CacheUtils.CachePolicyEnum.MIDDLE, new Closure<List<OfficeRentStat>, String>() {
|
||||
|
||||
Reference in New Issue
Block a user