傅行帆 3 years ago
parent
commit
8b45352519

+ 7
- 2
src/main/java/com/yunzhi/marketing/common/CommConstant.java View File

234
      */
234
      */
235
     public static final Integer CUSTOMER_VISITE = 2;
235
     public static final Integer CUSTOMER_VISITE = 2;
236
 
236
 
237
+    /**
238
+     * 客户认筹
239
+     */
240
+    public static final Integer CUSTOMER_PREPARATORY = 3;
241
+
237
     /**
242
     /**
238
      * 客户认购
243
      * 客户认购
239
      */
244
      */
240
-    public static final Integer CUSTOMER_PREORDER = 3;
245
+    public static final Integer CUSTOMER_PREORDER = 4;
241
 
246
 
242
     /**
247
     /**
243
      * 客户签约
248
      * 客户签约
244
      */
249
      */
245
-    public static final Integer CUSTOMER_SIGNED = 4;
250
+    public static final Integer CUSTOMER_SIGNED = 5;
246
 
251
 
247
 
252
 
248
     /**
253
     /**

+ 260
- 0
src/main/java/com/yunzhi/marketing/po/TaRecommendCustomerVO.java View File

1
+package com.yunzhi.marketing.po;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import com.alibaba.excel.annotation.format.DateTimeFormat;
5
+import com.baomidou.mybatisplus.annotation.IdType;
6
+import com.baomidou.mybatisplus.annotation.TableField;
7
+import com.baomidou.mybatisplus.annotation.TableId;
8
+import com.baomidou.mybatisplus.core.metadata.IPage;
9
+import com.yunzhi.marketing.center.taUser.entity.TaUser;
10
+import com.yunzhi.marketing.entity.PersonIntention;
11
+import com.yunzhi.marketing.entity.TaPersonVisitRecord;
12
+import com.yunzhi.marketing.xlk.entity.CustomerPreparatory;
13
+import com.yunzhi.marketing.xlk.entity.CustomerSignatory;
14
+import com.yunzhi.marketing.xlk.entity.CustomerSubscribe;
15
+import com.yunzhi.marketing.xlk.entity.CustomerVisit;
16
+import lombok.Data;
17
+import lombok.EqualsAndHashCode;
18
+import lombok.experimental.Accessors;
19
+
20
+import java.io.Serializable;
21
+import java.time.LocalDateTime;
22
+import java.util.List;
23
+import java.util.Map;
24
+
25
+/**
26
+ * <p>
27
+ * 推荐客户表
28
+ * </p>
29
+ *
30
+ * @author jobob
31
+ * @since 2019-05-10
32
+ */
33
+@Data
34
+@EqualsAndHashCode(callSuper = false)
35
+@Accessors(chain = true)
36
+public class TaRecommendCustomerVO implements Serializable {
37
+
38
+    private static final long serialVersionUID = 1L;
39
+
40
+    /**
41
+     * 客户ID
42
+     */
43
+    @TableId(value = "customer_id", type = IdType.UUID)
44
+    private String customerId;
45
+
46
+    /**
47
+     * 姓名
48
+     */
49
+    @TableField(value = "`name`")
50
+    private String name;
51
+
52
+    /**
53
+     * 性别
54
+     */
55
+    private Integer sex;
56
+
57
+    /**
58
+     * 电话
59
+     */
60
+    private String phone;
61
+
62
+    /**
63
+     * 照片
64
+     */
65
+    private String picture;
66
+
67
+    /**
68
+     * 描述
69
+     */
70
+    @TableField(value = "`describe`")
71
+    private String describe;
72
+
73
+    /**
74
+     * 预约时间
75
+     */
76
+    private LocalDateTime appointmentTime;
77
+
78
+    /**
79
+     * 到访人数
80
+     */
81
+    private Integer visiteNum;
82
+
83
+    /**
84
+     * 意向项目
85
+     */
86
+    @ExcelProperty(value = "意向项目", index = 3)
87
+    private String intention;
88
+
89
+    /**
90
+     * 项目ID
91
+     */
92
+    private String buildingId;
93
+
94
+    /**
95
+     * 物业类型
96
+     */
97
+    private String realtyManageType;
98
+
99
+    /**
100
+     * 需求类型
101
+     */
102
+    private String demandType;
103
+
104
+    /**
105
+     * 价格区间
106
+     */
107
+    private String priceRange;
108
+
109
+    /**
110
+     * 报备日期
111
+     */
112
+    private LocalDateTime reportDate;
113
+
114
+    /**
115
+     * 状态
116
+     */
117
+    @TableField(value = "`status`")
118
+    private Integer status;
119
+
120
+    /**
121
+     * 推荐人
122
+     */
123
+    private String recommendPerson;
124
+
125
+    private String personId;
126
+
127
+    /**
128
+     * 服务顾问
129
+     */
130
+    private String realtyConsultant;
131
+
132
+    /**
133
+     * 服务顾问
134
+     */
135
+    @TableField(exist = false)
136
+    private Map<String, Object> consultants;
137
+
138
+    @TableField(exist = false)
139
+    private String consultantName;
140
+
141
+    @TableField(exist = false)
142
+    private String consultTel;
143
+
144
+    private Integer verifyStatus;
145
+
146
+    private String verifyRemark;
147
+
148
+    private String country;
149
+
150
+    private String province;
151
+
152
+    private String city;
153
+
154
+    private String entryType;
155
+
156
+    private LocalDateTime arrivalDate;
157
+
158
+    private LocalDateTime verifyDate;
159
+
160
+    /**
161
+     * 流转使劲
162
+     */
163
+    private LocalDateTime circulationTime;
164
+
165
+    /**
166
+     * 组织结构id
167
+     */
168
+    private String institutionId;
169
+
170
+    @DateTimeFormat("yyyy年MM月dd日")
171
+    private LocalDateTime createDate;
172
+
173
+    private Integer reportRecommendStatus;
174
+
175
+    private Integer orgId;
176
+
177
+    @TableField(exist = false)
178
+    private IPage<TaPersonVisitRecord> visitRecords;
179
+
180
+    @TableField(exist = false)
181
+    private List<String> projects;
182
+
183
+    @TableField(exist = false)
184
+    private Integer duration;
185
+
186
+    @TableField(exist = false)
187
+    private LocalDateTime visitTime;
188
+
189
+    @TableField(exist = false)
190
+    private Integer visitTimes;
191
+
192
+    @TableField(exist = false)
193
+    private TaUser consultant;
194
+
195
+    @TableField(exist = false)
196
+    private String recommendName;
197
+
198
+    @TableField(exist = false)
199
+    private String recommendTel;
200
+
201
+    @TableField(exist = false)
202
+    private List<PersonIntention> intentions;
203
+    
204
+    @TableField(exist = false)
205
+    private String intentionName;
206
+
207
+
208
+    /**
209
+     * 推广人
210
+     */
211
+    @TableField(exist = false)
212
+    private String sharePersonName;
213
+
214
+    @TableField(exist = false)
215
+    private Map<String,String> geoInfo;
216
+
217
+    @TableField(exist = false)
218
+    private String avatarurl;
219
+
220
+    /**
221
+     * 所属项目
222
+     */
223
+    @TableField(exist = false)
224
+    private String buildingName;
225
+
226
+    /**
227
+     * 来源类型
228
+     */
229
+    private String personFrom;
230
+
231
+    /**
232
+     * 迁移人的名称
233
+     */
234
+    private String moveUserName;
235
+
236
+    /**
237
+     * 迁移人的userId
238
+     */
239
+    private String moveUserId;
240
+
241
+    /**
242
+     * 到访
243
+     */
244
+    private CustomerVisit customerVisit;
245
+
246
+    /**
247
+     * 认购
248
+     */
249
+    private CustomerSubscribe customerSubscribe;
250
+
251
+    /**
252
+     * 签约
253
+     */
254
+    private CustomerSignatory customerSignatory;
255
+
256
+    /**
257
+     * 认筹
258
+     */
259
+    private CustomerPreparatory customerPreparatory;
260
+}

