|
@@ -0,0 +1,414 @@
|
|
1
|
+package com.community.huiju.service.impl;
|
|
2
|
+
|
|
3
|
+import com.alibaba.fastjson.JSONObject;
|
|
4
|
+import com.community.commom.hk.HKOpenApi;
|
|
5
|
+import com.community.commom.mode.ResponseBean;
|
|
6
|
+import com.community.commom.uuid.IdGen;
|
|
7
|
+import com.community.huiju.dao.*;
|
|
8
|
+import com.community.huiju.exception.WisdomException;
|
|
9
|
+import com.community.huiju.model.*;
|
|
10
|
+import com.community.huiju.service.IHKService;
|
|
11
|
+import com.community.huiju.service.ISenCartId;
|
|
12
|
+import com.google.common.collect.Maps;
|
|
13
|
+import lombok.extern.slf4j.Slf4j;
|
|
14
|
+import org.apache.commons.collections.CollectionUtils;
|
|
15
|
+import org.apache.commons.lang.StringUtils;
|
|
16
|
+import org.bouncycastle.cms.PasswordRecipientId;
|
|
17
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
18
|
+import org.springframework.stereotype.Service;
|
|
19
|
+import org.springframework.web.multipart.MultipartFile;
|
|
20
|
+
|
|
21
|
+import java.text.ParseException;
|
|
22
|
+import java.text.SimpleDateFormat;
|
|
23
|
+import java.time.LocalDate;
|
|
24
|
+import java.util.*;
|
|
25
|
+import java.util.stream.Collectors;
|
|
26
|
+
|
|
27
|
+/**
|
|
28
|
+ * weiximei on 2019-06-21
|
|
29
|
+ */
|
|
30
|
+@Service
|
|
31
|
+@Slf4j
|
|
32
|
+public class SenCartIdImpl implements ISenCartId {
|
|
33
|
+
|
|
34
|
+ @Autowired
|
|
35
|
+ private IHKService ihkService;
|
|
36
|
+
|
|
37
|
+ @Autowired
|
|
38
|
+ private TaUserMapper taUserMapper;
|
|
39
|
+
|
|
40
|
+ @Autowired
|
|
41
|
+ private TpUnitHkSettingMapper tpUnitHkSettingMapper;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+ @Autowired
|
|
45
|
+ private TpEquipmentTreeMapper tpEquipmentTreeMapper;
|
|
46
|
+
|
|
47
|
+ private IdGen idGen = IdGen.get();
|
|
48
|
+
|
|
49
|
+ @Autowired
|
|
50
|
+ private TaUserHkMapper taUserHkMapper;
|
|
51
|
+
|
|
52
|
+ @Autowired
|
|
53
|
+ private TpEquipmentMapper tpEquipmentMapper;
|
|
54
|
+
|
|
55
|
+ @Autowired
|
|
56
|
+ private TpConfigurationMapper tpConfigurationMapper;
|
|
57
|
+
|
|
58
|
+ @Override
|
|
59
|
+ public ResponseBean addUserAndAddCartId(Integer communityId) {
|
|
60
|
+ ResponseBean responseBean = new ResponseBean();
|
|
61
|
+
|
|
62
|
+ // 查询审核已通过的,但是没有海康id的
|
|
63
|
+ List<TaUser> taUserList = taUserMapper.selectNotHKuserId(communityId);
|
|
64
|
+
|
|
65
|
+ for (TaUser user : taUserList) {
|
|
66
|
+
|
|
67
|
+ // 海康权限信息
|
|
68
|
+ TpUnitHkSetting unitHkSetting = getUnitHkSetting(communityId, user.getUnitId());
|
|
69
|
+
|
|
70
|
+ TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(communityId);
|
|
71
|
+
|
|
72
|
+ TaUserHk taUserHk = new TaUserHk();
|
|
73
|
+ // 设置 海康id
|
|
74
|
+ taUserHk.setHkPersonNo(idGen.nextId());
|
|
75
|
+ /**
|
|
76
|
+ * 1.获取部门(比如 住户)
|
|
77
|
+ * 2.根据部门编号推送 海康
|
|
78
|
+ */
|
|
79
|
+ taUserMapper.updateByPrimaryKeySelective(user);
|
|
80
|
+ addUserAndOpenCard(responseBean, user, tpEquipmentTree, taUserHk, unitHkSetting);
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+ // 卡片操作
|
|
84
|
+
|
|
85
|
+ // 添加卡片
|
|
86
|
+ responseBean = addCards(taUserHk, tpEquipmentTree);
|
|
87
|
+
|
|
88
|
+ // 开卡
|
|
89
|
+ responseBean = openCard(taUserHk.getHkUserId(), Long.valueOf(taUserHk.getHkCardNo()), null,tpEquipmentTree);
|
|
90
|
+
|
|
91
|
+ }
|
|
92
|
+
|
|
93
|
+ responseBean.addSuccess("操作成功!");
|
|
94
|
+ return responseBean;
|
|
95
|
+ }
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+ /**
|
|
99
|
+ * 海康权限组
|
|
100
|
+ * @return
|
|
101
|
+ */
|
|
102
|
+ private TpUnitHkSetting getUnitHkSetting(Integer communityId, Integer unitId) {
|
|
103
|
+ TpUnitHkSetting tpUnitHkSetting = tpUnitHkSettingMapper.selectByCommunityIdAndUnitId(communityId, unitId);
|
|
104
|
+ if (null == tpUnitHkSetting) {
|
|
105
|
+ throw new WisdomException("权限组未配置");
|
|
106
|
+ }
|
|
107
|
+ return tpUnitHkSetting;
|
|
108
|
+ }
|
|
109
|
+
|
|
110
|
+ /**
|
|
111
|
+ * 公共方法
|
|
112
|
+ * 添加人员
|
|
113
|
+ *
|
|
114
|
+ * @param response
|
|
115
|
+ * @param user
|
|
116
|
+ */
|
|
117
|
+ private void addUserAndOpenCard(ResponseBean response, TaUser user, TpEquipmentTree tpEquipmentTree, TaUserHk taUserHk, TpUnitHkSetting unitHkSetting) {
|
|
118
|
+// Map<String, Object> parDept = Maps.newHashMap();
|
|
119
|
+// parDept.put("pageNo", 1);
|
|
120
|
+// parDept.put("pageSize", 100);
|
|
121
|
+// parDept.put("deptName", Constant.DEPT_RESIDENTS);
|
|
122
|
+// parDept.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
123
|
+// parDept.put("appkey", tpEquipmentTree.getAppkey());
|
|
124
|
+// parDept.put("secret", tpEquipmentTree.getSecret());
|
|
125
|
+// parDept.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
126
|
+ // 部门UUID
|
|
127
|
+ //String deptUuid = getDeptUUID(parDept);
|
|
128
|
+
|
|
129
|
+ // 添加人员
|
|
130
|
+ Map<String, Object> parUser = Maps.newHashMap();
|
|
131
|
+ parUser.put("personNo", taUserHk.getHkPersonNo());
|
|
132
|
+ parUser.put("personName", user.getUserName());
|
|
133
|
+ // parUser.put("phoneNo", user.getLoginName());
|
|
134
|
+ parUser.put("remark", user.getLoginName());
|
|
135
|
+ parUser.put("deptUuid", unitHkSetting.getDepartmentId());
|
|
136
|
+ parUser.put("secret", tpEquipmentTree.getSecret());
|
|
137
|
+ parUser.put("appkey", tpEquipmentTree.getAppkey());
|
|
138
|
+ parUser.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
139
|
+ parUser.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
140
|
+ Map<String, Object> resultMap = JSONObject.parseObject(HKOpenApi.addUser(parUser), HashMap.class);
|
|
141
|
+ Integer errorCode = (Integer) resultMap.get("errorCode");
|
|
142
|
+ if (errorCode == 0) {
|
|
143
|
+ Map<String, Object> resultDataMap = (Map<String, Object>) resultMap.get("data");
|
|
144
|
+
|
|
145
|
+ // 海康人员ID
|
|
146
|
+ Integer personId = (Integer) resultDataMap.get("personId");
|
|
147
|
+
|
|
148
|
+ taUserHk.setHkUserId(personId);
|
|
149
|
+
|
|
150
|
+ int row = 0;
|
|
151
|
+ if (null == taUserHk.getId()) {
|
|
152
|
+ taUserHk.setTaUserId(user.getId());
|
|
153
|
+ taUserHk.setCommunityId(tpEquipmentTree.getCommunityId());
|
|
154
|
+ // 存储海康人员ID
|
|
155
|
+ row = taUserHkMapper.insertSelective(taUserHk);
|
|
156
|
+ } else {
|
|
157
|
+ row = taUserHkMapper.updateByPrimaryKeySelective(taUserHk);
|
|
158
|
+ }
|
|
159
|
+
|
|
160
|
+ if (row > 0) {
|
|
161
|
+ response.addSuccess("操作成功!");
|
|
162
|
+ } else {
|
|
163
|
+ response.addError("操作失败");
|
|
164
|
+ throw new RuntimeException("数据库添加 家属/租客 人员失败!");
|
|
165
|
+ }
|
|
166
|
+
|
|
167
|
+ } else {
|
|
168
|
+ String errorMessage = String.valueOf(resultMap.get("errorMessage"));
|
|
169
|
+ response.addError(errorMessage);
|
|
170
|
+ log.error("海康添加人员失败! {}", errorMessage);
|
|
171
|
+ throw new RuntimeException(errorMessage);
|
|
172
|
+ }
|
|
173
|
+ }
|
|
174
|
+
|
|
175
|
+ /**
|
|
176
|
+ * 添加卡片
|
|
177
|
+ * @return
|
|
178
|
+ */
|
|
179
|
+ public ResponseBean addCards(TaUserHk taUserHk, TpEquipmentTree tpEquipmentTree) {
|
|
180
|
+
|
|
181
|
+ ResponseBean response = new ResponseBean();
|
|
182
|
+
|
|
183
|
+ // 开卡 卡号
|
|
184
|
+ long cardNo = System.currentTimeMillis();
|
|
185
|
+
|
|
186
|
+ // 添加卡片
|
|
187
|
+ Map<String,Object> addCardsMap = new HashMap<>();
|
|
188
|
+ addCardsMap.put("secret", tpEquipmentTree.getSecret());
|
|
189
|
+ addCardsMap.put("appkey", tpEquipmentTree.getAppkey());
|
|
190
|
+ addCardsMap.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
191
|
+ addCardsMap.put("startCardNo", cardNo);
|
|
192
|
+ addCardsMap.put("endCardNo", cardNo);
|
|
193
|
+ addCardsMap.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
194
|
+ String addCardsJSON = HKOpenApi.addCards(addCardsMap);
|
|
195
|
+ JSONObject addCardsJsonObject = JSONObject.parseObject(addCardsJSON);
|
|
196
|
+ Integer addCardsResultCode = addCardsJsonObject.getInteger("errorCode");
|
|
197
|
+ if (0 != addCardsResultCode) {
|
|
198
|
+ response.addError("操作失败");
|
|
199
|
+ throw new RuntimeException(addCardsJsonObject.getString("errorMessage"));
|
|
200
|
+ }
|
|
201
|
+
|
|
202
|
+ // 卡片入库
|
|
203
|
+ taUserHk.setHkCardNo(cardNo + "");
|
|
204
|
+ taUserHkMapper.updateByPrimaryKeySelective(taUserHk);
|
|
205
|
+ return response;
|
|
206
|
+ }
|
|
207
|
+
|
|
208
|
+ /**
|
|
209
|
+ * 卡片开卡
|
|
210
|
+ *
|
|
211
|
+ * @param personId 人员海康id
|
|
212
|
+ * @param cardNo 卡号
|
|
213
|
+ * @param expirationTime 有效期为多少? 单位为 年
|
|
214
|
+ * @return
|
|
215
|
+ */
|
|
216
|
+ private ResponseBean openCard(Integer personId, Long cardNo, Integer expirationTime, TpEquipmentTree tpEquipmentTree) {
|
|
217
|
+ ResponseBean response = new ResponseBean();
|
|
218
|
+
|
|
219
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
220
|
+ LocalDate today = LocalDate.now();
|
|
221
|
+ int year = today.getYear();
|
|
222
|
+ // 加上20, 表示加上20年,默认
|
|
223
|
+ if (null == expirationTime || expirationTime <= 0) {
|
|
224
|
+ year += 20;
|
|
225
|
+ } else {
|
|
226
|
+ year += expirationTime;
|
|
227
|
+ }
|
|
228
|
+ int month = today.getMonthValue();
|
|
229
|
+ int day = today.getDayOfMonth();
|
|
230
|
+
|
|
231
|
+ Long time = null;
|
|
232
|
+ try {
|
|
233
|
+ time = formatter.parse(year + "-" + month + "-" + day).getTime();
|
|
234
|
+ } catch (ParseException e) {
|
|
235
|
+ e.printStackTrace();
|
|
236
|
+ }
|
|
237
|
+
|
|
238
|
+ // 开卡
|
|
239
|
+ Map<String, Object> parOpenCard = Maps.newHashMap();
|
|
240
|
+ parOpenCard.put("personId", personId);
|
|
241
|
+ parOpenCard.put("cardNo", cardNo);
|
|
242
|
+ parOpenCard.put("startTime", System.currentTimeMillis());
|
|
243
|
+ parOpenCard.put("endTime", time);
|
|
244
|
+ parOpenCard.put("secret", tpEquipmentTree.getSecret());
|
|
245
|
+ parOpenCard.put("appkey", tpEquipmentTree.getAppkey());
|
|
246
|
+ parOpenCard.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
247
|
+ parOpenCard.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
248
|
+ JSONObject openCardJSON = JSONObject.parseObject(HKOpenApi.openCard(parOpenCard));
|
|
249
|
+ int code = (int) openCardJSON.get("errorCode");
|
|
250
|
+ if (code == 0) {
|
|
251
|
+ response.addSuccess("操作成功!");
|
|
252
|
+ } else {
|
|
253
|
+ String errorMessage = String.valueOf(openCardJSON.get("errorMessage"));
|
|
254
|
+ response.addError(errorMessage);
|
|
255
|
+ log.error("开卡失败! {}", errorMessage);
|
|
256
|
+ throw new RuntimeException(errorMessage);
|
|
257
|
+ }
|
|
258
|
+
|
|
259
|
+ return response;
|
|
260
|
+ }
|
|
261
|
+
|
|
262
|
+ @Override
|
|
263
|
+ public ResponseBean addUserOne(Integer communityId, MultipartFile uploadFile) {
|
|
264
|
+ ResponseBean responseBean = new ResponseBean();
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+ TaUser user = new TaUser();
|
|
268
|
+ user.setLoginName("15677789713");
|
|
269
|
+ user.setUnitId(110);
|
|
270
|
+ user.setHkPersonNo(idGen.nextId());
|
|
271
|
+ user.setUserName("魏熙美测试1");
|
|
272
|
+
|
|
273
|
+ // 海康权限信息
|
|
274
|
+ TpUnitHkSetting unitHkSetting = getUnitHkSetting(communityId, user.getUnitId());
|
|
275
|
+ TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(communityId);
|
|
276
|
+
|
|
277
|
+ // =================== 添加人员 ===========================
|
|
278
|
+// Map<String, Object> parUser = Maps.newHashMap();
|
|
279
|
+// parUser.put("personNo", user.getHkPersonNo());
|
|
280
|
+// parUser.put("personName", user.getUserName());
|
|
281
|
+// // parUser.put("phoneNo", user.getLoginName());
|
|
282
|
+// parUser.put("remark", user.getLoginName());
|
|
283
|
+// parUser.put("deptUuid", unitHkSetting.getDepartmentId());
|
|
284
|
+// parUser.put("secret", tpEquipmentTree.getSecret());
|
|
285
|
+// parUser.put("appkey", tpEquipmentTree.getAppkey());
|
|
286
|
+// parUser.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
287
|
+// parUser.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
288
|
+// Map<String, Object> resultMap = JSONObject.parseObject(HKOpenApi.addUser(parUser), HashMap.class);
|
|
289
|
+// Integer errorCode = (Integer) resultMap.get("errorCode");
|
|
290
|
+// if (errorCode != 0) {
|
|
291
|
+// responseBean.addError("人员添加 操作失败");
|
|
292
|
+// throw new RuntimeException(String.valueOf(resultMap.get("errorMessage")));
|
|
293
|
+// }
|
|
294
|
+// Map<String, Object> resultDataMap = (Map<String, Object>) resultMap.get("data");
|
|
295
|
+// // 海康人员ID
|
|
296
|
+// Integer personId = (Integer) resultDataMap.get("personId");
|
|
297
|
+// user.setHkUserId(personId);
|
|
298
|
+//
|
|
299
|
+// // =================== 添加卡片 =====================
|
|
300
|
+//
|
|
301
|
+// // 开卡 卡号
|
|
302
|
+// long cardNo = System.currentTimeMillis();
|
|
303
|
+// // 添加卡片
|
|
304
|
+// Map<String,Object> addCardsMap = new HashMap<>();
|
|
305
|
+// addCardsMap.put("secret", tpEquipmentTree.getSecret());
|
|
306
|
+// addCardsMap.put("appkey", tpEquipmentTree.getAppkey());
|
|
307
|
+// addCardsMap.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
308
|
+// addCardsMap.put("startCardNo", cardNo);
|
|
309
|
+// addCardsMap.put("endCardNo", cardNo);
|
|
310
|
+// addCardsMap.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
311
|
+// String addCardsJSON = HKOpenApi.addCards(addCardsMap);
|
|
312
|
+// JSONObject addCardsJsonObject = JSONObject.parseObject(addCardsJSON);
|
|
313
|
+// Integer addCardsResultCode = addCardsJsonObject.getInteger("errorCode");
|
|
314
|
+// if (0 != addCardsResultCode) {
|
|
315
|
+// responseBean.addError("操作失败");
|
|
316
|
+// throw new RuntimeException(addCardsJsonObject.getString("errorMessage"));
|
|
317
|
+// }
|
|
318
|
+//
|
|
319
|
+// user.setHkCardNo(cardNo + "");
|
|
320
|
+//
|
|
321
|
+// // ============== 人员绑定卡片 ======================
|
|
322
|
+//
|
|
323
|
+// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
324
|
+// LocalDate today = LocalDate.now();
|
|
325
|
+// int year = today.getYear();
|
|
326
|
+// // 加上20, 表示加上20年,默认
|
|
327
|
+// year += 20;
|
|
328
|
+//
|
|
329
|
+// int month = today.getMonthValue();
|
|
330
|
+// int day = today.getDayOfMonth();
|
|
331
|
+//
|
|
332
|
+// Long time = null;
|
|
333
|
+// try {
|
|
334
|
+// time = formatter.parse(year + "-" + month + "-" + day).getTime();
|
|
335
|
+// } catch (ParseException e) {
|
|
336
|
+// e.printStackTrace();
|
|
337
|
+// }
|
|
338
|
+//
|
|
339
|
+// // 开卡
|
|
340
|
+// Map<String, Object> parOpenCard = Maps.newHashMap();
|
|
341
|
+// parOpenCard.put("personId", user.getHkUserId());
|
|
342
|
+// parOpenCard.put("cardNo", Long.valueOf(cardNo));
|
|
343
|
+// parOpenCard.put("startTime", System.currentTimeMillis());
|
|
344
|
+// parOpenCard.put("endTime", time);
|
|
345
|
+// parOpenCard.put("secret", tpEquipmentTree.getSecret());
|
|
346
|
+// parOpenCard.put("appkey", tpEquipmentTree.getAppkey());
|
|
347
|
+// parOpenCard.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
348
|
+// parOpenCard.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
349
|
+// JSONObject openCardJSON = JSONObject.parseObject(HKOpenApi.openCard(parOpenCard));
|
|
350
|
+// int code = (int) openCardJSON.get("errorCode");
|
|
351
|
+// if (code != 0) {
|
|
352
|
+// String errorMessage = String.valueOf(openCardJSON.get("errorMessage"));
|
|
353
|
+// responseBean.addError(errorMessage);
|
|
354
|
+// log.error("人员绑定开卡失败! {}", errorMessage);
|
|
355
|
+// throw new RuntimeException(errorMessage);
|
|
356
|
+// }
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+ // ============= 修改人脸 ==================
|
|
361
|
+ String data = HKOpenApi.HKpersonGroupId(uploadFile, 1236, 1142018896048422912L, user.getUserName(), "1561113497593", tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer(), tpEquipmentTree.getOpUserUuid());
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+ //=================== 下发可是对讲卡权限 =====================
|
|
365
|
+
|
|
366
|
+ //--------- 可视对讲 ----------
|
|
367
|
+
|
|
368
|
+// Map<String,Object> addOutDoorAuthMap = Maps.newHashMap();
|
|
369
|
+// // app用户权限勿动 unitHkSetting.getPermissionId()
|
|
370
|
+// addOutDoorAuthMap.put("authName", "魏熙美测试1");
|
|
371
|
+// addOutDoorAuthMap.put("personIds", Arrays.asList(user.getHkUserId()));
|
|
372
|
+// addOutDoorAuthMap.put("secret", tpEquipmentTree.getSecret());
|
|
373
|
+// addOutDoorAuthMap.put("appkey", tpEquipmentTree.getAppkey());
|
|
374
|
+// addOutDoorAuthMap.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
375
|
+// addOutDoorAuthMap.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
376
|
+//
|
|
377
|
+// // 单元门口机
|
|
378
|
+// List<TpEquipment> visualEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(communityId, user.getUnitId(), 3);
|
|
379
|
+// // 可是对讲设备号
|
|
380
|
+// List<String> visualList = visualEquipments.stream()
|
|
381
|
+// .map(e-> tpConfigurationMapper.selectByPrimaryKey(e.getUuidId()).getConfigurationValue())
|
|
382
|
+// .collect(Collectors.toList());
|
|
383
|
+//// List<String> visualList = new ArrayList<>();
|
|
384
|
+//// visualList.add("10030100001");
|
|
385
|
+// addOutDoorAuthMap.put("longNums", visualList); // visualList
|
|
386
|
+// // 可视对讲下发 权限
|
|
387
|
+// String addOutDoorAuthJSONString = HKOpenApi.addOutDoorAuth(addOutDoorAuthMap);
|
|
388
|
+// JSONObject addOutDoorAuthJSON = JSONObject.parseObject(addOutDoorAuthJSONString);
|
|
389
|
+// int addOutDoorAuthJSONCode = (int) addOutDoorAuthJSON.get("errorCode");
|
|
390
|
+// if (addOutDoorAuthJSONCode != 0 ) {
|
|
391
|
+// String errorMessage = String.valueOf(addOutDoorAuthJSON.get("errorMessage"));
|
|
392
|
+// responseBean.addError(errorMessage);
|
|
393
|
+// log.error("可视对讲下发 权限失败! {}", errorMessage);
|
|
394
|
+// throw new RuntimeException(errorMessage);
|
|
395
|
+// }
|
|
396
|
+
|
|
397
|
+// try {
|
|
398
|
+// Thread.sleep(1000);
|
|
399
|
+// } catch (InterruptedException e) {
|
|
400
|
+// e.printStackTrace();
|
|
401
|
+// }
|
|
402
|
+
|
|
403
|
+ // ================ 可是对讲人脸权限下发 ==============
|
|
404
|
+
|
|
405
|
+ //可视对讲时 指定人员人脸权限下载
|
|
406
|
+// List<Integer> userIdList = new ArrayList<>();
|
|
407
|
+// userIdList.add(user.getHkUserId());
|
|
408
|
+//
|
|
409
|
+// HKOpenApi.visualIntercom(tpEquipmentTree.getOpUserUuid(), 1, userIdList, visualList, tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer());
|
|
410
|
+//
|
|
411
|
+// responseBean.addSuccess("操作成功!");
|
|
412
|
+ return responseBean;
|
|
413
|
+ }
|
|
414
|
+}
|