傅行帆 5 年前
父节点
当前提交
c7f3f754ba

+ 14
- 17
src/main/java/com.huiju.welcome/service/impl/CameraServiceImpl.java 查看文件

@@ -60,9 +60,6 @@ public class CameraServiceImpl implements ICameraService {
60 60
     @Autowired
61 61
     ITaCustomerService iTaCustomerService;
62 62
     
63
-    @Value("${unface.device}")
64
-    private String unfaceDevice;
65
-    
66 63
     @Autowired
67 64
     private TaCustomerMapMapper taCustomerMapMapper;
68 65
     
@@ -199,8 +196,19 @@ public class CameraServiceImpl implements ICameraService {
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 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 212
         }else{
205 213
             // 推送消息
206 214
             taPersonService.send2Front(taPerson);
@@ -209,16 +217,6 @@ public class CameraServiceImpl implements ICameraService {
209 217
         // 保存抓拍日志
210 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 220
         return true;
223 221
     }
224 222
     
@@ -242,10 +240,9 @@ public class CameraServiceImpl implements ICameraService {
242 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 查看文件

@@ -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
     }

+ 2
- 0
src/main/java/com.huiju.welcome/utils/CommConstant.java 查看文件

@@ -18,6 +18,8 @@ public class CommConstant {
18 18
     public final static Integer TYPE_NEW_PERSON = 1;
19 19
     public final static Integer TYPE_VIP_PERSON = 2;
20 20
     public final static Integer TYPE_INNER_PERSON = 3;
21
+    
22
+    public final static String DEVICE_AFR_UNFACE = "0";
21 23
 
22 24
     public final static String TYPE_CAR_NORMAL = "normal";
23 25
     public final static String TYPE_CAR_INNER = "inner";

+ 1
- 5
src/main/resources/application.yml 查看文件

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