+ 59
- 5
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java View File

21
 import com.yunzhi.marketing.excel.ExcelRecommendCustomer;
21
 import com.yunzhi.marketing.excel.ExcelRecommendCustomer;
22
 import com.yunzhi.marketing.excel.ReporRecommendCustomer;
22
 import com.yunzhi.marketing.excel.ReporRecommendCustomer;
23
 import com.yunzhi.marketing.po.TaRecommendCustomerPO;
23
 import com.yunzhi.marketing.po.TaRecommendCustomerPO;
24
+import com.yunzhi.marketing.po.TaRecommendCustomerVO;
24
 import com.yunzhi.marketing.service.IMiniAppService;
25
 import com.yunzhi.marketing.service.IMiniAppService;
25
 import com.yunzhi.marketing.service.ITaRecommendCustomerService;
26
 import com.yunzhi.marketing.service.ITaRecommendCustomerService;
26
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
27
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
28
 import com.yunzhi.marketing.statistic.mapper.TaCustomerFollowUpRecordMapper;
29
 import com.yunzhi.marketing.statistic.mapper.TaCustomerFollowUpRecordMapper;
29
 import com.yunzhi.marketing.entity.*;
30
 import com.yunzhi.marketing.entity.*;
30
 import com.yunzhi.marketing.mapper.*;
