傅行帆 3 years ago
parent
commit
c621b0736d

+ 4
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java View File

6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.yunzhi.marketing.base.BaseController;
7
 import com.yunzhi.marketing.base.BaseController;
8
 import com.yunzhi.marketing.base.ResponseBean;
8
 import com.yunzhi.marketing.base.ResponseBean;
9
+import com.yunzhi.marketing.common.StringUtils;
9
 import com.yunzhi.marketing.entity.TaPerson;
10
 import com.yunzhi.marketing.entity.TaPerson;
10
 import com.yunzhi.marketing.service.ITaPersonService;
11
 import com.yunzhi.marketing.service.ITaPersonService;
11
 import com.yunzhi.marketing.service.ITaRecommendCustomerService;
12
 import com.yunzhi.marketing.service.ITaRecommendCustomerService;
175
         ResponseBean responseBean = new ResponseBean();
176
         ResponseBean responseBean = new ResponseBean();
176
         try {
177
         try {
177
             ChannelCustomer channelCustomer = iChannelCustomerService.getById(id);
178
             ChannelCustomer channelCustomer = iChannelCustomerService.getById(id);
179
+            if (StringUtils.isEmpty(channelCustomer.getCustomerId())){
180
+                return ResponseBean.success(channelCustomer);
181
+            }
178
             responseBean.addSuccess(taRecommendCustomerService.getCustDetail(channelCustomer.getCustomerId()));
182
             responseBean.addSuccess(taRecommendCustomerService.getCustDetail(channelCustomer.getCustomerId()));
179
         }catch (Exception e){
183
         }catch (Exception e){
180
             e.printStackTrace();
184
             e.printStackTrace();

+ 6
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/ChannelCustomerDTO.java View File

1
 package com.yunzhi.marketing.xlk.dto;
1
 package com.yunzhi.marketing.xlk.dto;
2
 
2
 
3
 import com.baomidou.mybatisplus.annotation.TableName;
3
 import com.baomidou.mybatisplus.annotation.TableName;
4
+import com.yunzhi.marketing.xlk.entity.CustomerVisit;
4
 import lombok.Data;
5
 import lombok.Data;
5
 import lombok.EqualsAndHashCode;
6
 import lombok.EqualsAndHashCode;
6
 import lombok.experimental.Accessors;
7
 import lombok.experimental.Accessors;
37
      */
38
      */
38
     private String realtyConsultant;
39
     private String realtyConsultant;
39
 
40
 
41
+    /**
42
+     * 到访
43
+     */
44
+    private CustomerVisit customerVisit;
45
+
40
 }
46
 }

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java View File

62
             return ResponseBean.success("审核成功");
62
             return ResponseBean.success("审核成功");
63
         }
63
         }
64
 
64
 
65
+        // 保存到访单
66
+        CustomerVisit customerVisit = channelCustomerDTO.getCustomerVisit();
67
+        customerVisit.setCreateDate(LocalDateTime.now());
68
+        customerVisitMapper.insert(customerVisit);
69
+
65
         // 审核通过 先查看在ta_recommend_customer 手机号是否存在
70
         // 审核通过 先查看在ta_recommend_customer 手机号是否存在
66
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
71
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
67
         queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());
72
         queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());