傅行帆 3 years ago
parent
commit
e4e92ecae3

+ 2
- 0
src/main/java/com/yunzhi/marketing/dto/ChannelReportDTO.java View File

38
      * 性别
38
      * 性别
39
      */
39
      */
40
     private Integer sex;
40
     private Integer sex;
41
+
42
+    private String remark;
41
 }
43
 }

+ 1
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java View File

432
         channelCustomer.setStatus("1");
432
         channelCustomer.setStatus("1");
433
         channelCustomer.setChannelId(taChannelPeople.getChannelId());
433
         channelCustomer.setChannelId(taChannelPeople.getChannelId());
434
         channelCustomer.setOrgId(channelReportDTO.getOrgId());
434
         channelCustomer.setOrgId(channelReportDTO.getOrgId());
435
+        channelCustomer.setRemark(channelReportDTO.getRemark());
435
         channelCustomerMapper.insert(channelCustomer);
436
         channelCustomerMapper.insert(channelCustomer);
436
         return ResponseBean.success(channelCustomer);
437
         return ResponseBean.success(channelCustomer);
437
     }
438
     }

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

179
             if (StringUtils.isEmpty(channelCustomer.getCustomerId())){
179
             if (StringUtils.isEmpty(channelCustomer.getCustomerId())){
180
                 return ResponseBean.success(channelCustomer);
180
                 return ResponseBean.success(channelCustomer);
181
             }
181
             }
