|
@@ -7,16 +7,23 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
7
|
7
|
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
|
+import com.yunzhi.marketing.common.StringUtils;
|
|
11
|
+import com.yunzhi.marketing.entity.TaChannel;
|
|
12
|
+import com.yunzhi.marketing.entity.TaChannelPerson;
|
10
|
13
|
import com.yunzhi.marketing.entity.TaPerson;
|
11
|
14
|
import com.yunzhi.marketing.entity.TaRecommendCustomer;
|
12
|
15
|
import com.yunzhi.marketing.service.ITaPersonService;
|
13
|
16
|
import com.yunzhi.marketing.service.ITaRecommendCustomerService;
|
|
17
|
+import com.yunzhi.marketing.service.TaChannelPersonService;
|
|
18
|
+import com.yunzhi.marketing.service.TaChannelService;
|
14
|
19
|
import com.yunzhi.marketing.xlk.entity.CustomerInfo;
|
15
|
20
|
import com.yunzhi.marketing.xlk.entity.CustomerInfoModifyRecord;
|
16
|
21
|
import com.yunzhi.marketing.xlk.service.ICustomerInfoModifyRecordService;
|
17
|
22
|
import com.yunzhi.marketing.xlk.service.ICustomerInfoService;
|
|
23
|
+import com.yunzhi.marketing.xlk.vo.CustomerInfoVO;
|
18
|
24
|
import io.swagger.annotations.Api;
|
19
|
25
|
import io.swagger.annotations.ApiOperation;
|
|
26
|
+import lombok.Data;
|
20
|
27
|
import org.slf4j.Logger;
|
21
|
28
|
import org.slf4j.LoggerFactory;
|
22
|
29
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -53,6 +60,12 @@ public class CustomerInfoController extends BaseController {
|
53
|
60
|
@Autowired
|
54
|
61
|
public ITaRecommendCustomerService iTaRecommendCustomerService;
|
55
|
62
|
|
|
63
|
+ @Autowired
|
|
64
|
+ private TaChannelPersonService taChannelPersonService;
|
|
65
|
+
|
|
66
|
+ @Autowired
|
|
67
|
+ private TaChannelService taChannelService;
|
|
68
|
+
|
56
|
69
|
/**
|
57
|
70
|
* 分页查询列表
|
58
|
71
|
* @param pageNum
|
|
@@ -229,4 +242,50 @@ public class CustomerInfoController extends BaseController {
|
229
|
242
|
}
|
230
|
243
|
return responseBean;
|
231
|
244
|
}
|
|
245
|
+
|
|
246
|
+ /**
|
|
247
|
+ * 根据id查询对象
|
|
248
|
+ * @param
|
|
249
|
+ */
|
|
250
|
+ @ApiOperation(value = "admin-查询客户信息", notes = "admin-查询客户信息")
|
|
251
|
+ @RequestMapping(value="/admin/customerInfo/{customerId}",method= RequestMethod.GET)
|
|
252
|
+ public ResponseBean customerInfoPc(@PathVariable String customerId, @RequestHeader("authorization") String token){
|
|
253
|
+ ResponseBean responseBean = new ResponseBean();
|
|
254
|
+ CustomerInfoVO customerInfoVO = new CustomerInfoVO();
|
|
255
|
+ try {
|
|
256
|
+ LambdaQueryWrapper<CustomerInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
257
|
+ lambdaQueryWrapper.eq(CustomerInfo::getCustomerId,customerId);
|
|
258
|
+
|
|
259
|
+ CustomerInfo customerInfo = iCustomerInfoService.getOne(lambdaQueryWrapper);
|
|
260
|
+
|
|
261
|
+ TaRecommendCustomer customer = iTaRecommendCustomerService.getById(customerId);
|
|
262
|
+ if (null == customerInfo && null == customer) {
|
|
263
|
+ return ResponseBean.error("请求客户不存在", ResponseBean.ERROR_UNAVAILABLE);
|
|
264
|
+ }
|
|
265
|
+ // 查看置业顾问信息
|
|
266
|
+ if (!StringUtils.isEmpty(customer.getRealtyConsultant())) {
|
|
267
|
+ TaPerson realtyPerson = taPersonService.getById(customer.getRealtyConsultant());
|
|
268
|
+ customerInfoVO.setRealtyConsultantPerson(realtyPerson);
|
|
269
|
+ }
|
|
270
|
+
|
|
271
|
+ // 获取渠道名字
|
|
272
|
+ LambdaQueryWrapper<TaChannelPerson> channelPersonLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
273
|
+ channelPersonLambdaQueryWrapper.eq(TaChannelPerson::getPersonId,customer.getPersonId());
|
|
274
|
+ TaChannelPerson taChannelPerson = taChannelPersonService.getOne(channelPersonLambdaQueryWrapper);
|
|
275
|
+ if (null != taChannelPerson) {
|
|
276
|
+ TaChannel taChannel = taChannelService.getById(taChannelPerson.getChannelId());
|
|
277
|
+ customerInfoVO.setChannelName(taChannel.getChannelName());
|
|
278
|
+ }
|
|
279
|
+
|
|
280
|
+ customerInfoVO.setTaRecommendCustomer(customer);
|
|
281
|
+ customerInfoVO.setCustomerInfo(customerInfo);
|
|
282
|
+ iCustomerInfoService.getOtherInfo(customerInfoVO);
|
|
283
|
+ responseBean.addSuccess(customerInfoVO);
|
|
284
|
+ }catch (Exception e){
|
|
285
|
+ e.printStackTrace();
|
|
286
|
+ logger.error("customerInfoDelete -=- {}",e.toString());
|
|
287
|
+ responseBean.addError(e.getMessage());
|
|
288
|
+ }
|
|
289
|
+ return responseBean;
|
|
290
|
+ }
|
232
|
291
|
}
|