瀏覽代碼

客户报备调整

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

+ 19
- 0
src/main/java/com/yunzhi/marketing/controller/TaRecommendCustomerController.java 查看文件

13
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
13
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
14
 import com.yunzhi.marketing.common.CommConstant;
14
 import com.yunzhi.marketing.common.CommConstant;
15
 import com.yunzhi.marketing.common.StringUtils;
15
 import com.yunzhi.marketing.common.StringUtils;
16
+import com.yunzhi.marketing.dto.AverageReportDTO;
16
 import com.yunzhi.marketing.dto.ChannelReportDTO;
17
 import com.yunzhi.marketing.dto.ChannelReportDTO;
17
 import com.yunzhi.marketing.entity.TaBuilding;
18
 import com.yunzhi.marketing.entity.TaBuilding;
18
 import com.yunzhi.marketing.entity.TaPerson;
19
 import com.yunzhi.marketing.entity.TaPerson;
237
         return taRecommendCustomerService.channelReportCust(channelReportDTO);
238
         return taRecommendCustomerService.channelReportCust(channelReportDTO);
238
     }
239
     }
239
 
240
 
241
+    /**
242
+     * 普通客户报备客户
243
+     *
244
+     * @param averageReportDTO
245
+     * @param request
246
+     * @return
247
+     */
248
+    @PostMapping("/wx/average/report")
249
+    @ApiOperation(value = "wx-普通客户报备客户", notes = "森哥看这里-wx-普通客户报备客户")
250
+    public ResponseBean averageReportCust(@RequestBody AverageReportDTO averageReportDTO, HttpServletRequest request) throws Exception {
251
+        String personId = getPersonId(request);
252
+        Integer orgId = getOrgId(request);
253
+        averageReportDTO.setPersonId(personId);
254
+        averageReportDTO.setOrgId(orgId);
255
+        return taRecommendCustomerService.averageReportCust(averageReportDTO);
256
+    }
257
+
240
 
258
 
241
     /**
259
     /**
242
      * 置业顾问报备客户
260
      * 置业顾问报备客户
258
      * @param request
276
      * @param request
259
      * @return
277
      * @return
260
      */
278
      */
279
+    @ApiOperation(value = "wx-置业顾问手动报备客户", notes = "森哥看这里-wx-置业顾问手动报备客户")
261
     @PostMapping("/wx/customer/manualReport")
280
     @PostMapping("/wx/customer/manualReport")
262
     public ResponseBean manualReport(@RequestBody ChannelReportDTO reportCust, HttpServletRequest request) {
281
     public ResponseBean manualReport(@RequestBody ChannelReportDTO reportCust, HttpServletRequest request) {
263
         Integer orgId = getOrgId(request);
282
         Integer orgId = getOrgId(request);

+ 36
- 0
src/main/java/com/yunzhi/marketing/dto/AverageReportDTO.java 查看文件

1
+package com.yunzhi.marketing.dto;
2
+
3
+import lombok.Data;
4
+
5
+@Data
6
+public class AverageReportDTO {
7
+
8
+    private String personId;
9
+
10
+    private Integer orgId;
11
+
12
+    /**
13
+     * 电话号码
14
+     */
15
+    private String phone;
16
+
17
+    /**
18
+     * 姓名
19
+     */
20
+    private String name;
21
+
22
+    /**
23
+     * 图片
24
+     */
25
+    private String picture;
26
+
27
+    /**
28
+     * 楼盘id
29
+     */
30
+    private String buildingId;
31
+
32
+    /**
33
+     * 性别
34
+     */
35
+    private Integer sex;
36
+}

+ 8
- 0
src/main/java/com/yunzhi/marketing/service/ITaRecommendCustomerService.java 查看文件

4
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.baomidou.mybatisplus.extension.service.IService;
5
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.base.ResponseBean;
6
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
6
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
7
+import com.yunzhi.marketing.dto.AverageReportDTO;
7
 import com.yunzhi.marketing.dto.ChannelReportDTO;
8
 import com.yunzhi.marketing.dto.ChannelReportDTO;
8
 import com.yunzhi.marketing.excel.AgentsRecommendCustomer;
9
 import com.yunzhi.marketing.excel.AgentsRecommendCustomer;
9
 import com.yunzhi.marketing.excel.ExcelRecommendCustomer;
10
 import com.yunzhi.marketing.excel.ExcelRecommendCustomer;
209
     ResponseBean getMarkingCustList(String openid, String keywords, int pageNumber, int pageSize, String buildingId);
210
     ResponseBean getMarkingCustList(String openid, String keywords, int pageNumber, int pageSize, String buildingId);
210
 
211
 
211
     void manualReport(Integer orgId, TaPerson consultant, ChannelReportDTO reportCust) throws Exception;
212
     void manualReport(Integer orgId, TaPerson consultant, ChannelReportDTO reportCust) throws Exception;
213
+
214
+    /**
215
+     * 普通客户报备客户
216
+     * @param averageReportDTO
217
+     * @return
218
+     */
219
+    ResponseBean averageReportCust(AverageReportDTO averageReportDTO);
212
 }
220
 }

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

