Kaynağa Gözat

迎宾系统

傅行帆 5 yıl önce
ebeveyn
işleme
1a8249bf47

+ 25
- 2
src/main/java/com.huiju.welcome/controller/TaVisitorAppointmentController.java Dosyayı Görüntüle

@@ -144,7 +144,23 @@ public class TaVisitorAppointmentController extends BaseController {
144 144
         ResponseBean result = taVisitorAppointmentService.visitorAppointmentList(pg,platNumber,personName,phone);
145 145
         return result;
146 146
     }
147
-
147
+    
148
+    @ApiOperation(value = "访客预约信息",notes = "访客预约信息")
149
+    @RequestMapping(value="/miniapp/visitorAppointmentList",method= RequestMethod.GET)
150
+    @ApiImplicitParams({
151
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "platNumber", value = "车牌"),
152
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "personName", value = "预约人姓名"),
153
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "phone", value = "预约人电话")})
154
+    public ResponseBean minappVisitorAppointmentList(@RequestParam(defaultValue = "1") int pageNum,
155
+                                               @RequestParam(defaultValue = "10") int pageSize,
156
+                                               @RequestParam(value = "platNumber",required = false) String platNumber,
157
+                                               @RequestParam(value = "personName",required = false) String personName,
158
+                                               @RequestParam(value = "phone",required = false) String phone){
159
+        IPage<TaVisitorAppointment> pg = new Page<>(pageNum, pageSize);
160
+        ResponseBean result = taVisitorAppointmentService.miniappVisitorAppointmentList(pg,platNumber,personName,phone);
161
+        return result;
162
+    }
163
+    
148 164
     @ApiOperation(value = "访客预约信息",notes = "访客预约信息")
149 165
     @RequestMapping(value="/miniapp/appointment",method= RequestMethod.GET)
150 166
     public ResponseBean myAppointmentList(@RequestParam(defaultValue = "1") int pageNum,
@@ -155,5 +171,12 @@ public class TaVisitorAppointmentController extends BaseController {
155 171
         IPage<TaVisitorAppointment> result = taVisitorAppointmentService.getMyAppointmentList(pageNum, pageSize, user.getPersonId(), nameOrPhone);
156 172
         return ResponseBean.success(result);
157 173
     }
158
-
174
+    
175
+    @ApiOperation(value = "今日访客预约列表",notes = "今日访客预约列表")
176
+    @RequestMapping(value="/miniapp/today/appointments",method= RequestMethod.GET)
177
+    public ResponseBean todayAppointmentList(@RequestParam(defaultValue = "1") int pageNum,
178
+                                          @RequestParam(defaultValue = "10") int pageSize) {
179
+        IPage<TaVisitorAppointment> result = taVisitorAppointmentService.getTodayAppointmentList(pageNum, pageSize);
180
+        return ResponseBean.success(result);
181
+    }
159 182
 }

+ 4
- 0
src/main/java/com.huiju.welcome/mapper/SysUserMapper.java Dosyayı Görüntüle

@@ -6,6 +6,8 @@ import com.huiju.welcome.model.SysUser;
6 6
 import org.apache.ibatis.annotations.Mapper;
7 7
 import org.apache.ibatis.annotations.Param;
8 8
 
9
+import java.util.List;
10
+
9 11
 /**
10 12
  * <p>
11 13
  *  Mapper 接口
@@ -23,4 +25,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
23 25
      * @return
24 26
      */
25 27
     void fireUser(@Param("userId") Integer userId);
28
+	
29
+	List<SysUser> selectConsultManagerList(@Param("identityConsultantManager") String identityConsultantManager);
26 30
 }

+ 5
- 0
src/main/java/com.huiju.welcome/mapper/TaVisitorAppointmentMapper.java Dosyayı Görüntüle

@@ -6,6 +6,7 @@ import com.huiju.welcome.model.TaVisitorAppointment;
6 6
 import org.apache.ibatis.annotations.Mapper;
7 7
 import org.apache.ibatis.annotations.Param;
8 8
 