31
 import com.yunzhi.marketing.mapper.*;
31
-import com.yunzhi.marketing.xlk.entity.BuildingChannel;
32
-import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
33
-import com.yunzhi.marketing.xlk.mapper.BuildingChannelMapper;
34
-import com.yunzhi.marketing.xlk.mapper.ChannelCustomerMapper;
32
+import com.yunzhi.marketing.xlk.entity.*;
33
+import com.yunzhi.marketing.xlk.mapper.*;
35
 import org.apache.commons.collections.CollectionUtils;
34
 import org.apache.commons.collections.CollectionUtils;
36
 import org.slf4j.Logger;
35
 import org.slf4j.Logger;
37
 import org.slf4j.LoggerFactory;
36
 import org.slf4j.LoggerFactory;
37
+import org.springframework.beans.BeanUtils;
38
 import org.springframework.beans.factory.annotation.Autowired;
38
 import org.springframework.beans.factory.annotation.Autowired;
39
 import org.springframework.cglib.beans.BeanCopier;
39
 import org.springframework.cglib.beans.BeanCopier;
40
 import org.springframework.stereotype.Service;
40
 import org.springframework.stereotype.Service;
128
     @Autowired
128
     @Autowired
129
     private TaChannelPersonMapper channelPersonMapper;
129
     private TaChannelPersonMapper channelPersonMapper;
130
 
130
 
131
+    @Autowired
132
+    private CustomerVisitMapper customerVisitMapper;
133
+
134
+    @Autowired
135
+    private CustomerPreparatoryMapper customerPreparatoryMapper;
136
+
137
+    @Autowired
138
+    private CustomerSignatoryMapper customerSignatoryMapper;
139
+
140
+    @Autowired
141
+    private CustomerSubscribeMapper customerSubscribeMapper;
142
+
131
     @Override
143
     @Override
132
     public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
144
     public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
133
         List<TaPerson> taPersons = getPersonsByOpenId(openid);
145
         List<TaPerson> taPersons = getPersonsByOpenId(openid);
656
     public ResponseBean getCustDetail(String id) {
668
     public ResponseBean getCustDetail(String id) {
657
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(id);
669
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(id);
658
 
670
 
671
+        // 兼容渠道报备客户
672
+        if (null == taRecommendCustomer) {
673
+            ChannelCustomer customer = channelCustomerMapper.selectById(id);
674
+            BeanUtils.copyProperties(customer,taRecommendCustomer);
675
+        }
676
+
659
         if (!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())) {
677
         if (!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())) {
660
             TaPerson taPerson = taPersonMapper.selectById(taRecommendCustomer.getRealtyConsultant());
678
             TaPerson taPerson = taPersonMapper.selectById(taRecommendCustomer.getRealtyConsultant());
661
             if (null != taPerson) {
679
             if (null != taPerson) {
668
             }
686
             }
669
         }
687
         }
670
 
688
 