15
 import com.yunzhi.marketing.common.StringUtils;
15
 import com.yunzhi.marketing.common.StringUtils;
16
 import com.yunzhi.marketing.drainage.entity.TaDrainage;
16
 import com.yunzhi.marketing.drainage.entity.TaDrainage;
17
 import com.yunzhi.marketing.drainage.mapper.TaDrainageMapper;
17
 import com.yunzhi.marketing.drainage.mapper.TaDrainageMapper;
18
+import com.yunzhi.marketing.dto.AverageReportDTO;
18
 import com.yunzhi.marketing.dto.ChannelReportDTO;
19
 import com.yunzhi.marketing.dto.ChannelReportDTO;
19
 import com.yunzhi.marketing.excel.AgentsRecommendCustomer;
20
 import com.yunzhi.marketing.excel.AgentsRecommendCustomer;
20
 import com.yunzhi.marketing.excel.ExcelRecommendCustomer;
21
 import com.yunzhi.marketing.excel.ExcelRecommendCustomer;
560
         return;
561
         return;
561
     }
562
     }
562
 
563
 
564
+    /**
565
+     * 普通客户报备客户
566
+     *
567
+     * @param averageReportDTO
568
+     * @return
569
+     */
570
+    @Override
571
+    public ResponseBean averageReportCust(AverageReportDTO averageReportDTO) {
572
+
573
+
574
+        // 当前人员
575
+        TaPerson person = taPersonMapper.getById(averageReportDTO.getPersonId());
576
+
577
+        // 先查看在ta_recommend_customer 手机号是否存在
578
+        LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
579
+        queryWrapper.eq(TaRecommendCustomer::getPhone,averageReportDTO.getPhone());
580
+        queryWrapper.eq(TaRecommendCustomer::getBuildingId,averageReportDTO.getBuildingId());
581
+        queryWrapper.isNull(TaRecommendCustomer::getRecommendPerson);
582
+        List<TaRecommendCustomer> taRecommendCustomers = taRecommendCustomerMapper.selectList(queryWrapper);
583
+        if (taRecommendCustomers.size() > 0) {
584
+            return ResponseBean.error("已存在的客户报备失败", ResponseBean.ERROR_UNAVAILABLE);
585
+        }
586
+
587
+        // 查询是否在渠道推荐表中
588
+        LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
589
+        channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getBuildingId,averageReportDTO.getBuildingId());
590
+        channelCustomerLambdaQueryWrapper.ne(ChannelCustomer::getStatus,"3");
591
+        List<ChannelCustomer> channelCustomers = channelCustomerMapper.selectList(channelCustomerLambdaQueryWrapper);
592
+        List<ChannelCustomer> passCustomer = channelCustomers.stream().filter(e -> "2".equals(e.getStatus())).collect(Collectors.toList());
593
+        if (passCustomer.size() > 0) {
594
+            return ResponseBean.error("此用户已经被报备", ResponseBean.ERROR_UNAVAILABLE);
595
+        }
596
+
597
+        // 入渠道推荐客户表
598
+        ChannelCustomer channelCustomer = new ChannelCustomer();
599
+        channelCustomer.setBuildingId(averageReportDTO.getBuildingId());
600
+        channelCustomer.setName(averageReportDTO.getName());
601
+        channelCustomer.setPicture(averageReportDTO.getPicture());
602
+        channelCustomer.setPhone(averageReportDTO.getPhone());
603
+        channelCustomer.setSex(averageReportDTO.getSex());
604
+        channelCustomer.setRecommendPerson(averageReportDTO.getPersonId());
605
+        channelCustomer.setCreateDate(LocalDateTime.now());
606
+        channelCustomer.setStatus("1");
607
+        channelCustomer.setOrgId(averageReportDTO.getOrgId());
608
+        channelCustomerMapper.insert(channelCustomer);
609
+        return ResponseBean.success(channelCustomer);
610
+    }
611
+
563
     private void fillSomeFieldsOfCustomer(TaRecommendCustomer customer, TaPerson recommender, LocalDateTime now) {
612
     private void fillSomeFieldsOfCustomer(TaRecommendCustomer customer, TaPerson recommender, LocalDateTime now) {
564
         customer.setVerifyStatus(CommConstant.VERIFY_AGREE);
613
         customer.setVerifyStatus(CommConstant.VERIFY_AGREE);
565
         customer.setStatus(CommConstant.CUSTOMER_REPORT);
614
         customer.setStatus(CommConstant.CUSTOMER_REPORT);
705
         taRecommendCustomer.setBuildingId(params.getString("intention"));
754
         taRecommendCustomer.setBuildingId(params.getString("intention"));
706
         taRecommendCustomer.setRealtyConsultant(params.getString("realtyConsultant"));
755
         taRecommendCustomer.setRealtyConsultant(params.getString("realtyConsultant"));
707
         taRecommendCustomer.setReportRecommendStatus(CommConstant.RECOMMENDED);
756
         taRecommendCustomer.setReportRecommendStatus(CommConstant.RECOMMENDED);
708
-        taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
757
+        taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_READY);
709
         taRecommendCustomer.setCreateDate(LocalDateTime.now());
758
         taRecommendCustomer.setCreateDate(LocalDateTime.now());
710
         taRecommendCustomer.setReportDate(LocalDateTime.now());
759
         taRecommendCustomer.setReportDate(LocalDateTime.now());
711
         taRecommendCustomer.setOrgId(orgId);
760
         taRecommendCustomer.setOrgId(orgId);

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/ChannelCustomerDTO.java 查看文件

32
      */
32
      */
33
     private String auditResult;
33
     private String auditResult;
34
 
34
 
35
+    /**
36
+     * 置业顾问
37
+     */
38
+    private String realtyConsultant;
39
+
35
 }