9
+import java.time.LocalDateTime;
9 10
 import java.util.List;
10 11
 
11 12
 
@@ -21,4 +22,8 @@ public interface TaVisitorAppointmentMapper extends BaseMapper<TaVisitorAppointm
21 22
     IPage<TaVisitorAppointment> visitorAppointmentList(IPage pg, @Param("platNumber") String platNumber, @Param("personName")String personName, @Param("phone")String phone);
22 23
 
23 24
     IPage<TaVisitorAppointment> getMyAppointmentList(IPage<TaVisitorAppointment> page,@Param("createUser") Integer personId, @Param("nameOrPhone") String nameOrPhone);
25
+	
26
+	IPage<TaVisitorAppointment> getTodayAppointmentList(IPage<TaVisitorAppointment> page);
27
+	
28
+	IPage<TaVisitorAppointment> miniappVisitorAppointmentList(IPage<TaVisitorAppointment> pg, String platNumber, String personName, String phone);
24 29
 }

+ 7
- 0
src/main/java/com.huiju.welcome/model/TaVisitorAppointment.java Dosyayı Görüntüle

@@ -1,6 +1,7 @@
1 1
 package com.huiju.welcome.model;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import lombok.Data;
6 7
 import lombok.EqualsAndHashCode;
@@ -42,4 +43,10 @@ public class TaVisitorAppointment {
42 43
     String remark;
43 44
 
44 45
     Integer createUser;
46
+    
47
+    /**
48
+     * 置业顾问姓名
49
+     */
50
+    @TableField(exist = false)
51
+    private String username;
45 52
 }

+ 5
- 0
src/main/java/com.huiju.welcome/service/ICameraService.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
1 1
 package com.huiju.welcome.service;
2 2
 
3
+import com.huiju.welcome.model.TaCustomer;
3 4
 import com.huiju.welcome.model.TaDevice;
4 5
 import com.huiju.welcome.model.TaPerson;
5 6
 import com.huiju.welcome.model.TaSnapshotPerson;
@@ -8,4 +9,8 @@ public interface ICameraService {
8 9
     String dispatchPerson(TaPerson taPerson, TaDevice ...devices);
9 10
 
10 11
     boolean newPersonByDevice(TaSnapshotPerson taSnapshotPerson);
12
+    
13
+    void sendMessageToBar(TaCustomer taCustomer,Integer personNum);
14
+    
15
+    void sendMessageToConsultManager(TaCustomer taCustomer);
11 16
 }

+ 2
- 0
src/main/java/com.huiju.welcome/service/ITaCustomerService.java Dosyayı Görüntüle

@@ -32,6 +32,8 @@ public interface ITaCustomerService extends IService<TaCustomer> {
32 32
     boolean updateConsultant(TaCustomer taCustomer, Integer consultantId);
33 33
 
34 34
     TaCustomer newCustByMainUsher(TaMainUsherRecord taMainUsherRecord, boolean notify) throws Exception;
35
+    
36
+    TaCustomer newCustByFirstUsher(TaFirstUsherRecord taFirstUsherRecord, boolean notify) throws Exception;
35 37
 
36 38
     Map<String, Object> getHistoryRecBy(Map<String,Object> filters);
37 39
 

+ 2
- 0
src/main/java/com.huiju.welcome/service/ITaFirstUsherRecordService.java Dosyayı Görüntüle

@@ -36,4 +36,6 @@ public interface ITaFirstUsherRecordService extends IService<TaFirstUsherRecord>
36 36
     boolean removeRecordByFront(Integer id);
37 37
 
38 38
     boolean addCar2WhiteList(Integer id);
39
+	
40
+	void notifyCar(TaFirstUsherRecord taFirstUsherRecord);
39 41
 }

+ 2
- 0
src/main/java/com.huiju.welcome/service/ITaPersonService.java Dosyayı Görüntüle

