|
@@ -79,8 +79,14 @@ public class SearchHouseServiceImpl extends ServiceImpl<SearchHouseMapper, Searc
|
79
|
79
|
Integer cityId = searchHouseDTO.getCityId();
|
80
|
80
|
// 最小总价
|
81
|
81
|
Integer minPriceW = Integer.parseInt(searchHouseDTO.getMinPrice());
|
|
82
|
+ if (minPriceW > 10000) {
|
|
83
|
+ minPriceW = minPriceW / 10000;
|
|
84
|
+ }
|
82
|
85
|
// 最大总价
|
83
|
86
|
Integer maxPriceW = Integer.parseInt(searchHouseDTO.getMaxPrice());
|
|
87
|
+ if (maxPriceW > 10000) {
|
|
88
|
+ maxPriceW = maxPriceW / 10000;
|
|
89
|
+ }
|
84
|
90
|
// 面积字典
|
85
|
91
|
Integer areaResultId = searchHouseDTO.getAreaResultId();
|
86
|
92
|
//
|
|
@@ -90,27 +96,30 @@ public class SearchHouseServiceImpl extends ServiceImpl<SearchHouseMapper, Searc
|
90
|
96
|
// 最大单价
|
91
|
97
|
Integer maxPrice = unitPrice[1];
|
92
|
98
|
|
|
99
|
+ // 最多推荐5个楼盘
|
|
100
|
+ int limit = 5;
|
|
101
|
+
|
93
|
102
|
if (null != areaId) {
|
94
|
103
|
// 1、先判断区域+价格
|
95
|
|
- List<TaBuilding> lst1 = searchHouseMapper.getRecommendBuildings(orgId, null, areaId, minPriceW, maxPriceW, minPrice, maxPrice);
|
|
104
|
+ List<TaBuilding> lst1 = searchHouseMapper.getRecommendBuildings(orgId, null, areaId, minPriceW, maxPriceW, minPrice, maxPrice, limit);
|
96
|
105
|
if (null != lst1 && lst1.size() > 0) {
|
97
|
106
|
return lst1;
|
98
|
107
|
}
|
99
|
108
|
|
100
|
109
|
// 2、判断城市+价格
|
101
|
|
- List<TaBuilding> lst2 = searchHouseMapper.getRecommendBuildings(orgId, areaCity, null, minPriceW, maxPriceW, minPrice, maxPrice);
|
|
110
|
+ List<TaBuilding> lst2 = searchHouseMapper.getRecommendBuildings(orgId, areaCity, null, minPriceW, maxPriceW, minPrice, maxPrice, limit);
|
102
|
111
|
if (null != lst2 && lst2.size() > 0) {
|
103
|
112
|
return lst2;
|
104
|
113
|
}
|
105
|
114
|
}
|
106
|
115
|
|
107
|
116
|
// 3、当前城市
|
108
|
|
- return searchHouseMapper.getRecommendBuildings(orgId, cityId, null, minPriceW, maxPriceW, minPrice, maxPrice);
|
|
117
|
+ return searchHouseMapper.getRecommendBuildings(orgId, cityId, null, minPriceW, maxPriceW, minPrice, maxPrice, limit);
|
109
|
118
|
}
|
110
|
119
|
|
111
|
120
|
private Integer[] getUnitPriceRange(Integer minPriceW, Integer maxPriceW, Integer areaResultId) {
|
112
|
|
- Integer minPrice = minPriceW;
|
113
|
|
- Integer maxPrice = maxPriceW;
|
|
121
|
+ Integer minPrice = minPriceW * 10000;
|
|
122
|
+ Integer maxPrice = maxPriceW * 10000;
|
114
|
123
|
|
115
|
124
|
// 字典过滤 - 必须与小程序端保持一致
|
116
|
125
|
switch (areaResultId) {
|
|
@@ -151,6 +160,6 @@ public class SearchHouseServiceImpl extends ServiceImpl<SearchHouseMapper, Searc
|
151
|
160
|
break;
|
152
|
161
|
}
|
153
|
162
|
|
154
|
|
- return new Integer[] {minPrice * 10000, maxPrice * 10000};
|
|
163
|
+ return new Integer[] {minPrice, maxPrice};
|
155
|
164
|
}
|
156
|
165
|
}
|