40
 }

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/MarkingChannelCustomerDTO.java 查看文件

27
      */
27
      */
28
    private String type;
28
    private String type;
29
 
29
 
30
+    /**
31
+     * 置业顾问personiD
32
+     */
33
+   private String realtyConsultant;
34
+
30
 }
35
 }

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

77
             taRecommendCustomer.setPersonId(customer.getPersonId());
77
             taRecommendCustomer.setPersonId(customer.getPersonId());
78
             taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
78
             taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
79
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
79
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
80
+            taRecommendCustomer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
80
             taRecommendCustomerMapper.insert(taRecommendCustomer);
81
             taRecommendCustomerMapper.insert(taRecommendCustomer);
81
             return ResponseBean.success("审核成功");
82
             return ResponseBean.success("审核成功");
82
         }
83
         }
95
     /**
96
     /**
96
      * 驻场确认到访
97
      * 驻场确认到访
97
      *
98
      *
98
-     * @param id
99
+     * @param
99
      * @param params
100
      * @param params
100
      * @return
101
      * @return
101
      */
102
      */
129
                 taRecommendCustomer.setPersonId(customer.getPersonId());
130
                 taRecommendCustomer.setPersonId(customer.getPersonId());
130
                 taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
131
                 taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
131
                 taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
132
                 taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
133
+                taRecommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
132
                 taRecommendCustomerMapper.insert(taRecommendCustomer);
134
                 taRecommendCustomerMapper.insert(taRecommendCustomer);
133
                 return ResponseBean.success("审核成功");
135
                 return ResponseBean.success("审核成功");
134
             }
136
             }
143
                 recommendCustomer.setRecommendPerson(customer.getRecommendPerson());
145
                 recommendCustomer.setRecommendPerson(customer.getRecommendPerson());
144
                 recommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
146
                 recommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
145
                 recommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
147
                 recommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
148
+                recommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
146
                 taRecommendCustomerMapper.updateById(recommendCustomer);
149
                 taRecommendCustomerMapper.updateById(recommendCustomer);
147
                 return ResponseBean.success("审核成功");
150
                 return ResponseBean.success("审核成功");
148
             }
151
             }