671
-        return ResponseBean.success(taRecommendCustomer);
689
+        TaRecommendCustomerVO taRecommendCustomerVO = new TaRecommendCustomerVO();
690
+        BeanUtils.copyProperties(taRecommendCustomer,taRecommendCustomerVO);
691
+        // 根据不同的状态值去返回不用的数据集合
692
+        if (CommConstant.CUSTOMER_REPORT.equals(taRecommendCustomer.getStatus())) {
693
+            // 报备状态
694
+            String recommendPerson = taRecommendCustomer.getRecommendPerson();
695
+            TaPerson taPerson = taPersonMapper.selectById(recommendPerson);
696
+            if (null != taPerson) {
697
+                taRecommendCustomer.setRecommendName(taPerson.getName());
698
+            }
699
+        }else if (CommConstant.CUSTOMER_VISITE.equals(taRecommendCustomer.getStatus())) {
700
+            // 到访状态
701
+            LambdaQueryWrapper<CustomerVisit> lambdaQueryWrapper = new LambdaQueryWrapper<>();
702
+            lambdaQueryWrapper.eq(CustomerVisit::getCustomerId,taRecommendCustomer.getCustomerId());
703
+            CustomerVisit customerVisit = customerVisitMapper.selectOne(lambdaQueryWrapper);
704
+            taRecommendCustomerVO.setCustomerVisit(customerVisit);
705
+        }else if (CommConstant.CUSTOMER_PREPARATORY.equals(taRecommendCustomer.getStatus())) {
706
+            // 认筹状态
707
+            LambdaQueryWrapper<CustomerPreparatory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
708
+            lambdaQueryWrapper.eq(CustomerPreparatory::getCustomerId,taRecommendCustomer.getCustomerId());
709
+            CustomerPreparatory customerPreparatory = customerPreparatoryMapper.selectOne(lambdaQueryWrapper);
710
+            taRecommendCustomerVO.setCustomerPreparatory(customerPreparatory);
711
+        }else if (CommConstant.CUSTOMER_PREORDER.equals(taRecommendCustomer.getStatus())) {
712
+            // 认购状态
713
+            LambdaQueryWrapper<CustomerSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
714
+            lambdaQueryWrapper.eq(CustomerSubscribe::getCustomerId,taRecommendCustomer.getCustomerId());
715
+            CustomerSubscribe customerSubscribe = customerSubscribeMapper.selectOne(lambdaQueryWrapper);
716
+            taRecommendCustomerVO.setCustomerSubscribe(customerSubscribe);
717
+        }else if (CommConstant.CUSTOMER_SIGNED.equals(taRecommendCustomer.getStatus())) {
718
+            // 签约状态
719
+            LambdaQueryWrapper<CustomerSignatory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
720
+            lambdaQueryWrapper.eq(CustomerSignatory::getCustomerId,taRecommendCustomer.getCustomerId());
721
+            CustomerSignatory customerSignatory = customerSignatoryMapper.selectOne(lambdaQueryWrapper);
722
+            taRecommendCustomerVO.setCustomerSignatory(customerSignatory);
723
+        }
724
+
725
+        return ResponseBean.success(taRecommendCustomerVO);
672
     }
726
     }
673
 
727
 
674
     @Override
728
     @Override

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

6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.yunzhi.marketing.base.BaseController;
7
 import com.yunzhi.marketing.base.BaseController;
8
 import com.yunzhi.marketing.base.ResponseBean;
8
 import com.yunzhi.marketing.base.ResponseBean;
9
-import com.yunzhi.marketing.xlk.dto.ChannelCustomerDTO;
10
-import com.yunzhi.marketing.xlk.dto.MarkingChannelCustomerDTO;
9
+import com.yunzhi.marketing.xlk.dto.*;
11
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
10
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
12
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
11
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
13
 import io.swagger.annotations.Api;
12
 import io.swagger.annotations.Api;
100
      * @return
99
      * @return
101
      */
100
      */
102
     @ApiOperation(value = "森哥看这里-wx-驻场确认到访", notes = "森哥看这里-wx-驻场确认到访")
101
     @ApiOperation(value = "森哥看这里-wx-驻场确认到访", notes = "森哥看这里-wx-驻场确认到访")
103
-    @RequestMapping(value="/wx/marking/channelCustomer",method= RequestMethod.PUT)
102
+    @RequestMapping(value="/wx/marking/visit",method= RequestMethod.PUT)
104
     public ResponseBean channelCustomerUpdate(@RequestBody MarkingChannelCustomerDTO params){
103
     public ResponseBean channelCustomerUpdate(@RequestBody MarkingChannelCustomerDTO params){
105
         return iChannelCustomerService.markingChannelCustomer(params);
104
         return iChannelCustomerService.markingChannelCustomer(params);
106
     }
105
     }
107
 
106
 
107
+    /**
108
+     * 驻场 确认认筹
109
+     *
110
+     * @param
111
+     * @return
112
+     */
113
+    @ApiOperation(value = "森哥看这里-wx-驻场确认认筹", notes = "森哥看这里-wx-驻场确认认筹")
114
+    @RequestMapping(value="/wx/marking/preparatory",method= RequestMethod.PUT)
115
+    public ResponseBean preparatoryCustomer(@RequestBody MarkingPreparatoryCustomerDTO params){
116
+        return iChannelCustomerService.preparatoryCustomer(params);
117
+    }
118
+
119
+    /**
120
+     * 驻场 确认认购
121
+     *
122
+     * @param
123
+     * @return
124
+     */
125
+    @ApiOperation(value = "森哥看这里-wx-驻场确认认购", notes = "森哥看这里-wx-驻场确认认购")
126
+    @RequestMapping(value="/wx/marking/subscribe",method= RequestMethod.PUT)
127
+    public ResponseBean subscribeCustomer(@RequestBody MarkingSubscribeCustomerDTO params){
128
+        return iChannelCustomerService.subscribeCustomer(params);
129
+    }
130
+
131
+    /**
132
+     * 驻场 确认签约
133
+     *
134
+     * @param
135
+     * @return
136
+     */
137
+    @ApiOperation(value = "森哥看这里-wx-驻场确认签约", notes = "森哥看这里-wx-驻场确认签约")
138
+    @RequestMapping(value="/wx/marking/signatory",method= RequestMethod.PUT)
139
+    public ResponseBean signatoryCustomer(@RequestBody MarkingSignatoryCustomerDTO params){
140
+        return iChannelCustomerService.signatoryCustomer(params);
141
+    }
142
+
108
 
