|
@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.yunzhi.marketing.base.BaseController;
|
7
|
7
|
import com.yunzhi.marketing.base.ResponseBean;
|
|
8
|
+import com.yunzhi.marketing.common.StringUtils;
|
|
9
|
+import com.yunzhi.marketing.entity.TaBuilding;
|
8
|
10
|
import com.yunzhi.marketing.entity.TaPerson;
|
|
11
|
+import com.yunzhi.marketing.service.ITaBuildingService;
|
9
|
12
|
import com.yunzhi.marketing.service.ITaPersonService;
|
10
|
13
|
import com.yunzhi.marketing.xlk.dto.SearchHouseDTO;
|
11
|
14
|
import com.yunzhi.marketing.xlk.dto.SearchHouseReplayDTO;
|
|
@@ -53,6 +56,8 @@ public class SearchHouseController extends BaseController {
|
53
|
56
|
@Autowired
|
54
|
57
|
public ITaPersonService taPersonService;
|
55
|
58
|
|
|
59
|
+ @Autowired
|
|
60
|
+ private ITaBuildingService taBuildingService;
|
56
|
61
|
|
57
|
62
|
/**
|
58
|
63
|
* 分页查询列表
|
|
@@ -103,7 +108,24 @@ public class SearchHouseController extends BaseController {
|
103
|
108
|
searchHouse.setOrgId(orgId);
|
104
|
109
|
searchHouse.setCreatedTime(LocalDateTime.now());
|
105
|
110
|
if (iSearchHouseService.save(searchHouse)){
|
106
|
|
- responseBean.addSuccess(searchHouse);
|
|
111
|
+ SearchHouseVO searchHouseVO = new SearchHouseVO();
|
|
112
|
+ BeanUtils.copyProperties(searchHouse,searchHouseVO);
|
|
113
|
+ // 获取价格相近的楼盘
|
|
114
|
+ LambdaQueryWrapper<TaBuilding> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
115
|
+ lambdaQueryWrapper.eq(!StringUtils.isEmpty(searchHouseDTO.getIntentArea()),TaBuilding::getBuildingArea,searchHouseDTO.getIntentArea());
|
|
116
|
+ lambdaQueryWrapper.between(TaBuilding::getPrice,searchHouseDTO.getMinPrice(),searchHouseDTO.getMaxPrice());
|
|
117
|
+ lambdaQueryWrapper.ne(TaBuilding::getStatus,-1);
|
|
118
|
+ lambdaQueryWrapper.last(" limit 2");
|
|
119
|
+ List<TaBuilding> list = taBuildingService.list(lambdaQueryWrapper);
|
|
120
|
+ if (list.size() < 1){
|
|
121
|
+ lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
122
|
+ lambdaQueryWrapper.eq(!StringUtils.isEmpty(searchHouseDTO.getIntentArea()),TaBuilding::getBuildingArea,searchHouseDTO.getIntentArea());
|
|
123
|
+ lambdaQueryWrapper.ne(TaBuilding::getStatus,-1);
|
|
124
|
+ lambdaQueryWrapper.last(" limit 2");
|
|
125
|
+ list = taBuildingService.list(lambdaQueryWrapper);
|
|
126
|
+ }
|
|
127
|
+ searchHouseVO.setTaBuildingList(list);
|
|
128
|
+ responseBean.addSuccess(searchHouseVO);
|
107
|
129
|
}else {
|
108
|
130
|
responseBean.addError("fail");
|
109
|
131
|
}
|