|
@@ -201,39 +201,45 @@ public class FaceServicelimpl extends ServiceImpl<TaFaceMapper, TaFace> impleme
|
201
|
201
|
// 设备树
|
202
|
202
|
TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(communityId);
|
203
|
203
|
// 所有设备
|
204
|
|
- List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(communityId, unitId, 4);
|
205
|
|
- List<Map<String, Object>> equipmentUUID = getEquipmentUUID(tpEquipments);
|
206
|
|
- StringBuilder doorUuids = new StringBuilder();
|
207
|
|
- StringBuilder deviceUuids = new StringBuilder();
|
208
|
|
- equipmentUUID.forEach(e-> {
|
209
|
|
- doorUuids.append(e.get("doorUuid"));
|
210
|
|
- doorUuids.append(",");
|
211
|
|
- deviceUuids.append(e.get("deviceUuid"));
|
212
|
|
- deviceUuids.append(",");
|
213
|
|
- });
|
214
|
|
- Map<String,Object> map = Maps.newHashMap();
|
215
|
|
- map.put("appkey", tpEquipmentTree.getAppkey());
|
216
|
|
- map.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
217
|
|
- map.put("personIds", String.valueOf(user.getHkUserId()));
|
218
|
|
- map.put("deviceUuids", deviceUuids.substring(0, deviceUuids.lastIndexOf(",")));
|
219
|
|
- map.put("type", 1);
|
220
|
|
- map.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
221
|
|
- HKOpenApi.downloadFaceAndFingerInfos(map);
|
222
|
|
-
|
223
|
|
- //可视对讲时 指定人员人脸权限下载
|
224
|
|
- List<Integer> userIdList = new ArrayList<>();
|
225
|
|
- userIdList.add(user.getHkUserId());
|
226
|
|
- //临时设备编号
|
227
|
|
- // TODO 根据期楼栋号,来查询出门口机
|
|
204
|
+ //List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(communityId, unitId, 4);
|
|
205
|
+ List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitIdAndFace(communityId, unitId, 4);
|
|
206
|
+ if (CollectionUtils.isNotEmpty(tpEquipments)) {
|
|
207
|
+ List<Map<String, Object>> equipmentUUID = getEquipmentUUID(tpEquipments);
|
|
208
|
+ StringBuilder doorUuids = new StringBuilder();
|
|
209
|
+ StringBuilder deviceUuids = new StringBuilder();
|
|
210
|
+ equipmentUUID.forEach(e-> {
|
|
211
|
+ doorUuids.append(e.get("doorUuid"));
|
|
212
|
+ doorUuids.append(",");
|
|
213
|
+ deviceUuids.append(e.get("deviceUuid"));
|
|
214
|
+ deviceUuids.append(",");
|
|
215
|
+ });
|
|
216
|
+ Map<String,Object> map = Maps.newHashMap();
|
|
217
|
+ map.put("appkey", tpEquipmentTree.getAppkey());
|
|
218
|
+ map.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
|
|
219
|
+ map.put("personIds", String.valueOf(user.getHkUserId()));
|
|
220
|
+ map.put("deviceUuids", deviceUuids.substring(0, deviceUuids.lastIndexOf(",")));
|
|
221
|
+ map.put("type", 1);
|
|
222
|
+ map.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
|
|
223
|
+ HKOpenApi.downloadFaceAndFingerInfos(map);
|
|
224
|
+ }
|
228
|
225
|
|
229
|
226
|
// 单元门口机
|
230
|
227
|
List<TpEquipment> visualEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(communityId, unitId, 3);
|
231
|
|
- List<String> visualList = visualEquipments.stream()
|
232
|
|
- .map(e-> tpConfigurationMapper.selectById(e.getUuidId()).getConfigurationValue())
|
233
|
|
- .collect(Collectors.toList());
|
|
228
|
+ if (CollectionUtils.isNotEmpty(visualEquipments)) {
|
|
229
|
+ List<String> visualList = visualEquipments.stream()
|
|
230
|
+ .map(e-> tpConfigurationMapper.selectById(e.getUuidId()).getConfigurationValue())
|
|
231
|
+ .collect(Collectors.toList());
|
234
|
232
|
// List<String> visualList = new ArrayList<>();
|
235
|
233
|
// visualList.add("10010100000");
|
236
|
|
- HKOpenApi.visualIntercom(tpEquipmentTree.getOpUserUuid(), 1, userIdList, visualList, tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer());
|
|
234
|
+
|
|
235
|
+ //可视对讲时 指定人员人脸权限下载
|
|
236
|
+ List<Integer> userIdList = new ArrayList<>();
|
|
237
|
+ userIdList.add(user.getHkUserId());
|
|
238
|
+ //临时设备编号
|
|
239
|
+ // TODO 根据期楼栋号,来查询出门口机
|
|
240
|
+ HKOpenApi.visualIntercom(tpEquipmentTree.getOpUserUuid(), 1, userIdList, visualList, tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer());
|
|
241
|
+ }
|
|
242
|
+
|
237
|
243
|
} else {
|
238
|
244
|
responseBean.addError(ResponseErrorsMessages.FACE_ERROR.getCode(), ResponseErrorsMessages.FACE_ERROR.getMsg());
|
239
|
245
|
}
|