傅行帆 3 年之前
父節點
當前提交
f86924ee37

+ 1
- 1
src/main/java/com/yunzhi/marketing/po/TaRecommendCustomerVO.java 查看文件

@@ -246,7 +246,7 @@ public class TaRecommendCustomerVO implements Serializable {
246 246
     /**
247 247
      * 签约
248 248
      */
249
-    private CustomerSignatory customerSignatory;
249
+    private List<CustomerSignatory> customerSignatory;
250 250
 
251 251
     /**
252 252
      * 认筹

+ 2
- 2
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

@@ -712,8 +712,8 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
712 712
             // 签约状态
713 713
             LambdaQueryWrapper<CustomerSignatory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
714 714
             lambdaQueryWrapper.eq(CustomerSignatory::getCustomerId,taRecommendCustomer.getCustomerId());
715
-            CustomerSignatory customerSignatory = customerSignatoryMapper.selectOne(lambdaQueryWrapper);
716
-            taRecommendCustomerVO.setCustomerSignatory(customerSignatory);
715
+            List<CustomerSignatory> customerSignatories = customerSignatoryMapper.selectList(lambdaQueryWrapper);
716
+            taRecommendCustomerVO.setCustomerSignatory(customerSignatories);
717 717
         }
718 718
 
719 719
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();

+ 7
- 0
src/main/java/com/yunzhi/marketing/statistic/controller/TaCustomerFollowUpRecordController.java 查看文件

@@ -219,6 +219,13 @@ public class TaCustomerFollowUpRecordController extends BaseController {
219 219
             queryWrapper.orderByDesc("create_date");
220 220
             
221 221
             IPage<TaCustomerFollowUpRecord> result = iTaCustomerFollowUpRecordService.page(pg, queryWrapper);
222
+            List<TaCustomerFollowUpRecord> records = result.getRecords();
223
+            records.forEach(e -> {
224
+                TaPerson taPerson = taPersonService.getById(e.getFollowerId());
225
+                if (null != taPerson) {
226
+                    e.setFollowerName(taPerson.getName());
227
+                }
228
+            });
222 229
             responseBean.addSuccess(result);
223 230
         }catch (Exception e){
224 231
             e.printStackTrace();

+ 7
- 0
src/main/java/com/yunzhi/marketing/statistic/entity/TaCustomerFollowUpRecord.java 查看文件

@@ -1,6 +1,7 @@
1 1
 package com.yunzhi.marketing.statistic.entity;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import lombok.Data;
6 7
 import lombok.EqualsAndHashCode;
@@ -59,6 +60,12 @@ public class TaCustomerFollowUpRecord implements Serializable {
59 60
      * 跟进人ID
60 61
      */
61 62
     private String followerId;
63
+
64
+    /**
65
+     * 跟进人姓名
66
+     */
67
+    @TableField(exist = false)
68
+    private String followerName;
62 69
     
63 70
     /**
64 71
      * 客户性别

+ 13
- 5
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java 查看文件

@@ -70,7 +70,6 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
70 70
         // 保存到访单
71 71
         CustomerVisit customerVisit = channelCustomerDTO.getCustomerVisit();
72 72
         customerVisit.setBuildingId(customer.getBuildingId());
73
-        customerVisit.setName(customer.getName());
74 73
         customerVisit.setRecommendPerson(customer.getRecommendPerson());
75 74
         TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
76 75
         if (null != recommendPerson) {
@@ -91,7 +90,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
91 90
         if (null == recommendCustomer) {
92 91
             // 进业务客户表
93 92
             TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
94
-            taRecommendCustomer.setName(customer.getName());
93
+            taRecommendCustomer.setName(customerVisit.getName());
95 94
             taRecommendCustomer.setPicture(customer.getPicture());
96 95
             taRecommendCustomer.setPhone(customer.getPhone());
97 96
             taRecommendCustomer.setSex(customer.getSex());
@@ -113,6 +112,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
113 112
             customer.setCustomerId(taRecommendCustomer.getCustomerId());
114 113
             customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
115 114
             customer.setVisitDate(LocalDateTime.now());
115
+            customer.setName(customerVisit.getName());
116 116
             channelCustomerMapper.updateById(customer);
117 117
         }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
118 118
                 (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
@@ -122,6 +122,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
122 122
             customerVisit.setCustomerId(recommendCustomer.getCustomerId());
123 123
             customer.setVisitDate(LocalDateTime.now());
124 124
             customer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
125
+            customer.setName(customerVisit.getName());
125 126
             channelCustomerMapper.updateById(customer);
126 127
             // 修改状态为确认到访状态
127 128
             recommendCustomer.setRecommendPerson(customer.getRecommendPerson());
@@ -156,7 +157,6 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
156 157
             ChannelCustomer customer = channelCustomerMapper.selectById(params.getId());
157 158
 
158 159
             customerVisit.setBuildingId(customer.getBuildingId());
159
-            customerVisit.setName(customer.getName());
160 160
             customerVisit.setRecommendPerson(customer.getRecommendPerson());
161 161
             TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
162 162
             if (null != recommendPerson) {
@@ -177,7 +177,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
177 177
             if (null == recommendCustomer) {
178 178
                 // 进业务客户表
179 179
                 TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
180
-                taRecommendCustomer.setName(customer.getName());
180
+                taRecommendCustomer.setName(customerVisit.getName());
181 181
                 taRecommendCustomer.setPicture(customer.getPicture());
182 182
                 taRecommendCustomer.setPhone(customer.getPhone());
183 183
                 taRecommendCustomer.setSex(customer.getSex());
@@ -200,6 +200,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
200 200
                 customer.setVisitDate(LocalDateTime.now());
201 201
                 customer.setCustomerId(taRecommendCustomer.getCustomerId());
202 202
                 customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
203
+                customer.setName(customerVisit.getName());
203 204
                 channelCustomerMapper.updateById(customer);
204 205
             }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
205 206
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
@@ -208,6 +209,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
208 209
                 customer.setVisitDate(LocalDateTime.now());
209 210
                 customer.setCustomerId(recommendCustomer.getCustomerId());
210 211
                 customerVisit.setCustomerId(recommendCustomer.getCustomerId());
212
+                customer.setName(customerVisit.getName());
211 213
                 channelCustomerMapper.updateById(customer);
212 214
 
213 215
                 // 修改状态为确认到访状态
@@ -216,6 +218,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
216 218
                 recommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
217 219
                 recommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
218 220
                 recommendCustomer.setCirculationTime(LocalDateTime.now());
221
+                recommendCustomer.setName(customerVisit.getName());
219 222
                 taRecommendCustomerMapper.updateById(recommendCustomer);
220 223
             }
221 224
         }else if ("customer".equals(params.getType())) {
@@ -301,6 +304,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
301 304
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
302 305
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
303 306
         customer.setPreparatoryDate(LocalDateTime.now());
307
+        channelCustomerMapper.updateById(customer);
304 308
 
305 309
         CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
306 310
         customerPreparatory.setCreateDate(LocalDateTime.now());
@@ -324,6 +328,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
324 328
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
325 329
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
326 330
         customer.setCommissionDate(LocalDateTime.now());
331
+        channelCustomerMapper.updateById(customer);
327 332
 
328 333
         return ResponseBean.success("审核成功");
329 334
     }
@@ -336,16 +341,19 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
336 341
      */
337 342
     @Override
338 343
     public ResponseBean signatoryCustomer(MarkingSignatoryCustomerDTO params) {
344
+        CustomerSignatory customerSignatory = params.getCustomerSignatory();
339 345
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getCustomerId());
340 346
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_SIGNED);
347
+        taRecommendCustomer.setRealtyConsultant(customerSignatory.getRealtyConsultant());
341 348
         taRecommendCustomerMapper.updateById(taRecommendCustomer);
342 349
 
343 350
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
344 351
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
345 352
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
346 353
         customer.setSignedDate(LocalDateTime.now());
354
+        customer.setRealtyConsultant(customerSignatory.getRealtyConsultant());
355
+        channelCustomerMapper.updateById(customer);
347 356
 
348
-        CustomerSignatory customerSignatory = params.getCustomerSignatory();
349 357
         customerSignatory.setCreateDate(LocalDateTime.now());
350 358
         customerSignatoryMapper.insert(customerSignatory);
351 359
         return ResponseBean.success("审核成功");