Browse Source

修复 bug

魏熙美 6 years ago
parent
commit
2a27f500f9

+ 4
- 4
CODE/foreign-service/src/main/java/com/community/huiju/controller/TaUserController.java View File

@@ -74,10 +74,10 @@ public class TaUserController extends BaseController {
74 74
     @ApiOperation(value = "根据用户ID查询", notes = "根据用户ID查询")
75 75
     @ApiImplicitParams({
76 76
             @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "path", name = "userId", value = "用户id"),
77
-            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
78
-            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
79
-            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
80
-            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
77
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
78
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
79
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
80
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
81 81
     })
82 82
     public ResponseBean updateUser(@PathVariable(value = "userId") Integer userId){
83 83
         ResponseBean responseBean = iTaUserService.getTaUser(userId);

+ 6
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TaFaceMapper.java View File

@@ -2,7 +2,13 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.community.huiju.model.TaFace;
5
+import com.community.huiju.model.TpEquipment;
5 6
 import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.ResultMap;
8
+import org.apache.ibatis.annotations.ResultType;
9
+import org.apache.ibatis.annotations.Select;
10
+
11
+import java.util.List;
6 12
 
7 13
 /**
8 14
  * <p>

+ 18
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpEquipmentMapper.java View File

@@ -50,4 +50,22 @@ public interface TpEquipmentMapper extends BaseMapper<TpEquipment> {
50 50
             "on trne.equipment_id = te.id " +
51 51
             "where trne.community_id=#{communityId} and trne.unit_id=#{unitId} and te.equipment_type=#{equipmentType}")
52 52
     List<TpEquipment> selectByCommunityIdAndUnitId(Integer communityId, Integer unitId, Integer equipmentType);
53
+
54
+
55
+    /**
56
+     * 根据小区 和 单元号 查询所有人脸设备
57
+     * @param communityId
58
+     * @param unitId
59
+     * @return
60
+     */
61
+    @ResultType(TpEquipment.class)
62
+    @Select("select " +
63
+            "te.* " +
64
+            "from tp_unit_equipment trne left join tp_equipment te " +
65
+            "on trne.equipment_id = te.id " +
66
+            "LEFT JOIN tp_configuration tc ON te.uuid_id = tc.id " +
67
+            "where trne.community_id=#{communityId} and trne.unit_id=#{unitId} and te.equipment_type=#{equipmentType} " +
68
+            "AND tc.device_type = 1")
69
+    List<TpEquipment> selectByCommunityIdAndUnitIdAndFace(@Param("communityId") Integer communityId, @Param("unitId") Integer unitId, @Param("equipmentType") Integer equipmentType);
70
+
53 71
 }

+ 34
- 28
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java View File

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

+ 8
- 1
CODE/foreign-service/src/main/resources/mapper/TaFaceMapper.xml View File

@@ -4,7 +4,14 @@
4 4
 
5 5
     <select id="getByUserVerifyId" resultType="com.community.huiju.model.TaFace" parameterType="java.lang.Integer">
6 6
         select
7
-        *
7
+        `id` as faceId,
8
+        `community_id`,
9
+        `ta_user_verify_id`,
10
+        `face_img`,
11
+        `create_user`,
12
+        `create_date`,
13
+        `update_user`,
14
+        `update_date`
8 15
         from ta_face
9 16
         where ta_user_verify_id = #{userVerifyId,jdbcType=INTEGER}
10 17
     </select>

+ 18
- 1
CODE/foreign-service/src/main/resources/mapper/TaUserVerifyMapper.xml View File

@@ -4,7 +4,24 @@
4 4
 
5 5
     <select id="selectCommunityAndAddressAndVerifyStatus" resultType="com.community.huiju.model.TaUserVerify">
6 6
         select
7
-        *
7
+        `id` as userVerifyId,
8
+        `user_id`,
9
+        `community_id`,
10
+        `role_id`,
11
+        `phase_id`,
12
+        `phase_name`,
13
+        `building_id`,
14
+        `building_name`,
15
+        `unit_id`,
16
+        `unit_name`,
17
+        `level_id`,
18
+        `level_name`,
19
+        `room_no_id`,
20
+        `room_no_name`,
21
+        `verify_status`,
22
+        `create_date`,
23
+        `verify_name`,
24
+        `remark`
8 25
         from ta_user_verify
9 26
         where community_id = #{communityId,jdbcType=INTEGER}
10 27
         and user_id = #{userId,jdbcType=INTEGER}