|
@@ -3,17 +3,19 @@ package com.yunzhi.marketing.xlk.service.impl;
|
3
|
3
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
4
|
4
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
5
|
5
|
import com.yunzhi.marketing.base.ResponseBean;
|
|
6
|
+import com.yunzhi.marketing.common.CommConstant;
|
6
|
7
|
import com.yunzhi.marketing.common.StringUtils;
|
7
|
8
|
import com.yunzhi.marketing.entity.TaRecommendCustomer;
|
8
|
9
|
import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
|
9
|
10
|
import com.yunzhi.marketing.xlk.dto.ChannelCustomerDTO;
|
|
11
|
+import com.yunzhi.marketing.xlk.dto.MarkingChannelCustomerDTO;
|
10
|
12
|
import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
|
11
|
13
|
import com.yunzhi.marketing.xlk.mapper.ChannelCustomerMapper;
|
12
|
14
|
import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
|
13
|
15
|
import org.springframework.beans.factory.annotation.Autowired;
|
14
|
16
|
import org.springframework.stereotype.Service;
|
15
|
17
|
|
16
|
|
-import java.util.List;
|
|
18
|
+import java.time.LocalDateTime;
|
17
|
19
|
|
18
|
20
|
/**
|
19
|
21
|
* <p>
|
|
@@ -53,16 +55,33 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
53
|
55
|
LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
54
|
56
|
queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());
|
55
|
57
|
queryWrapper.eq(TaRecommendCustomer::getBuildingId,customer.getBuildingId());
|
56
|
|
- TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
|
57
|
|
- if (null == taRecommendCustomer) {
|
|
58
|
+ TaRecommendCustomer recommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
|
|
59
|
+ if (null == recommendCustomer) {
|
58
|
60
|
// 审核通过
|
59
|
61
|
customer.setStatus("2");
|
60
|
62
|
channelCustomerMapper.updateById(customer);
|
|
63
|
+ // 进业务客户表
|
|
64
|
+ TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
|
|
65
|
+ taRecommendCustomer.setName(customer.getName());
|
|
66
|
+ taRecommendCustomer.setPicture(customer.getPicture());
|
|
67
|
+ taRecommendCustomer.setPhone(customer.getPhone());
|
|
68
|
+ taRecommendCustomer.setSex(customer.getSex());
|
|
69
|
+ taRecommendCustomer.setRecommendPerson(customer.getRecommendPerson());
|
|
70
|
+ taRecommendCustomer.setBuildingId(customer.getBuildingId());
|
|
71
|
+ taRecommendCustomer.setReportRecommendStatus(CommConstant.RECOMMENDED);
|
|
72
|
+ taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
|
|
73
|
+ taRecommendCustomer.setCreateDate(LocalDateTime.now());
|
|
74
|
+ taRecommendCustomer.setReportDate(LocalDateTime.now());
|
|
75
|
+ taRecommendCustomer.setOrgId(customer.getOrgId());
|
|
76
|
+ taRecommendCustomer.setPersonId(customer.getPersonId());
|
|
77
|
+ taRecommendCustomer.setEntryType(CommConstant.ENTRY_CHANNEL_VERIFY);
|
|
78
|
+ taRecommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
|
|
79
|
+ taRecommendCustomerMapper.insert(taRecommendCustomer);
|
61
|
80
|
return ResponseBean.success("审核成功");
|
62
|
81
|
}
|
63
|
82
|
|
64
|
|
- if (StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant()) &&
|
65
|
|
- (StringUtils.isEmpty(taRecommendCustomer.getRecommendPerson()) || taRecommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
|
|
83
|
+ if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
|
|
84
|
+ (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
|
66
|
85
|
// 审核通过
|
67
|
86
|
customer.setStatus("2");
|
68
|
87
|
channelCustomerMapper.updateById(customer);
|
|
@@ -71,4 +90,70 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
71
|
90
|
|
72
|
91
|
return ResponseBean.error("此客户是私客或已被报备", ResponseBean.ERROR_UNAVAILABLE);
|
73
|
92
|
}
|
|
93
|
+
|
|
94
|
+ /**
|
|
95
|
+ * 驻场确认到访
|
|
96
|
+ *
|
|
97
|
+ * @param id
|
|
98
|
+ * @param params
|
|
99
|
+ * @return
|
|
100
|
+ */
|
|
101
|
+ @Override
|
|
102
|
+ public ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params) {
|
|
103
|
+ // 渠道推荐的客户
|
|
104
|
+ if ("channel".equals(params.getType())) {
|
|
105
|
+ ChannelCustomer customer = channelCustomerMapper.selectById(params.getId());
|
|
106
|
+ // 审核通过 先查看在ta_recommend_customer 手机号是否存在
|
|
107
|
+ LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
|
108
|
+ queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());
|
|
109
|
+ queryWrapper.eq(TaRecommendCustomer::getBuildingId,customer.getBuildingId());
|
|
110
|
+ TaRecommendCustomer recommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
|
|
111
|
+ if (null == recommendCustomer) {
|
|
112
|
+ // 审核通过
|
|
113
|
+ customer.setStatus("2");
|
|
114
|
+ channelCustomerMapper.updateById(customer);
|
|
115
|
+ // 进业务客户表
|
|
116
|
+ TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
|
|
117
|
+ taRecommendCustomer.setName(customer.getName());
|
|
118
|
+ taRecommendCustomer.setPicture(customer.getPicture());
|
|
119
|
+ taRecommendCustomer.setPhone(customer.getPhone());
|
|
120
|
+ taRecommendCustomer.setSex(customer.getSex());
|
|
121
|
+ taRecommendCustomer.setRecommendPerson(customer.getRecommendPerson());
|
|
122
|
+ taRecommendCustomer.setBuildingId(customer.getBuildingId());
|
|
123
|
+ taRecommendCustomer.setReportRecommendStatus(CommConstant.RECOMMENDED);
|
|
124
|
+ taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
|
|
125
|
+ taRecommendCustomer.setCreateDate(LocalDateTime.now());
|
|
126
|
+ taRecommendCustomer.setReportDate(LocalDateTime.now());
|
|
127
|
+ taRecommendCustomer.setOrgId(customer.getOrgId());
|
|
128
|
+ taRecommendCustomer.setPersonId(customer.getPersonId());
|
|
129
|
+ taRecommendCustomer.setEntryType(CommConstant.ENTRY_CHANNEL_VERIFY);
|
|
130
|
+ taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
|
|
131
|
+ taRecommendCustomerMapper.insert(taRecommendCustomer);
|
|
132
|
+ return ResponseBean.success("审核成功");
|
|
133
|
+ }
|
|
134
|
+
|
|
135
|
+ if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
|
|
136
|
+ (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
|
|
137
|
+ // 审核通过
|
|
138
|
+ customer.setStatus("2");
|
|
139
|
+ channelCustomerMapper.updateById(customer);
|
|
140
|
+
|
|
141
|
+ // 修改状态为确认到访状态
|
|
142
|
+ recommendCustomer.setRecommendPerson(customer.getRecommendPerson());
|
|
143
|
+ recommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
|
|
144
|
+ recommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
|
|
145
|
+ taRecommendCustomerMapper.updateById(recommendCustomer);
|
|
146
|
+ return ResponseBean.success("审核成功");
|
|
147
|
+ }
|
|
148
|
+ }else if ("customer".equals(params.getType())) {
|
|
149
|
+ // 置业顾问 经纪人推荐的客户
|
|
150
|
+ TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getId());
|
|
151
|
+ taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
|
|
152
|
+ taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
|
|
153
|
+ taRecommendCustomerMapper.updateById(taRecommendCustomer);
|
|
154
|
+ return ResponseBean.success("审核成功");
|
|
155
|
+ }
|
|
156
|
+
|
|
157
|
+ return ResponseBean.error("此客户是私客或已被报备", ResponseBean.ERROR_UNAVAILABLE);
|
|
158
|
+ }
|
74
|
159
|
}
|