添加写字楼租金走势
This commit is contained in:
+59
-2
@@ -93,7 +93,7 @@ public class OfficeController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<OfficeRentStat> regionStats = officeService.findOfficeRentStat(city, null, startDate, endDate);
|
List<OfficeRentStat> regionStats = officeService.findOfficeRentStat(city, null, null, "city", startDate, endDate);
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(regionStats)) {
|
if (CollectionUtils.isEmpty(regionStats)) {
|
||||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "该城市没有均价数据"));
|
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "该城市没有均价数据"));
|
||||||
@@ -149,7 +149,7 @@ public class OfficeController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<OfficeRentStat> regionStats = officeService.findOfficeRentStat(city, region, startDate, endDate);
|
List<OfficeRentStat> regionStats = officeService.findOfficeRentStat(city, region, null, "district", startDate, endDate);
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(regionStats)) {
|
if (CollectionUtils.isEmpty(regionStats)) {
|
||||||
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "该区域没有均价数据"));
|
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "该区域没有均价数据"));
|
||||||
@@ -159,6 +159,63 @@ public class OfficeController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写字楼均价走势
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Object officeRentAction(@Param(name = "city") String city, @Param(name = "district") String district,
|
||||||
|
@Param(name = "name") String name, @Param(name = "startDate") Integer startDate,
|
||||||
|
@Param(name = "endDate") Integer endDate) {
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
mav.setViewType("rest");
|
||||||
|
if (StringUtils.isBlank(city)) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("city不能为null"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(district)) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("district不能为null"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
if (!RegionData.isCity(city)) {
|
||||||
|
String formatCity = RegionData.formatCity(city);
|
||||||
|
if (StringUtils.isNotBlank(formatCity)) {
|
||||||
|
city = formatCity;
|
||||||
|
} else {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("city非法"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ServerArea serverArea = ServerAreaData.getServerAreaByCity(city);
|
||||||
|
if (null == serverArea) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("city非法"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
String region = RegionData.formatRegion(city, district);
|
||||||
|
if (!RegionData.isRegion(city, region)) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("没有找你输入的区域"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (startDate == null || endDate == null) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("startDate或endDate不能为null"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
if (startDate > endDate) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("startDate不能大于endDate"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<OfficeRentStat> regionStats = officeService.findOfficeRentStat(city, region, name, "office", startDate, endDate);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(regionStats)) {
|
||||||
|
mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "该写字楼没有均价数据"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
mav.setModel(BasicModel.buildOKModel().setResult(regionStats));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 写字楼楼租金地址估值
|
* 写字楼楼租金地址估值
|
||||||
*
|
*
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ public interface OfficeService {
|
|||||||
* @param endDate
|
* @param endDate
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OfficeRentStat> findOfficeRentStat(final String city, final String region, final Integer startDate, final Integer endDate);
|
List<OfficeRentStat> findOfficeRentStat(final String city, final String region,final String name, final String cat, final Integer startDate, final Integer endDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租金评估
|
* 租金评估
|
||||||
|
|||||||
+14
-6
@@ -34,7 +34,6 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
private SeawaterService seawaterService;
|
private SeawaterService seawaterService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OfficeEvaluationDto evaluateRent(District district, Evaluation evaluation) {
|
public OfficeEvaluationDto evaluateRent(District district, Evaluation evaluation) {
|
||||||
if (null == evaluation.getFloor() || 0 == evaluation.getFloor() || null == evaluation.getHeight() || 0 == evaluation.getHeight()) {
|
if (null == evaluation.getFloor() || 0 == evaluation.getFloor() || null == evaluation.getHeight() || 0 == evaluation.getHeight()) {
|
||||||
@@ -55,7 +54,7 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
return officeEvaluationDto;
|
return officeEvaluationDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 所在楼层
|
// 所在楼层
|
||||||
// 总楼层
|
// 总楼层
|
||||||
private static final Map<String, String> FITMENT_MAP = new HashMap<String, String>() {
|
private static final Map<String, String> FITMENT_MAP = new HashMap<String, String>() {
|
||||||
{
|
{
|
||||||
@@ -224,6 +223,7 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据均价查询样本
|
* 根据均价查询样本
|
||||||
|
*
|
||||||
* @param avgPrice
|
* @param avgPrice
|
||||||
* @param evaluation
|
* @param evaluation
|
||||||
* @return
|
* @return
|
||||||
@@ -253,6 +253,7 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 基准价*楼层系数*装修系数*朝向系数
|
* 基准价*楼层系数*装修系数*朝向系数
|
||||||
|
*
|
||||||
* @param seawaters
|
* @param seawaters
|
||||||
* @param evaluation
|
* @param evaluation
|
||||||
* @return
|
* @return
|
||||||
@@ -403,26 +404,33 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OfficeRentStat> findOfficeRentStat(final String city, final String region, final Integer startDate, final Integer endDate) {
|
public List<OfficeRentStat> findOfficeRentStat(final String city, final String region, final String name, final String cat, final Integer startDate, final Integer endDate) {
|
||||||
return CacheUtils.getValue(this.getClass(), "findOfficeRentStat", city + region + startDate + endDate,
|
return CacheUtils.getValue(this.getClass(), "findOfficeRentStat", city + region + name + startDate + endDate,
|
||||||
CacheUtils.CachePolicyEnum.MIDDLE, new Closure<List<OfficeRentStat>, String>() {
|
CacheUtils.CachePolicyEnum.MIDDLE, new Closure<List<OfficeRentStat>, String>() {
|
||||||
public List<OfficeRentStat> execute(String input) {
|
public List<OfficeRentStat> execute(String input) {
|
||||||
return doFindRegionBlockStat(city, region, startDate, endDate);
|
return doFindRegionBlockStat(city, region, name, cat, startDate, endDate);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OfficeRentStat> doFindRegionBlockStat(final String city, final String region, Integer startDate, Integer endDate) {
|
public List<OfficeRentStat> doFindRegionBlockStat(final String city, final String region, final String name, final String cat, Integer startDate, Integer endDate) {
|
||||||
if (startDate == null) {
|
if (startDate == null) {
|
||||||
throw new IllegalArgumentException("开始日期不能为空");
|
throw new IllegalArgumentException("开始日期不能为空");
|
||||||
}
|
}
|
||||||
if (endDate == null) {
|
if (endDate == null) {
|
||||||
throw new IllegalArgumentException("结束日期不能为空");
|
throw new IllegalArgumentException("结束日期不能为空");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isBlank(cat)) {
|
||||||
|
throw new IllegalArgumentException("cat不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||||
params.add(new QueryParam("city", city));
|
params.add(new QueryParam("city", city));
|
||||||
params.add(new QueryParam("district", region));
|
params.add(new QueryParam("district", region));
|
||||||
|
if (StringUtils.isNotBlank(name)) {
|
||||||
|
params.add(new QueryParam("name", name));
|
||||||
|
}
|
||||||
|
params.add(new QueryParam("cat", cat));
|
||||||
|
|
||||||
if (startDate != null) {
|
if (startDate != null) {
|
||||||
params.add(new QueryParam("date", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
params.add(new QueryParam("date", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||||
|
|||||||
Reference in New Issue
Block a user