143
 
109
     /**
144
     /**
110
      * 驻场 无效报备
145
      * 驻场 无效报备

+ 27
- 5
src/main/java/com/yunzhi/marketing/xlk/controller/CustomerInfoController.java View File

91
         }
91
         }
92
         TaPerson person = persons.get(0);
92
         TaPerson person = persons.get(0);
93
         try {
93
         try {
94
+            LambdaQueryWrapper<CustomerInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
95
+            lambdaQueryWrapper.eq(CustomerInfo::getCustomerId,customerInfo.getCustomerId());
96
+            CustomerInfo oldCustomerInfo = iCustomerInfoService.getOne(lambdaQueryWrapper);
97
+            if (null != oldCustomerInfo) {
98
+                if (iCustomerInfoService.updateById(customerInfo)){
99
+                    // 记录到修改记录表中
100
+                    CustomerInfoModifyRecord customerInfoModifyRecord = new CustomerInfoModifyRecord();
101
+                    customerInfoModifyRecord.setCreateDate(LocalDateTime.now());
102
+                    customerInfoModifyRecord.setCustomerInfoId(oldCustomerInfo.getCustomerId());
103
+                    customerInfoModifyRecord.setModifyPersonId(person.getPersonId());
104
+                    customerInfoModifyRecord.setOrgId(orgId);
105
+                    customerInfoModifyRecord.setContent(JSONObject.toJSONString(customerInfo));
106
+                    customerInfoModifyRecordService.save(customerInfoModifyRecord);
107
+                    responseBean.addSuccess(customerInfo);
108
+                }else {
109
+                    responseBean.addError("fail");
110
+                }
111
+                return responseBean;
112
+            }
113
+
94
             customerInfo.setCreateDate(LocalDateTime.now());
114
             customerInfo.setCreateDate(LocalDateTime.now());
95
             customerInfo.setCreatePerson(person.getPersonId());
115
             customerInfo.setCreatePerson(person.getPersonId());
96
             customerInfo.setOrgId(orgId);
116
             customerInfo.setOrgId(orgId);
131
 
151
 
132
     /**
152
     /**
133
      * 修改对象
153
      * 修改对象
134
-     * @param id  实体ID
154
+     * @param customerId  实体ID
135
      * @param customerInfo 实体对象
155
      * @param customerInfo 实体对象
136
      * @return
156
      * @return
137
      */
157
      */
138
-    @RequestMapping(value="/customerInfo/{id}",method= RequestMethod.PUT)
139
-    public ResponseBean customerInfoUpdate(@PathVariable String id,
158
+    @RequestMapping(value="/wx/customerInfo/{customerId}",method= RequestMethod.PUT)
159
+    public ResponseBean customerInfoUpdate(@PathVariable String customerId,
140
                                         @RequestBody CustomerInfo customerInfo, @RequestHeader("authorization") String token,HttpServletRequest request){
160
                                         @RequestBody CustomerInfo customerInfo, @RequestHeader("authorization") String token,HttpServletRequest request){
141
         ResponseBean responseBean = new ResponseBean();
161
         ResponseBean responseBean = new ResponseBean();
142
         String openid = getOpenId(request);
162
         String openid = getOpenId(request);
147
         }
167
         }
148
         TaPerson person = persons.get(0);
168
         TaPerson person = persons.get(0);
