浏览代码

Merge branch 'develop' of http://git.ycjcjy.com/marketing/services into develop

Your Name 3 年前
父节点
当前提交
2550dcd22e

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

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
             // 签约状态
712
             // 签约状态
713
             LambdaQueryWrapper<CustomerSignatory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
713
             LambdaQueryWrapper<CustomerSignatory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
714
             lambdaQueryWrapper.eq(CustomerSignatory::getCustomerId,taRecommendCustomer.getCustomerId());
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
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
719
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();

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

219
             queryWrapper.orderByDesc("create_date");
219
             queryWrapper.orderByDesc("create_date");
220
             
220
             
221
             IPage<TaCustomerFollowUpRecord> result = iTaCustomerFollowUpRecordService.page(pg, queryWrapper);
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
             responseBean.addSuccess(result);
229
             responseBean.addSuccess(result);
223
         }catch (Exception e){
230
         }catch (Exception e){
224
             e.printStackTrace();
231
             e.printStackTrace();

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

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