傅行帆 3 年 前
コミット
c621b0736d

+ 4
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java ファイルの表示

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

+ 6
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/ChannelCustomerDTO.java ファイルの表示

@@ -1,6 +1,7 @@
1 1
 package com.yunzhi.marketing.xlk.dto;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.TableName;
4
+import com.yunzhi.marketing.xlk.entity.CustomerVisit;
4 5
 import lombok.Data;
5 6
 import lombok.EqualsAndHashCode;
6 7
 import lombok.experimental.Accessors;
@@ -37,4 +38,9 @@ public class ChannelCustomerDTO implements Serializable {
37 38
      */
38 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 ファイルの表示

@@ -62,6 +62,11 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
62 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 70
         // 审核通过 先查看在ta_recommend_customer 手机号是否存在
66 71
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
67 72
         queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());