182
-            responseBean.addSuccess(taRecommendCustomerService.getCustDetail(channelCustomer.getCustomerId()));
182
+            responseBean = taRecommendCustomerService.getCustDetail(channelCustomer.getCustomerId());
183
         }catch (Exception e){
183
         }catch (Exception e){
184
             e.printStackTrace();
184
             e.printStackTrace();
185
             logger.error("channelCustomerDelete -=- {}",e.toString());
185
             logger.error("channelCustomerDelete -=- {}",e.toString());

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerPreparatory.java View File

1
 package com.yunzhi.marketing.xlk.entity;
1
 package com.yunzhi.marketing.xlk.entity;
2
 
2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3
 import com.baomidou.mybatisplus.annotation.TableName;
5
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import lombok.Data;
6
 import lombok.Data;
5
 import lombok.EqualsAndHashCode;
7
 import lombok.EqualsAndHashCode;
27
     /**
29
     /**
28
      * 客户认筹id
30
      * 客户认筹id
29
      */
31
      */
32
+    @TableId(type = IdType.UUID)
30
     private String customerPreparatoryId;
33
     private String customerPreparatoryId;
31
 
34
 
32
     /**
35
     /**

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerSignatory.java View File

1
 package com.yunzhi.marketing.xlk.entity;
1
 package com.yunzhi.marketing.xlk.entity;
2
 
2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3
 import com.baomidou.mybatisplus.annotation.TableName;
5
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import lombok.Data;
6
 import lombok.Data;
5
 import lombok.EqualsAndHashCode;
7
 import lombok.EqualsAndHashCode;
27
     /**
29
     /**
28
      * 主键
30
      * 主键
29
      */
31
      */
32
+    @TableId(type = IdType.UUID)
30
     private String customerSignatoryId;
33
     private String customerSignatoryId;
31
 
34
 
32
     /**
35
     /**

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerVisit.java View File

1
 package com.yunzhi.marketing.xlk.entity;
1
 package com.yunzhi.marketing.xlk.entity;
2
 
2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3
 import com.baomidou.mybatisplus.annotation.TableName;
5
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import lombok.Data;
6
 import lombok.Data;
5
 import lombok.EqualsAndHashCode;
7
 import lombok.EqualsAndHashCode;
27
     /**
29
     /**
28
      * 客户到访id
30
      * 客户到访id
29
      */
31
      */
32
+    @TableId(type = IdType.UUID)
30
     private String customerVisitId;
33
     private String customerVisitId;
31
 
34
 
32
     /**
35
     /**

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

7
 import com.yunzhi.marketing.base.ResponseBean;
7
 import com.yunzhi.marketing.base.ResponseBean;
8
 import com.yunzhi.marketing.common.CommConstant;
8
 import com.yunzhi.marketing.common.CommConstant;
9
 import com.yunzhi.marketing.common.StringUtils;
9
 import com.yunzhi.marketing.common.StringUtils;
10
+import com.yunzhi.marketing.entity.TaPerson;
10
 import com.yunzhi.marketing.entity.TaRecommendCustomer;
11
 import com.yunzhi.marketing.entity.TaRecommendCustomer;
12
+import com.yunzhi.marketing.mapper.TaPersonMapper;
11
 import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
13
 import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
12
 import com.yunzhi.marketing.po.MineRecommendCustomerPO;
14
 import com.yunzhi.marketing.po.MineRecommendCustomerPO;
13
 import com.yunzhi.marketing.po.TaRecommendCustomerPO;
15
 import com.yunzhi.marketing.po.TaRecommendCustomerPO;
45
 
47
 
46
     @Autowired
48
     @Autowired
47
     private CustomerSignatoryMapper customerSignatoryMapper;
49
     private CustomerSignatoryMapper customerSignatoryMapper;
50
+
51
+    @Autowired
52
+    private TaPersonMapper taPersonMapper;
48
     /**
53
     /**
49
      * 审核
54
      * 审核
50
      *
55
      *
64
 
69
 
65
         // 保存到访单
70
         // 保存到访单
66
         CustomerVisit customerVisit = channelCustomerDTO.getCustomerVisit();
71
         CustomerVisit customerVisit = channelCustomerDTO.getCustomerVisit();
67
-        customerVisit.setCreateDate(LocalDateTime.now());
68
-        customerVisitMapper.insert(customerVisit);
72
+        customerVisit.setBuildingId(customer.getBuildingId());
73
+        customerVisit.setName(customer.getName());
74
+        customerVisit.setRecommendPerson(customer.getRecommendPerson());
75
+        TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
76
+        if (null != recommendPerson) {
77
+            customerVisit.setRealtyConsultantName(recommendPerson.getName());
78
+        }
79
+        customerVisit.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
80
+        TaPerson channelPerson = taPersonMapper.getById(channelCustomerDTO.getRealtyConsultant());
81
+        if (null != channelPerson) {
82
+            customerVisit.setRealtyConsultantName(channelPerson.getName());
83
+        }
84
+        customerVisit.setOrgId(customer.getOrgId());
69
 
85
 
70
         // 审核通过 先查看在ta_recommend_customer 手机号是否存在
86
         // 审核通过 先查看在ta_recommend_customer 手机号是否存在
71
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
87
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
95
             // 审核通过
111
             // 审核通过
96
             customer.setStatus("2");
112
             customer.setStatus("2");
97
             customer.setCustomerId(taRecommendCustomer.getCustomerId());
113
             customer.setCustomerId(taRecommendCustomer.getCustomerId());
114
+            customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
98
             customer.setVisitDate(LocalDateTime.now());
115
             customer.setVisitDate(LocalDateTime.now());
99
             channelCustomerMapper.updateById(customer);
116
             channelCustomerMapper.updateById(customer);
100
-            return ResponseBean.success("审核成功");
101
-        }
102
-
103
-        if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
117
+        }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
104
                 (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
118
                 (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
105
             // 审核通过
119
             // 审核通过
106
             customer.setStatus("2");
120
             customer.setStatus("2");
107
             customer.setCustomerId(recommendCustomer.getCustomerId());
121
             customer.setCustomerId(recommendCustomer.getCustomerId());
122
+            customerVisit.setCustomerId(recommendCustomer.getCustomerId());
108
             customer.setVisitDate(LocalDateTime.now());
123
             customer.setVisitDate(LocalDateTime.now());
124
+            customer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
109
             channelCustomerMapper.updateById(customer);
125
             channelCustomerMapper.updateById(customer);
110
-            return ResponseBean.success("审核成功");
126
+        }else {
127
+            return ResponseBean.error("此客户是私客或已被报备", ResponseBean.ERROR_UNAVAILABLE);
111
         }
128
         }
112
 
129
 
113
-        return ResponseBean.error("此客户是私客或已被报备", ResponseBean.ERROR_UNAVAILABLE);
130
+
131
+        customerVisit.setCreateDate(LocalDateTime.now());
132
+        customerVisitMapper.insert(customerVisit);
133
+
134
+        return ResponseBean.success("审核成功");
114
     }
135
     }
115
 
136
 
116
     /**
137
     /**
122
      */
143
      */
123
     @Override
144
     @Override
124
     public ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params) {
145
     public ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params) {
146
+        CustomerVisit customerVisit = params.getCustomerVisit();
125
         // 渠道推荐的客户
147
         // 渠道推荐的客户
126
         if ("report".equals(params.getType())) {
148
         if ("report".equals(params.getType())) {
127
             ChannelCustomer customer = channelCustomerMapper.selectById(params.getId());
149
             ChannelCustomer customer = channelCustomerMapper.selectById(params.getId());
150
+
151
+            customerVisit.setBuildingId(customer.getBuildingId());
152
+            customerVisit.setName(customer.getName());
153
+            customerVisit.setRecommendPerson(customer.getRecommendPerson());
154
+            TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
155
+            if (null != recommendPerson) {
156
+                customerVisit.setRealtyConsultantName(recommendPerson.getName());
157
+            }
158
+            customerVisit.setRealtyConsultant(params.getRealtyConsultant());
159
+            TaPerson channelPerson = taPersonMapper.getById(params.getRealtyConsultant());
160
+            if (null != channelPerson) {
161
+                customerVisit.setRealtyConsultantName(channelPerson.getName());
162
+            }
163
+            customerVisit.setOrgId(customer.getOrgId());
164
+
128
             // 审核通过 先查看在ta_recommend_customer 手机号是否存在
165
             // 审核通过 先查看在ta_recommend_customer 手机号是否存在
129
             LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
166
             LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
130
             queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());
167
             queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());
155
                 customer.setStatus("2");
192
                 customer.setStatus("2");
156
                 customer.setVisitDate(LocalDateTime.now());
193
                 customer.setVisitDate(LocalDateTime.now());
157
                 customer.setCustomerId(taRecommendCustomer.getCustomerId());
194
                 customer.setCustomerId(taRecommendCustomer.getCustomerId());
195
+                customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
158
                 channelCustomerMapper.updateById(customer);
196
                 channelCustomerMapper.updateById(customer);
159
             }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
