|
@@ -15,6 +15,7 @@ import com.huiju.welcome.model.*;
|
15
|
15
|
import com.huiju.welcome.common.base.ResponseBean;
|
16
|
16
|
import com.huiju.welcome.model.TaCustomer;
|
17
|
17
|
import com.huiju.welcome.model.TaMainUsherRecord;
|
|
18
|
+import com.huiju.welcome.service.ICameraService;
|
18
|
19
|
import com.huiju.welcome.service.ITaCustomerService;
|
19
|
20
|
import com.huiju.welcome.service.ITaMainUsherRecordService;
|
20
|
21
|
import com.huiju.welcome.service.ITaPersonService;
|
|
@@ -67,6 +68,9 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
|
67
|
68
|
|
68
|
69
|
@Autowired
|
69
|
70
|
MiniApp miniApp;
|
|
71
|
+
|
|
72
|
+ @Autowired
|
|
73
|
+ ICameraService cameraService;
|
70
|
74
|
|
71
|
75
|
@Override
|
72
|
76
|
public boolean updateNormal(List<TaMainUsherRecord> records) {
|
|
@@ -244,9 +248,9 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
|
244
|
248
|
@Override
|
245
|
249
|
public boolean newRecordByMiniapp(TaMainUsherRecord taMainUsherRecord) throws Exception {
|
246
|
250
|
Integer consultantId = taMainUsherRecord.getConsultantId();
|
247
|
|
- if (null == consultantId || consultantId < 1) {
|
248
|
|
- throw new Exception("置业顾问不能为空");
|
249
|
|
- }
|
|
251
|
+ //if (null == consultantId || consultantId < 1) {
|
|
252
|
+ // throw new Exception("置业顾问不能为空");
|
|
253
|
+ //}
|
250
|
254
|
|
251
|
255
|
if (StringUtils.isEmpty(taMainUsherRecord.getPhone())) {
|
252
|
256
|
throw new Exception("客户电话不能为空");
|
|
@@ -270,19 +274,21 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
|
270
|
274
|
}
|
271
|
275
|
}
|
272
|
276
|
|
273
|
|
- if (null == taCustomer && null == taMainUsherRecord.getCustomerId()) {
|
274
|
|
- taCustomer = iTaCustomerService.newCustByMainUsher(taMainUsherRecord, false);
|
275
|
|
- }
|
|
277
|
+ //if (null == taCustomer && null == taMainUsherRecord.getCustomerId()) {
|
|
278
|
+ // taCustomer = iTaCustomerService.newCustByMainUsher(taMainUsherRecord, false);
|
|
279
|
+ //}
|
276
|
280
|
|
277
|
281
|
if (null == taCustomer){
|
278
|
282
|
// 新增客户
|
279
|
|
- iTaCustomerService.newCustByMainUsher(taMainUsherRecord, true);
|
|
283
|
+ TaCustomer taCustomerNew = iTaCustomerService.newCustByMainUsher(taMainUsherRecord, true);
|
280
|
284
|
|
|
285
|
+ taMainUsherRecord.setVisiteDate(LocalDateTime.now());
|
|
286
|
+ taMainUsherRecord.setCustomerId(taCustomerNew.getCustomerId());
|
281
|
287
|
return taMainUsherRecordMapper.insert(taMainUsherRecord) > 0;
|
282
|
288
|
}else {
|
283
|
289
|
|
284
|
290
|
TaMainUsherRecord taMainUsherRecordToday = getTodayRecord(taCustomer.getCustomerId());
|
285
|
|
-
|
|
291
|
+
|
286
|
292
|
if (null == taMainUsherRecordToday) {
|
287
|
293
|
int row = taMainUsherRecordMapper.insert(taMainUsherRecord);
|
288
|
294
|
if (row < 1) {
|
|
@@ -329,9 +335,9 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
|
329
|
335
|
@Override
|
330
|
336
|
public boolean updateByMiniapp(TaMainUsherRecord taMainUsherRecord) throws Exception {
|
331
|
337
|
Integer consultantId = taMainUsherRecord.getConsultantId();
|
332
|
|
- if (null == consultantId || consultantId < 1) {
|
333
|
|
- throw new Exception("置业顾问不能为空");
|
334
|
|
- }
|
|
338
|
+ //if (null == consultantId || consultantId < 1) {
|
|
339
|
+ // throw new Exception("置业顾问不能为空");
|
|
340
|
+ //}
|
335
|
341
|
|
336
|
342
|
if (StringUtils.isEmpty(taMainUsherRecord.getPhone())) {
|
337
|
343
|
throw new Exception("客户电话不能为空");
|
|
@@ -399,7 +405,7 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
|
399
|
405
|
// 如果原来置业为空
|
400
|
406
|
if (null == originConsultant || originConsultant < 1) {
|
401
|
407
|
iTaCustomerService.updateConsultant(taCustomer, consultantId);
|
402
|
|
- } else if (!consultantId.equals(originConsultant)) {
|
|
408
|
+ } else if (null != consultantId && !consultantId.equals(originConsultant)) {
|
403
|
409
|
// 如果临时替换跟踪置业
|
404
|
410
|
// 那么需要给原始置业, 以及临时置业各自发一条消息
|
405
|
411
|
String page = CommConstant.PAGE_MY_CUSTOMER + "?id=" + String.valueOf(taCustomer.getCustomerId());
|
|
@@ -435,6 +441,11 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
|
435
|
441
|
|
436
|
442
|
miniApp.sendTPLMessage(tplId, proxyOpenid, page, dt2);
|
437
|
443
|
}
|
|
444
|
+
|
|
445
|
+ //通知吧台来人了
|
|
446
|
+ cameraService.sendMessageToBar(taCustomer,taMainUsherRecord.getPersonNum());
|
|
447
|
+ //推送置业经理
|
|
448
|
+ cameraService.sendMessageToConsultManager(taCustomer);
|
438
|
449
|
|
439
|
450
|
return row > 0;
|
440
|
451
|
}
|