傅行帆 преди 5 години
родител
ревизия
28b464577d

+ 29
- 0
src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java Целия файл

@@ -10,6 +10,7 @@ import com.huiju.estateagents.common.CommConstant;
10 10
 import com.huiju.estateagents.common.JWTUtils;
11 11
 import com.huiju.estateagents.common.StringUtils;
12 12
 import com.huiju.estateagents.entity.*;
13
+import com.huiju.estateagents.mapper.TaBuildingProjectTypeMapper;
13 14
 import com.huiju.estateagents.service.*;
14 15
 import org.apache.commons.collections.map.HashedMap;
15 16
 import org.slf4j.Logger;
@@ -55,6 +56,8 @@ public class TaPersonVisitRecordController extends BaseController {
55 56
     private ITaRecommendCustomerService taRecommendCustomerService;
56 57
     @Autowired
57 58
     public ITaPersonFromRecordService iTaPersonFromRecordService;
59
+    @Autowired
60
+    private TaBuildingProjectTypeMapper taBuildingProjectTypeMapper;
58 61
 
59 62
 
60 63
     /**
@@ -372,6 +375,32 @@ public class TaPersonVisitRecordController extends BaseController {
372 375
                     e.setNewsNum(shareNum);
373 376
                     break;
374 377
                 case CommConstant.FAVOR_PROJECT:
378
+                    //获取项目类型里的价格
379
+                    QueryWrapper<TaBuildingProjectType> projectTypeQueryWrapper = new QueryWrapper<>();
380
+                    projectTypeQueryWrapper.eq("building_id",e.getTargetId());
381
+                    projectTypeQueryWrapper.eq("building_type_id",e.getBuildingTypeId());
382
+                    TaBuildingProjectType taBuildingProjectType = taBuildingProjectTypeMapper.selectOne(projectTypeQueryWrapper);
383
+                    //价格相同显示一个否则显示区间
384
+                    if (null != taBuildingProjectType){
385
+                        Integer startPrice = taBuildingProjectType.getStartPrice();
386
+                        Integer endPrice = taBuildingProjectType.getEndPrice();
387
+                        if (null != startPrice && null == endPrice){
388
+                            e.setPrice(String.valueOf(startPrice));
389
+                        }else if (null == startPrice && null != endPrice){
390
+                            e.setPrice(String.valueOf(endPrice));
391
+                        }else if(null != startPrice && null != endPrice){
392
+                            if (startPrice.equals(endPrice)){
393
+                                e.setPrice(String.valueOf(startPrice));
394
+                            }else{
395
+                                e.setPrice(startPrice + "--" + endPrice);
396
+                            }
397
+                        }else{
398
+                            e.setPrice(null);
399
+                        }
400
+                        e.setPriceType(taBuildingProjectType.getPriceType());
401
+                    } else {
402
+                        e.setPrice(null);
403
+                    }
375 404
                     e.setBuildingNum(shareNum);
376 405
                     break;
377 406
                 case CommConstant.EVENT_H5:

+ 4
- 0
src/main/java/com/huiju/estateagents/entity/TaConsultantInfo.java Целия файл

@@ -31,4 +31,8 @@ public class TaConsultantInfo {
31 31
     private Integer newsNum;
32 32
 
33 33
     private Integer drainageShareNum;
34
+
35
+    private Integer buildingTypeId;
36
+
37
+    private String priceType;
34 38
 }

+ 7
- 1
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Целия файл

@@ -227,10 +227,11 @@
227 227
                 a.building_name,
228 228
                 a.address,
229 229
                 a.price,
230
+                a.building_type_id,
230 231
                 t.tagert_type as eventType,
231 232
 				t.create_date as visit_time
232 233
                 from ta_share t
233
-                left join (select b.url, a.building_name,a.address,a.price,a.building_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.be_share = a.building_id
234
+                left join (select b.url, a.building_name,a.address,a.price,a.building_id,a.building_type_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.be_share = a.building_id
234 235
                 where t.tagert_type = 'project'
235 236
                 and t.person_id = #{personId} order by t.create_date desc limit 9999
236 237
             ) t
@@ -246,6 +247,7 @@
246 247
         '1' as price,
247 248
         '2' as building_name,
248 249
         '3' as address,
250
+        1 as building_type_id,
249 251
         t.tagert_type as eventType,
250 252
 		t.create_date as visit_time
251 253
         from ta_share t
@@ -265,6 +267,7 @@
265 267
         '1' as price,
266 268
         '2' as building_name,
267 269
         '3' as address,
270
+        1 as building_type_id,
268 271
         t.tagert_type as eventType,
269 272
 		t.create_date as visit_time
270 273
         from ta_share t
@@ -284,6 +287,7 @@
284 287
         '1' as price,
285 288
         '2' as building_name,
286 289
         '3' as address,
290
+        1 as building_type_id,
287 291
         t.tagert_type as eventType,
288 292
 		t.create_date as visit_time
289 293
         from ta_share t
@@ -303,6 +307,7 @@
303 307
         '1' as price,
304 308
         '2' as building_name,
305 309
         '3' as address,
310
+        1 as building_type_id,
306 311
         t.tagert_type as eventType,
307 312
 		t.create_date as visit_time
308 313
         from ta_share t
@@ -322,6 +327,7 @@
322 327
             '1' as price,
323 328
             '2' as building_name,
324 329
             '3' as address,
330
+            1 as building_type_id,
325 331
 			t.tagert_type as eventType,
326 332
 			t.create_date as visit_time
327 333
             from ta_share t