|
@@ -2,12 +2,15 @@ package com.yunzhi.marketing.xlk.service.impl;
|
2
|
2
|
|
3
|
3
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
4
|
4
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
5
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
5
|
6
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
6
|
7
|
import com.yunzhi.marketing.base.ResponseBean;
|
7
|
8
|
import com.yunzhi.marketing.common.CommConstant;
|
8
|
9
|
import com.yunzhi.marketing.common.StringUtils;
|
9
|
10
|
import com.yunzhi.marketing.entity.TaRecommendCustomer;
|
10
|
11
|
import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
|
|
12
|
+import com.yunzhi.marketing.po.MineRecommendCustomerPO;
|
|
13
|
+import com.yunzhi.marketing.po.TaRecommendCustomerPO;
|
11
|
14
|
import com.yunzhi.marketing.xlk.dto.*;
|
12
|
15
|
import com.yunzhi.marketing.xlk.entity.*;
|
13
|
16
|
import com.yunzhi.marketing.xlk.mapper.*;
|
|
@@ -65,9 +68,6 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
65
|
68
|
queryWrapper.eq(TaRecommendCustomer::getBuildingId,customer.getBuildingId());
|
66
|
69
|
TaRecommendCustomer recommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
|
67
|
70
|
if (null == recommendCustomer) {
|
68
|
|
- // 审核通过
|
69
|
|
- customer.setStatus("2");
|
70
|
|
- channelCustomerMapper.updateById(customer);
|
71
|
71
|
// 进业务客户表
|
72
|
72
|
TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
|
73
|
73
|
taRecommendCustomer.setName(customer.getName());
|
|
@@ -87,6 +87,11 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
87
|
87
|
taRecommendCustomer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
|
88
|
88
|
taRecommendCustomer.setCirculationTime(LocalDateTime.now());
|
89
|
89
|
taRecommendCustomerMapper.insert(taRecommendCustomer);
|
|
90
|
+ // 审核通过
|
|
91
|
+ customer.setStatus("2");
|
|
92
|
+ customer.setCustomerId(taRecommendCustomer.getCustomerId());
|
|
93
|
+ customer.setVisitDate(LocalDateTime.now());
|
|
94
|
+ channelCustomerMapper.updateById(customer);
|
90
|
95
|
return ResponseBean.success("审核成功");
|
91
|
96
|
}
|
92
|
97
|
|
|
@@ -94,6 +99,8 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
94
|
99
|
(StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
|
95
|
100
|
// 审核通过
|
96
|
101
|
customer.setStatus("2");
|
|
102
|
+ customer.setCustomerId(recommendCustomer.getCustomerId());
|
|
103
|
+ customer.setVisitDate(LocalDateTime.now());
|
97
|
104
|
channelCustomerMapper.updateById(customer);
|
98
|
105
|
return ResponseBean.success("审核成功");
|
99
|
106
|
}
|
|
@@ -119,9 +126,6 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
119
|
126
|
queryWrapper.eq(TaRecommendCustomer::getBuildingId,customer.getBuildingId());
|
120
|
127
|
TaRecommendCustomer recommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
|
121
|
128
|
if (null == recommendCustomer) {
|
122
|
|
- // 审核通过
|
123
|
|
- customer.setStatus("2");
|
124
|
|
- channelCustomerMapper.updateById(customer);
|
125
|
129
|
// 进业务客户表
|
126
|
130
|
TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
|
127
|
131
|
taRecommendCustomer.setName(customer.getName());
|
|
@@ -141,10 +145,18 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
141
|
145
|
taRecommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
|
142
|
146
|
taRecommendCustomer.setCirculationTime(LocalDateTime.now());
|
143
|
147
|
taRecommendCustomerMapper.insert(taRecommendCustomer);
|
|
148
|
+
|
|
149
|
+ // 审核通过
|
|
150
|
+ customer.setStatus("2");
|
|
151
|
+ customer.setVisitDate(LocalDateTime.now());
|
|
152
|
+ customer.setCustomerId(taRecommendCustomer.getCustomerId());
|
|
153
|
+ channelCustomerMapper.updateById(customer);
|
144
|
154
|
}else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
|
145
|
155
|
(StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
|
146
|
156
|
// 审核通过
|
147
|
157
|
customer.setStatus("2");
|
|
158
|
+ customer.setVisitDate(LocalDateTime.now());
|
|
159
|
+ customer.setCustomerId(recommendCustomer.getCustomerId());
|
148
|
160
|
channelCustomerMapper.updateById(customer);
|
149
|
161
|
|
150
|
162
|
// 修改状态为确认到访状态
|
|
@@ -234,6 +246,11 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
234
|
246
|
taRecommendCustomer.setStatus(CommConstant.CUSTOMER_PREPARATORY);
|
235
|
247
|
taRecommendCustomerMapper.updateById(taRecommendCustomer);
|
236
|
248
|
|
|
249
|
+ LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
250
|
+ channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
|
|
251
|
+ ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
|
|
252
|
+ customer.setPreparatoryDate(LocalDateTime.now());
|
|
253
|
+
|
237
|
254
|
CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
|
238
|
255
|
customerPreparatory.setCreateDate(LocalDateTime.now());
|
239
|
256
|
customerPreparatoryMapper.insert(customerPreparatory);
|
|
@@ -251,6 +268,12 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
251
|
268
|
TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getCustomerId());
|
252
|
269
|
taRecommendCustomer.setStatus(CommConstant.CUSTOMER_COMMISSION);
|
253
|
270
|
taRecommendCustomerMapper.updateById(taRecommendCustomer);
|
|
271
|
+
|
|
272
|
+ LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
273
|
+ channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
|
|
274
|
+ ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
|
|
275
|
+ customer.setCommissionDate(LocalDateTime.now());
|
|
276
|
+
|
254
|
277
|
return ResponseBean.success("审核成功");
|
255
|
278
|
}
|
256
|
279
|
|
|
@@ -266,9 +289,29 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
266
|
289
|
taRecommendCustomer.setStatus(CommConstant.CUSTOMER_SIGNED);
|
267
|
290
|
taRecommendCustomerMapper.updateById(taRecommendCustomer);
|
268
|
291
|
|
|
292
|
+ LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
293
|
+ channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
|
|
294
|
+ ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
|
|
295
|
+ customer.setSignedDate(LocalDateTime.now());
|
|
296
|
+
|
269
|
297
|
CustomerSignatory customerSignatory = params.getCustomerSignatory();
|
270
|
298
|
customerSignatory.setCreateDate(LocalDateTime.now());
|
271
|
299
|
customerSignatoryMapper.insert(customerSignatory);
|
272
|
300
|
return ResponseBean.success("审核成功");
|
273
|
301
|
}
|
|
302
|
+
|
|
303
|
+ /**
|
|
304
|
+ * 查询经纪人的我的客户列表
|
|
305
|
+ *
|
|
306
|
+ * @param pageNumber
|
|
307
|
+ * @param pageSize
|
|
308
|
+ * @param recommendCustomerDTO
|
|
309
|
+ * @return
|
|
310
|
+ */
|
|
311
|
+ @Override
|
|
312
|
+ public ResponseBean getCustomersIRecommended(int pageNumber, int pageSize, RecommendCustomerDTO recommendCustomerDTO) {
|
|
313
|
+ IPage<MineRecommendCustomerPO> page = new Page<MineRecommendCustomerPO>(pageNumber, pageSize);
|
|
314
|
+ IPage<MineRecommendCustomerPO> customersIRecommended = channelCustomerMapper.getCustomersIRecommended(page, recommendCustomerDTO);
|
|
315
|
+ return ResponseBean.success(customersIRecommended);
|
|
316
|
+ }
|
274
|
317
|
}
|