149
         try {
169
         try {
150
-            customerInfo.setCustomerInfoId(id);
170
+            LambdaQueryWrapper<CustomerInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
171
+            lambdaQueryWrapper.eq(CustomerInfo::getCustomerId,customerId);
172
+            CustomerInfo oldCustomerInfo = iCustomerInfoService.getOne(lambdaQueryWrapper);
151
             if (iCustomerInfoService.updateById(customerInfo)){
173
             if (iCustomerInfoService.updateById(customerInfo)){
152
                 // 记录到修改记录表中
174
                 // 记录到修改记录表中
153
                 CustomerInfoModifyRecord customerInfoModifyRecord = new CustomerInfoModifyRecord();
175
                 CustomerInfoModifyRecord customerInfoModifyRecord = new CustomerInfoModifyRecord();
154
                 customerInfoModifyRecord.setCreateDate(LocalDateTime.now());
176
                 customerInfoModifyRecord.setCreateDate(LocalDateTime.now());
155
-                customerInfoModifyRecord.setCustomerInfoId(id);
177
+                customerInfoModifyRecord.setCustomerInfoId(oldCustomerInfo.getCustomerId());
156
                 customerInfoModifyRecord.setModifyPersonId(person.getPersonId());
178
                 customerInfoModifyRecord.setModifyPersonId(person.getPersonId());
157
                 customerInfoModifyRecord.setOrgId(orgId);
179
                 customerInfoModifyRecord.setOrgId(orgId);
158
                 customerInfoModifyRecord.setContent(JSONObject.toJSONString(customerInfo));
180
                 customerInfoModifyRecord.setContent(JSONObject.toJSONString(customerInfo));

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/MarkingChannelCustomerDTO.java View File

1
 package com.yunzhi.marketing.xlk.dto;
1
 package com.yunzhi.marketing.xlk.dto;
2
 
2
 
3
 import com.baomidou.mybatisplus.annotation.TableName;
3
 import com.baomidou.mybatisplus.annotation.TableName;
4
+import com.yunzhi.marketing.xlk.entity.CustomerVisit;
4
 import lombok.Data;
5
 import lombok.Data;
5
 import lombok.EqualsAndHashCode;
6
 import lombok.EqualsAndHashCode;
6
 import lombok.experimental.Accessors;
7
 import lombok.experimental.Accessors;
32
      */
33
      */
33
    private String realtyConsultant;
34
    private String realtyConsultant;
34
 
35
 
36
+    /**
37
+     * 到访
38
+     */
39
+   private CustomerVisit customerVisit;
35
 }
40
 }

+ 31
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/MarkingPreparatoryCustomerDTO.java View File

1
+package com.yunzhi.marketing.xlk.dto;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import com.yunzhi.marketing.xlk.entity.CustomerPreparatory;
5
+import com.yunzhi.marketing.xlk.entity.CustomerVisit;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+
12
+/**
13
+ * <p>
14
+ * 渠道报备客户表 
15
+ * </p>
16
+ *
17
+ * @author jobob
18
+ * @since 2021-07-19
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+public class MarkingPreparatoryCustomerDTO implements Serializable {
24
+
25
+    private String customerId;
26
+
27
+    /**
28
+     * 认筹
29
+     */
30
+   private CustomerPreparatory customerPreparatory;
31
+}

+ 30
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/MarkingSignatoryCustomerDTO.java View File

1
+package com.yunzhi.marketing.xlk.dto;
2
+
3
+import com.yunzhi.marketing.xlk.entity.CustomerPreparatory;
4
+import com.yunzhi.marketing.xlk.entity.CustomerSignatory;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+import lombok.experimental.Accessors;
8
+
9
+import java.io.Serializable;
10
+
11
+/**
12
+ * <p>
13
+ * 渠道报备客户表 
14
+ * </p>
15
+ *
16
+ * @author jobob
17
+ * @since 2021-07-19
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class MarkingSignatoryCustomerDTO implements Serializable {
23
+
24
+    private String customerId;
25
+
26
+    /**
27
+     * 认筹
28
+     */
29
+   private CustomerSignatory customerSignatory;
30
+}

+ 30
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/MarkingSubscribeCustomerDTO.java View File

1
+package com.yunzhi.marketing.xlk.dto;
2
+
3
+import com.yunzhi.marketing.xlk.entity.CustomerPreparatory;
4
+import com.yunzhi.marketing.xlk.entity.CustomerSubscribe;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+import lombok.experimental.Accessors;
8
+
9
+import java.io.Serializable;
10
+
11
+/**
12
+ * <p>
13
+ * 渠道报备客户表 
14
+ * </p>
15
+ *
16
+ * @author jobob
17
+ * @since 2021-07-19
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class MarkingSubscribeCustomerDTO implements Serializable {
23
+
24
+    private String customerId;
25
+
26
+    /**
27
+     * 认筹
28
+     */
29
+   private CustomerSubscribe customerSubscribe;
30
+}

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

34
      */
34
      */
35
     private String customerId;
35
     private String customerId;
36
 
36
 
