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

+ 1
- 1
pom.xml 查看文件

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

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

31
                                            @Param("minPriceW") Integer minPriceW,
31
                                            @Param("minPriceW") Integer minPriceW,
32
                                            @Param("maxPriceW") Integer maxPriceW,
32
                                            @Param("maxPriceW") Integer maxPriceW,
33
                                            @Param("minPrice") Integer minPrice,
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
         Integer cityId = searchHouseDTO.getCityId();
79
         Integer cityId = searchHouseDTO.getCityId();
80
         // 最小总价
80
         // 最小总价
81
         Integer minPriceW = Integer.parseInt(searchHouseDTO.getMinPrice());
81
         Integer minPriceW = Integer.parseInt(searchHouseDTO.getMinPrice());
82
+        if (minPriceW > 10000) {
83
+            minPriceW = minPriceW / 10000;
84
+        }
82
         // 最大总价
85
         // 最大总价
83
         Integer maxPriceW = Integer.parseInt(searchHouseDTO.getMaxPrice());
86
         Integer maxPriceW = Integer.parseInt(searchHouseDTO.getMaxPrice());
87
+        if (maxPriceW > 10000) {
88
+            maxPriceW = maxPriceW / 10000;
89
+        }
84
         // 面积字典
90
         // 面积字典
85
         Integer areaResultId = searchHouseDTO.getAreaResultId();
91
         Integer areaResultId = searchHouseDTO.getAreaResultId();
86
         //
92
         //
90
         // 最大单价
96
         // 最大单价
91
         Integer maxPrice = unitPrice[1];
97
         Integer maxPrice = unitPrice[1];
92
 
98
 
99
+        // 最多推荐5个楼盘
100
+        int limit = 5;
101
+
93
         if (null != areaId) {
102
         if (null != areaId) {
94
             // 1、先判断区域+价格
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
             if (null != lst1 && lst1.size() > 0) {
105
             if (null != lst1 && lst1.size() > 0) {
97
                 return lst1;
106
                 return lst1;
98
             }
107
             }
99
 
108
 
100
             // 2、判断城市+价格
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
             if (null != lst2 && lst2.size() > 0) {
111
             if (null != lst2 && lst2.size() > 0) {
103
                 return lst2;
112
                 return lst2;
104
             }
113
             }
105
         }
114
         }
106
 
115
 
107
         // 3、当前城市
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
     private Integer[] getUnitPriceRange(Integer minPriceW, Integer maxPriceW, Integer areaResultId) {
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
         switch (areaResultId) {
125
         switch (areaResultId) {
151
                 break;
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
             AND t.`status` > - 1
61
             AND t.`status` > - 1
62
         ORDER BY
62
         ORDER BY
63
             t.is_main ASC
63
             t.is_main ASC
64
+        LIMIT #{limit}
64
     </select>
65
     </select>
65
 </mapper>
66
 </mapper>