傅行帆 5 years ago
parent
commit
c7f3f754ba

+ 14
- 17
src/main/java/com.huiju.welcome/service/impl/CameraServiceImpl.java View File

60
     @Autowired
60
     @Autowired
61
     ITaCustomerService iTaCustomerService;
61
     ITaCustomerService iTaCustomerService;
62
     
62
     
63
-    @Value("${unface.device}")
64
-    private String unfaceDevice;
65
-    
66
     @Autowired
63
     @Autowired
67
     private TaCustomerMapMapper taCustomerMapMapper;
64
     private TaCustomerMapMapper taCustomerMapMapper;
68
     
65
     
199
         }
196
         }
200
 
197
 
201
         //二号岗设备推送
198
         //二号岗设备推送
202
-        if(taSnapshotPerson.getDeviceId().equals(unfaceDevice)){
199
+        TaDevice taDevice = taDeviceService.getById(taSnapshotPerson.getDeviceId());
200
+        if(taDevice.getAfr().equals(CommConstant.DEVICE_AFR_UNFACE)){
203
             sendMessageToConsult(taPerson);
201
             sendMessageToConsult(taPerson);
202
+    
203
+            // 预写到访日志
204
+            visitingLogService.newLogByDevice(taSnapshotPerson, taPerson);
205
+    
206
+            // 判断是否客户来访
207
+            try {
208
+                iTaCustomerService.judgeNewCust(taPerson);
209
+            } catch (Exception e) {
210
+                log.error(e.getMessage());
211
+            }
204
         }else{
212
         }else{
205
             // 推送消息
213
             // 推送消息
206
             taPersonService.send2Front(taPerson);
214
             taPersonService.send2Front(taPerson);
209
         // 保存抓拍日志
217
         // 保存抓拍日志
210
         taSnapshotPersonService.save(taSnapshotPerson);
218
         taSnapshotPersonService.save(taSnapshotPerson);
211
 
219
 
212
-        // 预写到访日志
213
-        visitingLogService.newLogByDevice(taSnapshotPerson, taPerson);
214
-
215
-        // 判断是否客户来访
216
-        try {
217
-            iTaCustomerService.judgeNewCust(taPerson);
218
-        } catch (Exception e) {
219
-            log.error(e.getMessage());
220
-        }
221
-
222
         return true;
220
         return true;
223
     }
221
     }
224
     
222
     
242
                     e.printStackTrace();
240
                     e.printStackTrace();
243
                 }
241
                 }
244
             }
242
             }
245
-        }else {
246
-            //推送人脸到二号岗
247
-            sendMessageToMainusher(taPerson);
248
         }
243
         }
244
+        //推送人脸到二号岗
245
+        sendMessageToMainusher(taPerson);
249
     }
246
     }
250
     
247
     