37
+    /**
38
+     * 楼盘id
39
+     */
40
+    private String buildingId;
41
+
37
     /**
42
     /**
38
      * 客户姓名
43
      * 客户姓名
39
      */
44
      */

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

34
      */
34
      */
35
     private String customerId;
35
     private String customerId;
36
 
36
 
37
+    /**
38
+     * 楼盘id
39
+     */
40
+    private String buildingId;
41
+
37
     /**
42
     /**
38
      * 客户姓名
43
      * 客户姓名
39
      */
44
      */

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerSubscribe.java View File

34
      */
34
      */
35
     private String customerId;
35
     private String customerId;
36
 
36
 
37
+    /**
38
+     * 楼盘id
39
+     */
40
+    private String buildingId;
41
+
37
     /**
42
     /**
38
      * 客户姓名
43
      * 客户姓名
39
      */
44
      */

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

34
      */
34
      */
35
     private String customerId;
35
     private String customerId;
36
 
36
 
37
+    /**
38
+     * 楼盘id
39
+     */
40
+    private String buildingId;
41
+
37
     /**
42
     /**
38
      * 客户姓名
43
      * 客户姓名
39
      */
44
      */

+ 22
- 2
src/main/java/com/yunzhi/marketing/xlk/service/IChannelCustomerService.java View File

3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
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.xlk.dto.ChannelCustomerDTO;
7
-import com.yunzhi.marketing.xlk.dto.MarkingChannelCustomerDTO;
6
+import com.yunzhi.marketing.xlk.dto.*;
8
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
7
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
9
 
8
 
10
 /**
9
 /**
49
                                           String recommendPhone,
48
                                           String recommendPhone,
50
                                           String status,
49
                                           String status,
51
                                           String type);
50
                                           String type);
51
+
52
+    /**
53
+     * 驻场认筹
54
+     * @param params
55
+     * @return
56
+     */
57
+    ResponseBean preparatoryCustomer(MarkingPreparatoryCustomerDTO params);
58
+
59
+    /**
60
+     * 驻场认购
61
+     * @param params
62
+     * @return
63
+     */
64
+    ResponseBean subscribeCustomer(MarkingSubscribeCustomerDTO params);
65
+
66
+    /**
67
+     * 驻场签约
68
+     * @param params
69
+     * @return
70
+     */
71
+    ResponseBean signatoryCustomer(MarkingSignatoryCustomerDTO params);
52
 }
72
 }

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

8
 import com.yunzhi.marketing.common.StringUtils;
8
 import com.yunzhi.marketing.common.StringUtils;
9
 import com.yunzhi.marketing.entity.TaRecommendCustomer;
9
 import com.yunzhi.marketing.entity.TaRecommendCustomer;
10
 import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
10
 import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
11
-import com.yunzhi.marketing.xlk.dto.ChannelCustomerDTO;
12
-import com.yunzhi.marketing.xlk.dto.MarkingChannelCustomerDTO;
13
-import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
14
-import com.yunzhi.marketing.xlk.mapper.ChannelCustomerMapper;
11
+import com.yunzhi.marketing.xlk.dto.*;
12
+import com.yunzhi.marketing.xlk.entity.*;
13
+import com.yunzhi.marketing.xlk.mapper.*;
15
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
14
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
16
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.stereotype.Service;
16
 import org.springframework.stereotype.Service;
35
     @Autowired
34
     @Autowired
36
     private TaRecommendCustomerMapper taRecommendCustomerMapper;
35
     private TaRecommendCustomerMapper taRecommendCustomerMapper;
37
 
36
 
