傅行帆 il y a 3 ans
Parent
révision
e4e92ecae3

+ 2
- 0
src/main/java/com/yunzhi/marketing/dto/ChannelReportDTO.java Voir le fichier

@@ -38,4 +38,6 @@ public class ChannelReportDTO {
38 38
      * 性别
39 39
      */
40 40
     private Integer sex;
41
+
42
+    private String remark;
41 43
 }

+ 1
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java Voir le fichier

@@ -432,6 +432,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
432 432
         channelCustomer.setStatus("1");
433 433
         channelCustomer.setChannelId(taChannelPeople.getChannelId());
434 434
         channelCustomer.setOrgId(channelReportDTO.getOrgId());
435
+        channelCustomer.setRemark(channelReportDTO.getRemark());
435 436
         channelCustomerMapper.insert(channelCustomer);
436 437
         return ResponseBean.success(channelCustomer);
437 438
     }

+ 1
- 1
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java Voir le fichier

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

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerPreparatory.java Voir le fichier

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

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerSignatory.java Voir le fichier

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

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerVisit.java Voir le fichier

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

+ 48
- 9
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java Voir le fichier

@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 7
 import com.yunzhi.marketing.base.ResponseBean;
8 8
 import com.yunzhi.marketing.common.CommConstant;
9 9
 import com.yunzhi.marketing.common.StringUtils;
10
+import com.yunzhi.marketing.entity.TaPerson;
10 11
 import com.yunzhi.marketing.entity.TaRecommendCustomer;
12
+import com.yunzhi.marketing.mapper.TaPersonMapper;
11 13
 import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
12 14
 import com.yunzhi.marketing.po.MineRecommendCustomerPO;
13 15
 import com.yunzhi.marketing.po.TaRecommendCustomerPO;
@@ -45,6 +47,9 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
45 47
 
46 48
     @Autowired
47 49
     private CustomerSignatoryMapper customerSignatoryMapper;
50
+
51
+    @Autowired
52
+    private TaPersonMapper taPersonMapper;
48 53
     /**
49 54
      * 审核
50 55
      *
@@ -64,8 +69,19 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
64 69
 
65 70
         // 保存到访单
66 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 86
         // 审核通过 先查看在ta_recommend_customer 手机号是否存在
71 87
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
@@ -95,22 +111,27 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
95 111
             // 审核通过
96 112
             customer.setStatus("2");
97 113
             customer.setCustomerId(taRecommendCustomer.getCustomerId());
114
+            customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
98 115
             customer.setVisitDate(LocalDateTime.now());
99 116
             channelCustomerMapper.updateById(customer);
100
-            return ResponseBean.success("审核成功");
101
-        }
102
-
103
-        if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
117
+        }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
104 118
                 (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
105 119
             // 审核通过
106 120
             customer.setStatus("2");
107 121
             customer.setCustomerId(recommendCustomer.getCustomerId());
122
+            customerVisit.setCustomerId(recommendCustomer.getCustomerId());
108 123
             customer.setVisitDate(LocalDateTime.now());
124
+            customer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
109 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,9 +143,25 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
122 143
      */
123 144
     @Override
124 145
     public ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params) {
146
+        CustomerVisit customerVisit = params.getCustomerVisit();
125 147
         // 渠道推荐的客户
126 148
         if ("report".equals(params.getType())) {
127 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 165
             // 审核通过 先查看在ta_recommend_customer 手机号是否存在
129 166
             LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
130 167
             queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());
@@ -155,6 +192,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
155 192
                 customer.setStatus("2");
156 193
                 customer.setVisitDate(LocalDateTime.now());
157 194
                 customer.setCustomerId(taRecommendCustomer.getCustomerId());
195
+                customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
158 196
                 channelCustomerMapper.updateById(customer);
159 197
             }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
160 198
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
@@ -162,6 +200,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
162 200
                 customer.setStatus("2");
163 201
                 customer.setVisitDate(LocalDateTime.now());
164 202
                 customer.setCustomerId(recommendCustomer.getCustomerId());
203
+                customerVisit.setCustomerId(recommendCustomer.getCustomerId());
165 204
                 channelCustomerMapper.updateById(customer);
166 205
 
167 206
                 // 修改状态为确认到访状态
@@ -178,13 +217,13 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
178 217
             taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
179 218
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
180 219
             taRecommendCustomer.setCirculationTime(LocalDateTime.now());
220
+            customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
181 221
             taRecommendCustomerMapper.updateById(taRecommendCustomer);
182 222
         }else {
183 223
             return ResponseBean.error("请输入正确的类型参数", ResponseBean.ERROR_UNAVAILABLE);
184 224
         }
185 225
 
186 226
         // 保存到访单
187
-        CustomerVisit customerVisit = params.getCustomerVisit();
188 227
         customerVisit.setCreateDate(LocalDateTime.now());
189 228
         customerVisitMapper.insert(customerVisit);
190 229