251
     /**
248
     /**

+ 23
- 12
src/main/java/com.huiju.welcome/service/impl/TaMainUsherRecordServiceImpl.java View File

15
 import com.huiju.welcome.common.base.ResponseBean;
15
 import com.huiju.welcome.common.base.ResponseBean;
16
 import com.huiju.welcome.model.TaCustomer;
16
 import com.huiju.welcome.model.TaCustomer;
17
 import com.huiju.welcome.model.TaMainUsherRecord;
17
 import com.huiju.welcome.model.TaMainUsherRecord;
18
+import com.huiju.welcome.service.ICameraService;
18
 import com.huiju.welcome.service.ITaCustomerService;
19
 import com.huiju.welcome.service.ITaCustomerService;
19
 import com.huiju.welcome.service.ITaMainUsherRecordService;
20
 import com.huiju.welcome.service.ITaMainUsherRecordService;
20
 import com.huiju.welcome.service.ITaPersonService;
21
 import com.huiju.welcome.service.ITaPersonService;
67
 
68
 
68
     @Autowired
69
     @Autowired
69
     MiniApp miniApp;
70
     MiniApp miniApp;
71
+    
72
+    @Autowired
73
+    ICameraService cameraService;
70
 
74
 
71
     @Override
75
     @Override
72
     public boolean updateNormal(List<TaMainUsherRecord> records) {
76
     public boolean updateNormal(List<TaMainUsherRecord> records) {
244
     @Override
248
     @Override
245
     public boolean newRecordByMiniapp(TaMainUsherRecord taMainUsherRecord) throws Exception {
249
     public boolean newRecordByMiniapp(TaMainUsherRecord taMainUsherRecord) throws Exception {
246
         Integer consultantId = taMainUsherRecord.getConsultantId();
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
         if (StringUtils.isEmpty(taMainUsherRecord.getPhone())) {
255
         if (StringUtils.isEmpty(taMainUsherRecord.getPhone())) {
252
             throw new Exception("客户电话不能为空");
256
             throw new Exception("客户电话不能为空");
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
         if (null == taCustomer){
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
             return taMainUsherRecordMapper.insert(taMainUsherRecord) > 0;
287
             return taMainUsherRecordMapper.insert(taMainUsherRecord) > 0;
282
         }else {
288
         }else {
283
     
289
     
284
             TaMainUsherRecord taMainUsherRecordToday = getTodayRecord(taCustomer.getCustomerId());
290
             TaMainUsherRecord taMainUsherRecordToday = getTodayRecord(taCustomer.getCustomerId());
285
-    
291
+            
286
             if (null == taMainUsherRecordToday) {
292
             if (null == taMainUsherRecordToday) {
287
                 int row = taMainUsherRecordMapper.insert(taMainUsherRecord);
293
                 int row = taMainUsherRecordMapper.insert(taMainUsherRecord);
288
                 if (row < 1) {
294
                 if (row < 1) {
329
     @Override
335
     @Override
330
     public boolean updateByMiniapp(TaMainUsherRecord taMainUsherRecord) throws Exception {
336
     public boolean updateByMiniapp(TaMainUsherRecord taMainUsherRecord) throws Exception {
331
         Integer consultantId = taMainUsherRecord.getConsultantId();
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
         if (StringUtils.isEmpty(taMainUsherRecord.getPhone())) {
342
         if (StringUtils.isEmpty(taMainUsherRecord.getPhone())) {
337
             throw new Exception("客户电话不能为空");
343
             throw new Exception("客户电话不能为空");
399
         // 如果原来置业为空
405
         // 如果原来置业为空
400
         if (null == originConsultant || originConsultant < 1) {
406
         if (null == originConsultant || originConsultant < 1) {
401
             iTaCustomerService.updateConsultant(taCustomer, consultantId);
407
             iTaCustomerService.updateConsultant(taCustomer, consultantId);
402
-        } else if (!consultantId.equals(originConsultant)) {
408
+        } else if (null != consultantId && !consultantId.equals(originConsultant)) {
403
             // 如果临时替换跟踪置业
409
             // 如果临时替换跟踪置业
404
             // 那么需要给原始置业, 以及临时置业各自发一条消息
410
             // 那么需要给原始置业, 以及临时置业各自发一条消息
405
             String page = CommConstant.PAGE_MY_CUSTOMER + "?id=" + String.valueOf(taCustomer.getCustomerId());
411
             String page = CommConstant.PAGE_MY_CUSTOMER + "?id=" + String.valueOf(taCustomer.getCustomerId());
435
 
441
 
436
             miniApp.sendTPLMessage(tplId, proxyOpenid, page, dt2);
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
         return row > 0;
450
         return row > 0;
440
     }
451
     }

+ 2
- 0
src/main/java/com.huiju.welcome/utils/CommConstant.java View File

18
     public final static Integer TYPE_NEW_PERSON = 1;
18
     public final static Integer TYPE_NEW_PERSON = 1;
19
     public final static Integer TYPE_VIP_PERSON = 2;
19
     public final static Integer TYPE_VIP_PERSON = 2;
20
     public final static Integer TYPE_INNER_PERSON = 3;
20
     public final static Integer TYPE_INNER_PERSON = 3;
21
+    
22
+    public final static String DEVICE_AFR_UNFACE = "0";
21
 
23
 
22
     public final static String TYPE_CAR_NORMAL = "normal";
24
     public final static String TYPE_CAR_NORMAL = "normal";
23
     public final static String TYPE_CAR_INNER = "inner";
25
     public final static String TYPE_CAR_INNER = "inner";

+ 1
- 5
src/main/resources/application.yml View File

94
     # 验证码长度
94
     # 验证码长度
95
     size: 4
95
     size: 4
96
     # 短信签名
96
     # 短信签名
97
-    sign: AI智慧案场
98
-
99
-# 二号岗设备不具备人脸比对功能
100
-unface:
101
-  device: 216
97
+    sign: AI智慧案场