|
@@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
8
|
8
|
import com.yunzhi.marketing.base.BaseController;
|
9
|
9
|
import com.yunzhi.marketing.base.ResponseBean;
|
10
|
10
|
import com.yunzhi.marketing.entity.TaPerson;
|
|
11
|
+import com.yunzhi.marketing.entity.TaRecommendCustomer;
|
11
|
12
|
import com.yunzhi.marketing.service.ITaPersonService;
|
|
13
|
+import com.yunzhi.marketing.service.ITaRecommendCustomerService;
|
12
|
14
|
import com.yunzhi.marketing.xlk.entity.CustomerInfo;
|
13
|
15
|
import com.yunzhi.marketing.xlk.entity.CustomerInfoModifyRecord;
|
14
|
16
|
import com.yunzhi.marketing.xlk.service.ICustomerInfoModifyRecordService;
|
|
@@ -48,6 +50,9 @@ public class CustomerInfoController extends BaseController {
|
48
|
50
|
@Autowired
|
49
|
51
|
public ITaPersonService taPersonService;
|
50
|
52
|
|
|
53
|
+ @Autowired
|
|
54
|
+ public ITaRecommendCustomerService iTaRecommendCustomerService;
|
|
55
|
+
|
51
|
56
|
/**
|
52
|
57
|
* 分页查询列表
|
53
|
58
|
* @param pageNum
|
|
@@ -202,7 +207,21 @@ public class CustomerInfoController extends BaseController {
|
202
|
207
|
try {
|
203
|
208
|
LambdaQueryWrapper<CustomerInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
204
|
209
|
lambdaQueryWrapper.eq(CustomerInfo::getCustomerId,customerId);
|
205
|
|
- responseBean.addSuccess(iCustomerInfoService.getOne(lambdaQueryWrapper));
|
|
210
|
+
|
|
211
|
+ CustomerInfo customerInfo = iCustomerInfoService.getOne(lambdaQueryWrapper);
|
|
212
|
+ if (null == customerInfo) {
|
|
213
|
+ customerInfo = new CustomerInfo();
|
|
214
|
+ TaRecommendCustomer customer = iTaRecommendCustomerService.getById(customerId);
|
|
215
|
+ if (null == customer) {
|
|
216
|
+ return ResponseBean.error("请求客户不存在", ResponseBean.ERROR_UNAVAILABLE);
|
|
217
|
+ }
|
|
218
|
+
|
|
219
|
+ customerInfo.setName(customer.getName());
|
|
220
|
+ customerInfo.setSex(customer.getSex());
|
|
221
|
+ customerInfo.setPhone(customer.getPhone());
|
|
222
|
+ }
|
|
223
|
+
|
|
224
|
+ responseBean.addSuccess(customerInfo);
|
206
|
225
|
}catch (Exception e){
|
207
|
226
|
e.printStackTrace();
|
208
|
227
|
logger.error("customerInfoDelete -=- {}",e.toString());
|