37
+    @Autowired
38
+    private CustomerVisitMapper customerVisitMapper;
39
+
40
+    @Autowired
41
+    private CustomerPreparatoryMapper customerPreparatoryMapper;
42
+
43
+    @Autowired
44
+    private CustomerSignatoryMapper customerSignatoryMapper;
45
+
46
+    @Autowired
47
+    private CustomerSubscribeMapper customerSubscribeMapper;
48
+
38
     /**
49
     /**
39
      * 审核
50
      * 审核
40
      *
51
      *
134
                 taRecommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
145
                 taRecommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
135
                 taRecommendCustomer.setCirculationTime(LocalDateTime.now());
146
                 taRecommendCustomer.setCirculationTime(LocalDateTime.now());
136
                 taRecommendCustomerMapper.insert(taRecommendCustomer);
147
                 taRecommendCustomerMapper.insert(taRecommendCustomer);
137
-                return ResponseBean.success("审核成功");
138
-            }
139
-
140
-            if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
148
+            }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
141
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
149
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
142
                 // 审核通过
150
                 // 审核通过
143
                 customer.setStatus("2");
151
                 customer.setStatus("2");
150
                 recommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
158
                 recommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
151
                 recommendCustomer.setCirculationTime(LocalDateTime.now());
159
                 recommendCustomer.setCirculationTime(LocalDateTime.now());
152
                 taRecommendCustomerMapper.updateById(recommendCustomer);
160
                 taRecommendCustomerMapper.updateById(recommendCustomer);
153
-                return ResponseBean.success("审核成功");
154
             }
161
             }
155
         }else if ("customer".equals(params.getType())) {
162
         }else if ("customer".equals(params.getType())) {
156
             // 置业顾问 经纪人推荐的客户
163
             // 置业顾问 经纪人推荐的客户
159
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
166
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
160
             taRecommendCustomer.setCirculationTime(LocalDateTime.now());
167
             taRecommendCustomer.setCirculationTime(LocalDateTime.now());
161
             taRecommendCustomerMapper.updateById(taRecommendCustomer);
168
             taRecommendCustomerMapper.updateById(taRecommendCustomer);
162
-            return ResponseBean.success("审核成功");
169
+        }else {
170
+            return ResponseBean.error("请输入正确的类型参数", ResponseBean.ERROR_UNAVAILABLE);
163
         }
171
         }
164
 
172
 
165
-        return ResponseBean.error("此客户是私客或已被报备", ResponseBean.ERROR_UNAVAILABLE);
173
+        // 保存到访单
174
+        CustomerVisit customerVisit = params.getCustomerVisit();
175
+        customerVisit.setCreateDate(LocalDateTime.now());
176
+        customerVisitMapper.insert(customerVisit);
177
+
178
+        return ResponseBean.success("审核成功");
166
     }
179
     }
167
 
180
 
168
     /**
181
     /**
212
                                                  String status,String type) {
225
                                                  String status,String type) {
213
         return channelCustomerMapper.getProfileList(pg, orgId, buildingId, name, phone, recommendPersonName, recommendPhone, status, type);
226
         return channelCustomerMapper.getProfileList(pg, orgId, buildingId, name, phone, recommendPersonName, recommendPhone, status, type);
214
     }
227
     }
228
+
229
+    /**
230
+     * 驻场认筹
231
+     *
232
+     * @param params
233
+     * @return
234
+     */
235
+    @Override
236
+    public ResponseBean preparatoryCustomer(MarkingPreparatoryCustomerDTO params) {
237
+        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getCustomerId());
238
+        taRecommendCustomer.setStatus(CommConstant.CUSTOMER_PREPARATORY);
239
+        taRecommendCustomerMapper.updateById(taRecommendCustomer);
240
+
241
+        CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
242
+        customerPreparatory.setCreateDate(LocalDateTime.now());
243
+        customerPreparatoryMapper.insert(customerPreparatory);
244
+        return ResponseBean.success("审核成功");
245
+    }
246
+
247
+    /**
248
+     * 驻场认购
249
+     *
250
+     * @param params
251
+     * @return
252
+     */
253
+    @Override
254
+    public ResponseBean subscribeCustomer(MarkingSubscribeCustomerDTO params) {
255
+        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getCustomerId());
256
+        taRecommendCustomer.setStatus(CommConstant.CUSTOMER_PREORDER);
257
+        taRecommendCustomerMapper.updateById(taRecommendCustomer);
258
+
259
+        CustomerSubscribe customerSubscribe = params.getCustomerSubscribe();
260
+        customerSubscribe.setCreateDate(LocalDateTime.now());
261
+        customerSubscribeMapper.insert(customerSubscribe);
262
+        return ResponseBean.success("审核成功");
263
+    }
264
+
265
+    /**
266
+     * 驻场签约
267
+     *
268
+     * @param params
269
+     * @return
270
+     */
271
+    @Override
272
+    public ResponseBean signatoryCustomer(MarkingSignatoryCustomerDTO params) {
273
+        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getCustomerId());
274
+        taRecommendCustomer.setStatus(CommConstant.CUSTOMER_SIGNED);
275
+        taRecommendCustomerMapper.updateById(taRecommendCustomer);
276
+
277
+        CustomerSignatory customerSignatory = params.getCustomerSignatory();
278
+        customerSignatory.setCreateDate(LocalDateTime.now());
279
+        customerSignatoryMapper.insert(customerSignatory);
280
+        return ResponseBean.success("审核成功");
281
+    }
215
 }
282
 }