@@ -49,6 +49,8 @@ public interface ITaPersonService extends IService<TaPerson> {
49 49
     TaPerson newPersonByFront(TaCustomer taCustomer);
50 50
 
51 51
     TaPerson newPersonByUsher(TaMainUsherRecord taMainUsherRecord);
52
+    
53
+    TaPerson newPersonByFirstUsher(TaFirstUsherRecord taFirstUsherRecord);
52 54
 
53 55
     boolean updateByCustomer(TaCustomer taCustomer);
54 56
 

+ 4
- 0
src/main/java/com.huiju.welcome/service/ITaVisitorAppointmentService.java Dosyayı Görüntüle

@@ -32,4 +32,8 @@ public interface ITaVisitorAppointmentService extends IService<TaVisitorAppointm
32 32
     List<TaVisitorAppointment> getAppointmentsByPlateNumber(String plateNumber);
33 33
 
34 34
     IPage<TaVisitorAppointment> getMyAppointmentList(int pageNum, int pageSize, Integer personId, String nameOrPhone);
35
+	
36
+	IPage<TaVisitorAppointment> getTodayAppointmentList(int pageNum, int pageSize);
37
+	
38
+	ResponseBean miniappVisitorAppointmentList(IPage<TaVisitorAppointment> pg, String platNumber, String personName, String phone);
35 39
 }

+ 110
- 4
src/main/java/com.huiju.welcome/service/impl/CameraServiceImpl.java Dosyayı Görüntüle

@@ -1,8 +1,16 @@
1 1
 package com.huiju.welcome.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.alibaba.fastjson.serializer.SerializerFeature;
3 5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 6
 import com.huiju.welcome.common.Action;
5 7
 import com.huiju.welcome.common.WebSocketServer;
8
+import com.huiju.welcome.mapper.SysUserMapper;
9
+import com.huiju.welcome.mapper.TaCustomerMapMapper;
10
+import com.huiju.welcome.mapper.TaCustomerMapper;
11
+import com.huiju.welcome.model.SysUser;
12
+import com.huiju.welcome.model.TaCustomer;
13
+import com.huiju.welcome.model.TaCustomerMap;
6 14
 import com.huiju.welcome.model.TaDevice;
7 15
 import com.huiju.welcome.model.TaPerson;
8 16
 import com.huiju.welcome.model.TaSnapshotPerson;
@@ -12,12 +20,14 @@ import com.tencentcloudapi.common.exception.TencentCloudSDKException;
12 20
 import io.swagger.models.auth.In;
13 21
 import lombok.extern.slf4j.Slf4j;
14 22
 import org.springframework.beans.factory.annotation.Autowired;
23
+import org.springframework.beans.factory.annotation.Value;
15 24
 import org.springframework.stereotype.Service;
16 25
 
17 26
 import java.net.HttpURLConnection;
18 27
 import java.net.URL;
19 28
 import java.time.Duration;
20 29
 import java.time.LocalDateTime;
30
+import java.util.ArrayList;
21 31
 import java.util.Arrays;
22 32
 import java.util.HashMap;
23 33
 import java.util.List;
