|
@@ -6,10 +6,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
6
|
6
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
7
|
7
|
import com.yunzhi.marketing.base.BaseController;
|
8
|
8
|
import com.yunzhi.marketing.base.ResponseBean;
|
|
9
|
+import com.yunzhi.marketing.common.DateUtils;
|
9
|
10
|
import com.yunzhi.marketing.common.StringUtils;
|
|
11
|
+import com.yunzhi.marketing.entity.TaBuilding;
|
10
|
12
|
import com.yunzhi.marketing.entity.TaPerson;
|
|
13
|
+import com.yunzhi.marketing.entity.TaRecommendCustomer;
|
|
14
|
+import com.yunzhi.marketing.service.ITaBuildingService;
|
11
|
15
|
import com.yunzhi.marketing.service.ITaPersonService;
|
12
|
16
|
import com.yunzhi.marketing.service.ITaRecommendCustomerService;
|
|
17
|
+import com.yunzhi.marketing.statistic.entity.TaCustomerFollowUpRecord;
|
|
18
|
+import com.yunzhi.marketing.statistic.service.ITaCustomerFollowUpRecordService;
|
13
|
19
|
import com.yunzhi.marketing.xlk.dto.*;
|
14
|
20
|
import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
|
15
|
21
|
import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
|
|
@@ -23,6 +29,9 @@ import org.springframework.web.bind.annotation.*;
|
23
|
29
|
|
24
|
30
|
import javax.servlet.http.HttpServletRequest;
|
25
|
31
|
import java.time.LocalDateTime;
|
|
32
|
+import java.util.HashMap;
|
|
33
|
+import java.util.List;
|
|
34
|
+import java.util.Map;
|
26
|
35
|
|
27
|
36
|
/**
|
28
|
37
|
* <p>
|
|
@@ -48,6 +57,12 @@ public class ChannelCustomerController extends BaseController {
|
48
|
57
|
@Autowired
|
49
|
58
|
private ITaPersonService taPersonService;
|
50
|
59
|
|
|
60
|
+ @Autowired
|
|
61
|
+ private ITaBuildingService iTaBuildingService;
|
|
62
|
+
|
|
63
|
+ @Autowired
|
|
64
|
+ private ITaCustomerFollowUpRecordService iTaCustomerFollowUpRecordService;
|
|
65
|
+
|
51
|
66
|
|
52
|
67
|
/**
|
53
|
68
|
* 分页查询列表
|
|
@@ -232,4 +247,35 @@ public class ChannelCustomerController extends BaseController {
|
232
|
247
|
return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
|
233
|
248
|
}
|
234
|
249
|
}
|
|
250
|
+
|
|
251
|
+ /**
|
|
252
|
+ * 获取客户的几个基本状态
|
|
253
|
+ * @param customerId
|
|
254
|
+ * @return
|
|
255
|
+ */
|
|
256
|
+ @GetMapping("/wx/channelCustomer/status/{customerId}")
|
|
257
|
+ public ResponseBean getWxCustomerStatus(@PathVariable String customerId) {
|
|
258
|
+ TaRecommendCustomer customer = taRecommendCustomerService.getById(customerId);
|
|
259
|
+ if (null == customer) {
|
|
260
|
+ return ResponseBean.error("当前客户不存在", ResponseBean.ERROR_UNAVAILABLE);
|
|
261
|
+ }
|
|
262
|
+
|
|
263
|
+ // 所属楼盘
|
|
264
|
+ TaBuilding taBuilding = null;
|
|
265
|
+ if (null != customer.getBuildingId()) {
|
|
266
|
+ iTaBuildingService.getById(customer.getBuildingId());
|
|
267
|
+ }
|
|
268
|
+
|
|
269
|
+ // 跟进信息
|
|
270
|
+ QueryWrapper<TaCustomerFollowUpRecord> queryWrapper = new QueryWrapper<>();
|
|
271
|
+ queryWrapper.eq("customer_id", customerId);
|
|
272
|
+ queryWrapper.last(" and DATE_FORMAT(create_date. '%Y-%m-$d') = '"+ DateUtils.today() +"'");
|
|
273
|
+ int num = iTaCustomerFollowUpRecordService.count(queryWrapper);
|
|
274
|
+
|
|
275
|
+ Map<String, Object> rtn = new HashMap<>();
|
|
276
|
+ rtn.put("building", taBuilding);
|
|
277
|
+ rtn.put("followed", num > 0);
|
|
278
|
+
|
|
279
|
+ return ResponseBean.success(rtn);
|
|
280
|
+ }
|
235
|
281
|
}
|