197
             }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
160
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
198
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
162
                 customer.setStatus("2");
200
                 customer.setStatus("2");
163
                 customer.setVisitDate(LocalDateTime.now());
201
                 customer.setVisitDate(LocalDateTime.now());
164
                 customer.setCustomerId(recommendCustomer.getCustomerId());
202
                 customer.setCustomerId(recommendCustomer.getCustomerId());
203
+                customerVisit.setCustomerId(recommendCustomer.getCustomerId());
165
                 channelCustomerMapper.updateById(customer);
204
                 channelCustomerMapper.updateById(customer);
166
 
205
 
167
                 // 修改状态为确认到访状态
206
                 // 修改状态为确认到访状态
178
             taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
217
             taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
179
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
218
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
180
             taRecommendCustomer.setCirculationTime(LocalDateTime.now());
219
             taRecommendCustomer.setCirculationTime(LocalDateTime.now());
220
+            customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
181
             taRecommendCustomerMapper.updateById(taRecommendCustomer);
221
             taRecommendCustomerMapper.updateById(taRecommendCustomer);
182
         }else {
222
         }else {
183
             return ResponseBean.error("请输入正确的类型参数", ResponseBean.ERROR_UNAVAILABLE);
223
             return ResponseBean.error("请输入正确的类型参数", ResponseBean.ERROR_UNAVAILABLE);
184
         }
224
         }
185
 
225
 
186
         // 保存到访单
226
         // 保存到访单
187
-        CustomerVisit customerVisit = params.getCustomerVisit();
188
         customerVisit.setCreateDate(LocalDateTime.now());
227
         customerVisit.setCreateDate(LocalDateTime.now());
189
         customerVisitMapper.insert(customerVisit);
228
         customerVisitMapper.insert(customerVisit);
190
 
229