张延森 3 年前
父节点
当前提交
55902789e5

+ 1
- 1
pom.xml 查看文件

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.yunzhi</groupId>
12 12
 	<artifactId>marketing</artifactId>
13
-	<version>v1.0.21</version>
13
+	<version>v1.0.22</version>
14 14
 	<name>marketing-cloud</name>
15 15
 	<description>新联康营销云</description>
16 16
 

+ 2
- 1
src/main/java/com/yunzhi/marketing/xlk/mapper/SearchHouseMapper.java 查看文件

@@ -31,5 +31,6 @@ public interface SearchHouseMapper extends BaseMapper<SearchHouse> {
31 31
                                            @Param("minPriceW") Integer minPriceW,
32 32
                                            @Param("maxPriceW") Integer maxPriceW,
33 33
                                            @Param("minPrice") Integer minPrice,
34
-                                           @Param("maxPrice") Integer maxPrice);
34
+                                           @Param("maxPrice") Integer maxPrice,
35
+                                           @Param("limit") Integer limit);
35 36
 }

+ 15
- 6
src/main/java/com/yunzhi/marketing/xlk/service/impl/SearchHouseServiceImpl.java 查看文件

@@ -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
 }

+ 1
- 0
src/main/resources/mapper/xlk/SearchHouseMapper.xml 查看文件

@@ -61,5 +61,6 @@
61 61
             AND t.`status` > - 1
62 62
         ORDER BY
63 63
             t.is_main ASC
64
+        LIMIT #{limit}
64 65
     </select>
65 66
 </mapper>