@@ -49,6 +59,21 @@ public class CameraServiceImpl implements ICameraService {
49 59
 
50 60
     @Autowired
51 61
     ITaCustomerService iTaCustomerService;
62
+    
63
+    @Value("${unface.device}")
64
+    private String unfaceDevice;
65
+    
66
+    @Autowired
67
+    private TaCustomerMapMapper taCustomerMapMapper;
68
+    
69
+    @Autowired
70
+    private TaCustomerMapper taCustomerMapper;
71
+    
72
+    @Autowired
73
+    private SysUserMapper sysUserMapper;
74
+    
75
+    @Autowired
76
+    MiniApp miniApp;
52 77
 
53 78
     @Override
54 79
     public String dispatchPerson(TaPerson taPerson, TaDevice... devices) {
@@ -135,7 +160,7 @@ public class CameraServiceImpl implements ICameraService {
135 160
             }
136 161
 
137 162
             // 如果是工作人员则忽略
138
-            if (null != taPerson && null != taPerson.getTypeId() && taPerson.getTypeId() == CommConstant.TYPE_INNER_PERSON) {
163
+            if (null != taPerson && null != taPerson.getTypeId() && taPerson.getTypeId().equals(CommConstant.TYPE_INNER_PERSON)) {
139 164
                 taSnapshotPerson.setMatchPerson(taPerson.getRealId());
140 165
                 taSnapshotPersonService.save(taSnapshotPerson);
141 166
                 return true;
@@ -173,8 +198,13 @@ public class CameraServiceImpl implements ICameraService {
173 198
             dispatchPerson(taPerson);
174 199
         }
175 200
 
176
-        // 推送消息
177
-        taPersonService.send2Front(taPerson);
201
+        //二号岗设备推送
202
+        if(taSnapshotPerson.getDeviceId().equals(unfaceDevice)){
203
+            sendMessageToConsult(taPerson);
204
+        }else{
205
+            // 推送消息
206
+            taPersonService.send2Front(taPerson);
207
+        }
178 208
 
179 209
         // 保存抓拍日志
180 210
         taSnapshotPersonService.save(taSnapshotPerson);
@@ -191,4 +221,80 @@ public class CameraServiceImpl implements ICameraService {
191 221
 
192 222
         return true;
193 223
     }
194
-}
224
+    
225
+    /**
226
+     * 二号岗亭推送消息给置业经理,如果是老客户还需要推送给这个客户的置业顾问。同时都要推送给吧台。
227
+     * @param taPerson
228
+     */
229
+    private void sendMessageToConsult(TaPerson taPerson) {
230
+        TaCustomerMap taCustomerMap = taCustomerMapMapper.getCustomerOf(taPerson.getPersonId());
231
+        if (null != taCustomerMap){
232
+            TaCustomer taCustomer = taCustomerMapper.selectById(taCustomerMap.getCustomerId());
233
+            if (null != taCustomer){
234
+                try {
235
+                    //推送置业顾问
236
+                    iTaCustomerService.notifyConsultant(taCustomer);
237
+                    //推送置业经理
238
+                    sendMessageToConsultManager(taCustomer);
239
+                    //推送吧台
240
+                    sendMessageToBar(taCustomer,null);
241
+                } catch (Exception e) {
242
+                    e.printStackTrace();
243
+                }
244
+            }
245
+        }else {
246
+            //推送人脸到二号岗
247
+            sendMessageToMainusher(taPerson);
248
+        }
249
+    }
250
+    
251
+    /**
252
+     * 推送人脸数据到二号岗
253
+     * @param taPerson
254
+     */
255
+    private void sendMessageToMainusher(TaPerson taPerson) {
256
+        try {
257
+            WebSocketServer.sendInfo(JSONObject.toJSONString(taPerson), CommConstant.WECHAT_CLIENT_MAINUSHER, null);
258
+        } catch (Exception e) {}
259
+    }
260
+    
261
+    /**
262
+     * 推送消息去吧台
263
+     * @param taCustomer
264
+     */
265
+    @Override
266
+    public void sendMessageToBar(TaCustomer taCustomer,Integer personNum) {
267
+        Map<String,Object> map = new HashMap<>();
268
+        map.put("customerId",taCustomer.getCustomerId());
269
+        map.put("customerName",taCustomer.getCustomerName());
270
+        map.put("consultantName",taCustomer.getRealtyConsultant());
271
+        map.put("avatar",taCustomer.getAvatar());
272
+        map.put("visitorNum",personNum);
273
+        map.put("visitorTime",LocalDateTime.now());
274
+        map.put("type",CommConstant.IDENTITY_BARUSHER);
275
+        try {
276
+            WebSocketServer.sendInfo(JSONObject.toJSONString(map), CommConstant.WECHAT_CLIENT_MINIAPP, null);
277
+        } catch (Exception e) {}
278
+    }
279
+    
280
+    @Override
281
+    public void sendMessageToConsultManager(TaCustomer taCustomer) {
282
+        //获取所有的置业经理信息并推送消息
283
+        List<SysUser> sysUserList = sysUserMapper.selectConsultManagerList(CommConstant.IDENTITY_CONSULTANT_MANAGER);
284
+        sysUserList.stream().forEach(e -> {
285
+            String tpl = miniApp.getTpls().getVisitor();
286
+            String page = CommConstant.PAGE_MY_CUSTOMER + "?id=" + taCustomer.getCustomerId();
287
+            String openid = e.getOpenid();
288
+            if (null == openid) {
289
+                return;
290
+            }
291
+            List<Object> data = new ArrayList<Object>(){{
292
+                add(taCustomer.getCustomerName());
293
+                add(taCustomer.getPhone());
294
+                add("您有客户来访, 请及时接待!");
295
+            }};
296
+    
297
+            miniApp.sendTPLMessage(tpl, openid, page, data);
298
+        });
299
+    }
300
+}

+ 1
- 1
src/main/java/com.huiju.welcome/service/impl/TaCarRecordServiceImpl.java Dosyayı Görüntüle

@@ -200,7 +200,7 @@ public class TaCarRecordServiceImpl extends ServiceImpl<TaCarRecordMapper, TaCar
200 200
 
201 201
         // 生成保安迎宾记录, 并通知小程序
202 202
         TaFirstUsherRecord taFirstUsherRecord = iTaFirstUsherRecordService.newRecordByDevice(taCarRecord);
203
-        iTaFirstUsherRecordService.notifyMiniapp(taFirstUsherRecord);
203
+        iTaFirstUsherRecordService.notifyCar(taFirstUsherRecord);
204 204
 
205 205
         // 如果客户有固定置业, 推送消息给置业
206 206
         if (null != taCustomer && null != taCustomer.getConsultantId()) {

+ 72
- 7
src/main/java/com.huiju.welcome/service/impl/TaCustomerServiceImpl.java Dosyayı Görüntüle

@@ -73,6 +73,9 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
73 73
     
74 74
     @Autowired
75 75
     private ISysDictService iSysDictService;
76
+    
77
+    @Autowired
78
+    ICameraService cameraService;
76 79
 
77 80
     @Override
78 81
     public List<TaPerson> getGroup(Integer customerId) {
@@ -207,7 +210,7 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
207 210
             personId = taPerson.getRealId();
208 211
             taMainUsherRecord.setPersonId(personId);
209 212
         }
210
-
213
+        
211 214
         Integer custId = taMainUsherRecord.getCustomerId();
212 215
         TaCustomer cust;
213 216
         if (null == custId) {
@@ -215,32 +218,94 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
215 218
             if (!insertCustomer(cust)) {
216 219
                 throw new Exception("新增客户信息失败");
217 220
             }
218
-
221
+            
219 222
             taMainUsherRecord.setCustomerId(cust.getCustomerId());
220 223
         } else {
221 224
             cust = taCustomerMapper.selectById(custId);
222 225
         }
223
-
226
+        
224 227
         TaCustomerMap taCustomerMap = taCustomerMapMapper.getCustomerOf(personId);
225 228
         if (null == taCustomerMap) {
226 229
             TaCustomerMap custMap = new TaCustomerMap();
227 230
             custMap.setCustomerId(cust.getCustomerId());
228 231
             custMap.setPersonId(taMainUsherRecord.getPersonId());
229
-
232
+            
230 233
             int row = taCustomerMapMapper.insert(custMap);
231 234
             if (row <= 0) {
232 235
                 throw new Exception("生成置业客户映射失败");
233 236
             }
234 237
         }
235
-
238
+        
236 239
         // 发消息给置业
237 240
         if (null != cust.getConsultantId() && notify) {
238 241
             notifyConsultant(cust);
239 242
         }
240
-
243
+    
244
+        if (notify){
245
+            //通知吧台来人了
246
+            cameraService.sendMessageToBar(cust,taMainUsherRecord.getPersonNum());
247
+            //推送置业经理
248
+            cameraService.sendMessageToConsultManager(cust);
249
+        }
250
+        
241 251
         return cust;
242 252
     }
243
-
253
+    
254
+    @Override
255
+    public TaCustomer newCustByFirstUsher(TaFirstUsherRecord taFirstUsherRecord, boolean notify) throws Exception {
256
+        Integer personId = taFirstUsherRecord.getPersonId();
257
+        if (null == personId) {
258
+            TaPerson taPerson = iTaPersonService.newPersonByFirstUsher(taFirstUsherRecord);
259
+            personId = taPerson.getRealId();
260
+            taFirstUsherRecord.setPersonId(personId);
261
+        }
262
+        
263
+        TaCustomer cust = copyDataFromFirstUsher(taFirstUsherRecord);
264
+        if (!insertCustomer(cust)) {
265
+            throw new Exception("新增客户信息失败");
266
+        }
267
+        
268
+        TaCustomerMap taCustomerMap = taCustomerMapMapper.getCustomerOf(personId);
269
+        if (null == taCustomerMap) {
270
+            TaCustomerMap custMap = new TaCustomerMap();
271
+            custMap.setCustomerId(cust.getCustomerId());
272
+            custMap.setPersonId(taFirstUsherRecord.getPersonId());
273
+            
274
+            int row = taCustomerMapMapper.insert(custMap);
275
+            if (row <= 0) {
276
+                throw new Exception("生成置业客户映射失败");
277
+            }
278
+        }
279
+        
280
+        // 发消息给置业
281
+        if (null != cust.getConsultantId() && notify) {
282
+            notifyConsultant(cust);
283
+        }
284
+        if (notify){
285
+            //通知吧台来人了
286
+            cameraService.sendMessageToBar(cust,taFirstUsherRecord.getPersonNum());
287
+            //推送置业经理
288
+            cameraService.sendMessageToConsultManager(cust);
289
+        }
290
+        
291
+        return cust;
292
+    }
293
+    
294
+    private TaCustomer copyDataFromFirstUsher(TaFirstUsherRecord taFirstUsherRecord) {
295
+        TaCustomer taCustomer = new TaCustomer();
296
+        taCustomer.setCustomerId(taFirstUsherRecord.getPersonId());       // 默认客户ID与人员ID一致
297
+        taCustomer.setCustomerName(taFirstUsherRecord.getPersonName());
298
+        taCustomer.setPhone(taFirstUsherRecord.getPhone());
299
+        taCustomer.setPlateNumber(taFirstUsherRecord.getPlateNumber());
300
+        taCustomer.setCarModel(taFirstUsherRecord.getCarModel());
301
+        taCustomer.setChannel(taFirstUsherRecord.getChannel());
302
+        taCustomer.setPurpose(taFirstUsherRecord.getPurpose());
303
+        taCustomer.setStatus(StatusUtils.Normal);
304
+        taCustomer.setCreateDate(LocalDateTime.now());
305
+    
306
+        return taCustomer;
307
+    }
308
+    
244 309
     @Override
245 310
     public Map<String, Object> getHistoryRecBy(Map<String, Object> filters) {
246 311
         String phone = filters.get("phone").toString();

+ 25
- 1
src/main/java/com.huiju.welcome/service/impl/TaFirstUsherRecordServiceImpl.java Dosyayı Görüntüle

@@ -9,6 +9,7 @@ import com.huiju.welcome.common.Action;
9 9
 import com.huiju.welcome.common.WebSocketServer;
10 10
 import com.huiju.welcome.mapper.TaFirstUsherRecordMapper;
11 11
 import com.huiju.welcome.model.*;
12
+import com.huiju.welcome.service.ICameraService;
12 13
 import com.huiju.welcome.service.ITaCarService;
13 14
 import com.huiju.welcome.service.ITaCustomerService;
14 15
 import com.huiju.welcome.service.ITaFirstUsherRecordService;
@@ -44,6 +45,9 @@ public class TaFirstUsherRecordServiceImpl extends ServiceImpl<TaFirstUsherRecor
44 45
 
45 46
     @Autowired
46 47
     ITaCarService iTaCarService;
48
+    
49
+    @Autowired
50
+    ICameraService cameraService;
47 51
 
48 52
     @Override
49 53
     public boolean updateNormal(List<TaFirstUsherRecord> records) {
@@ -89,6 +93,14 @@ public class TaFirstUsherRecordServiceImpl extends ServiceImpl<TaFirstUsherRecor
89 93
             WebSocketServer.sendInfo(act.toJSON(), CommConstant.WECHAT_CLIENT_MINIAPP, null);
90 94
         } catch (Exception e) {}
91 95
     }
96
+    
97
+    @Override
98
+    public void notifyCar(TaFirstUsherRecord taFirstUsherRecord) {
99
+        Action act = Action.create(Action.TYPE_NEW_FIRST_USHER, JSONObject.toJSONString(taFirstUsherRecord, SerializerFeature.WriteMapNullValue));
100
+        try {
101
+            WebSocketServer.sendInfo(act.toJSON(), CommConstant.WECHAT_CLIENT_MINIAPP, null);
102
+        } catch (Exception e) {}
103
+    }
92 104
 
93 105
     @Override
94 106
     public boolean newRecordByMiniapp(TaFirstUsherRecord taFirstUsherRecord) {
@@ -122,7 +134,17 @@ public class TaFirstUsherRecordServiceImpl extends ServiceImpl<TaFirstUsherRecor
122 134
 
123 135
         // 查找客户
124 136
         TaCustomer taCustomer = iTaCustomerService.getByPhoneOrPlate(taFirstUsherRecord.getPhone(), taFirstUsherRecord.getPlateNumber());
125
-        if (null == taCustomer) return true;
137
+        if (null == taCustomer) {
138
+            if (!StringUtils.isEmpty(taFirstUsherRecord.getPhone())){
139
+                try {
140
+                    taCustomer = iTaCustomerService.newCustByFirstUsher(taFirstUsherRecord,true);
141
+                } catch (Exception e) {
142
+                    e.printStackTrace();
143
+                }
144
+            }else {
145
+                return true;
146
+            }
147
+        }
126 148
 
127 149
         // 更新车型
128 150
         if (null != taFirstUsherRecord.getCarModel()) {
@@ -208,6 +230,8 @@ public class TaFirstUsherRecordServiceImpl extends ServiceImpl<TaFirstUsherRecor
208 230
                 TaCustomer taCustomer = taCustomerList.get(0);
209 231
                 try {
210 232
                     iTaCustomerService.notifyConsultant(taCustomer);
233
+                    //通知吧台来人了
234
+                    cameraService.sendMessageToBar(taCustomer,taFirstUsherRecord.getPersonNum());
211 235
                 } catch (Exception e) {}
212 236
             }
213 237
         }

+ 19
- 0
src/main/java/com.huiju.welcome/service/impl/TaPersonServiceImpl.java Dosyayı Görüntüle

@@ -297,6 +297,25 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
297 297
 
298 298
         return taPerson;
299 299
     }
300
+    
301
+    @Override
302
+    public TaPerson newPersonByFirstUsher(TaFirstUsherRecord taFirstUsherRecord) {
303
+        TaPerson taPerson = new TaPerson();
304
+        taPerson.setPhone(taFirstUsherRecord.getPhone());
305
+        taPerson.setName(taFirstUsherRecord.getPersonName());
306
+        taPerson.setStatus(StatusUtils.Normal);
307
+        taPerson.setCreateDate(LocalDateTime.now());
308
+        
309
+        // 直接是VIP
310
+        taPerson.setTypeId(2);
311
+        int row = taPersonMapper.insert(taPerson);
312
+        if (row < 0) return null;
313
+        
314
+        taPerson.setRealId(taPerson.getPersonId());
315
+        taPersonMapper.updateById(taPerson);
316
+        
317
+        return taPerson;
318
+    }
300 319
 
301 320
     @Override
302 321
     public boolean updateByCustomer(TaCustomer taCustomer) {

+ 17
- 1
src/main/java/com.huiju.welcome/service/impl/TaVisitorAppointmentServiceImpl.java Dosyayı Görüntüle

@@ -72,7 +72,23 @@ public class TaVisitorAppointmentServiceImpl extends ServiceImpl<TaVisitorAppoin
72 72
 
73 73
         return result;
74 74
     }
75
-
75
+    
76
+    @Override
77
+    public IPage<TaVisitorAppointment> getTodayAppointmentList(int pageNum, int pageSize) {
78
+        IPage<TaVisitorAppointment> page = new Page<>(pageNum, pageSize);
79
+        IPage<TaVisitorAppointment> result = taVisitorAppointmentMapper.getTodayAppointmentList(page);
80
+    
81
+        return result;
82
+    }
83
+    
84
+    @Override
85
+    public ResponseBean miniappVisitorAppointmentList(IPage<TaVisitorAppointment> pg, String platNumber, String personName, String phone) {
86
+        ResponseBean responseBean= new ResponseBean();
87
+        IPage<TaVisitorAppointment> list= taVisitorAppointmentMapper.miniappVisitorAppointmentList(pg,platNumber,personName,phone);
88
+        responseBean.addSuccess(list);
89
+        return responseBean;
90
+    }
91
+    
76 92
     @Override
77 93
     public ResponseBean visitorAppointmentList(IPage pg, String platNumber, String personName,String phone) {
78 94
        ResponseBean responseBean= new ResponseBean();

+ 3
- 0
src/main/java/com.huiju.welcome/utils/CommConstant.java Dosyayı Görüntüle

@@ -10,6 +10,9 @@ public class CommConstant {
10 10
     public final static String PAGE_MY_CUSTOMER = "pages/client/clientdetail/clientdetail";
11 11
 
12 12
     public final static String WECHAT_CLIENT_MINIAPP = "miniapp";
13
+    public final static String WECHAT_CLIENT_CAR = "car";
14
+    public final static String WECHAT_CLIENT_BAR = "bar";
15
+    public final static String WECHAT_CLIENT_MAINUSHER = "mainusher";
13 16
 
14 17
     public final static Integer TYPE_NEW_PERSON = 1;
15 18
     public final static Integer TYPE_VIP_PERSON = 2;

+ 4
- 0
src/main/resources/application.yml Dosyayı Görüntüle

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

+ 15
- 0
src/main/resources/mapper/SysUserMapper.xml Dosyayı Görüntüle

@@ -17,4 +17,19 @@
17 17
         set status = -1, in_service = 0
18 18
         where user_id = #{userId}
19 19
     </update>
20
+
21
+    <select id="selectConsultManagerList" resultType="com.huiju.welcome.model.SysUser">
22
+        SELECT
23
+            s.user_id,
24
+            w.openid,
25
+            s.create_date,
26
+            s.user_identity
27
+        FROM
28
+            sys_user s
29
+            LEFT JOIN ta_wechat_user w ON w.person_id = s.user_id
30
+        WHERE
31
+            1 = 1
32
+            AND s.user_identity = #{identityConsultantManager}
33
+            AND s.STATUS = 1
34
+    </select>
20 35
 </mapper>

+ 21
- 0
src/main/resources/mapper/TaVisitorAppointmentMapper.xml Dosyayı Görüntüle

@@ -47,4 +47,25 @@
47 47
             t.create_date DESC
48 48
     </select>
49 49
 
50
+    <select id="getTodayAppointmentList" resultType="com.huiju.welcome.model.TaVisitorAppointment">
51
+        SELECT
52
+            *
53
+        FROM
54
+            ta_visitor_appointment t
55
+        WHERE
56
+            t.STATUS > 0
57
+            AND ( DATE_FORMAT( visit_date, '%Y-%m-%d' ) = DATE_FORMAT( now( ), '%Y-%m-%d' ) OR visit_date IS NULL )
58
+        ORDER BY
59
+            t.create_date DESC
60
+    </select>
61
+
62
+    <select id="miniappVisitorAppointmentList" resultType="com.huiju.welcome.model.TaVisitorAppointment">
63
+        SELECT
64
+            v.*,
65
+            s.username
66
+        FROM
67
+            ta_visitor_appointment v
68
+            LEFT JOIN sys_user s ON v.create_user = s.user_id
69
+        order by v.create_date desc
70
+    </select>
50 71
 </mapper>