dingxin 6 年 前
コミット
6ecd866d6f

+ 9
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/hk/HKConstant.java ファイルの表示

@@ -119,6 +119,15 @@ public class HKConstant {
119 119
      * 修改人员
120 120
      */
121 121
     public static final String ITF_UPDATE_USER ="/openapi/service/base/person/modifyPersonInfo";
122
+    /**
123
+     * 查询人员设备
124
+     */
125
+    public static final String ITF_SELECT_USER ="/openapi/service/acs/auth/getAuthoritiesByPersonIds";
126
+
127
+    /**
128
+     * 删除人员设备
129
+     */
130
+    public static final String ITF_DELETE_USER ="/openapi/service/acs/auth/delPerAuthsByPerIdsAndDoorUuids";
122 131
 
123 132
 
124 133
     /**

+ 49
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/hk/HKOpenApi.java ファイルの表示

@@ -970,5 +970,54 @@ public class HKOpenApi {
970 970
         }
971 971
 
972 972
     }
973
+    // 删除当前人脸设备信息
974
+    public static String deleteUser(Integer opUserUuid) {
975
+        String url = HKConstant.OPENAPI_IP_PORT_HTTP + HKConstant.ITF_DELETE_USER;
976
+        Map<String, Object> parMap = new HashMap<String, Object>();
977
+        //设置APPKEY
978
+        parMap.put("appkey", HKConstant.APPKEY);
979
+        //设置时间参数
980
+        parMap.put("time", System.currentTimeMillis());
981
+        parMap.put("opUserUuid",HKConstant.OP_USER_UUID);
982
+        parMap.put("personIds",2301+"");
983
+        parMap.put("doorUuids","91b8ce635b634d468cde925af6e4274c,d40b23e316364bb5a276b99bb6327181,7f866e918ab8452f9eb1d8a25e481530,8b8256fc605d428c9dc797451e3dc432,84d619c5e84942f68047f0bca93fc041");
984
+        String params =  JSON.toJSONString(parMap);
985
+        log.info("删除人脸 请求参数:{}", params);
986
+        String data = null;
987
+        try {
988
+            data = HttpClientSSLUtils.doPost(url + "?token=" + Digests.buildToken(url + "?" + params, params, HKConstant.SECRET), params);
989
+            log.info("删除人脸 请求返回结果:{}",data);
990
+        } catch (Exception e) {
991
+            e.printStackTrace();
992
+            log.error("删除加人脸失败!",e);
993
+            throw new RuntimeException("删除加人脸失败!");
994
+        }
995
+        return data;
996
+    }
997
+        // 查询当前人脸设备信息---(没通)
998
+    public static String selectUserFace(Integer opUserUuid) {
999
+        String url = HKConstant.OPENAPI_IP_PORT_HTTP + HKConstant.ITF_SELECT_USER;
1000
+        Map<String, Object> parMap = new HashMap<String, Object>();
1001
+        //设置APPKEY
1002
+        parMap.put("appkey", HKConstant.APPKEY);
1003
+        //设置时间参数
1004
+        parMap.put("time", System.currentTimeMillis());
1005
+        parMap.put("pageNo","1");
1006
+        parMap.put("pageSize","100");
1007
+        parMap.put("opUserUuid",HKConstant.OP_USER_UUID);
1008
+        parMap.put("personIds",opUserUuid+"");
1009
+        String params =  JSON.toJSONString(parMap);
1010
+        log.info("查询设备人脸 请求参数:{}", params);
1011
+        String data = null;
1012
+        try {
1013
+            data = HttpClientSSLUtils.doPost(url + "?token=" + Digests.buildToken(url + "?" + params, params, HKConstant.SECRET), params);
1014
+            log.info("查询设备人脸 请求返回结果:{}",data);
1015
+        } catch (Exception e) {
1016
+            e.printStackTrace();
1017
+            log.error("查询设备人脸失败!",e);
1018
+            throw new RuntimeException("查询设备人脸失败!");
1019
+        }
1020
+        return data;
1021
+    }
973 1022
 
974 1023
 }

+ 1
- 3
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/FaceController.java ファイルの表示

@@ -106,7 +106,7 @@ public class FaceController extends BaseController {
106 106
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "roomNoName",value = "户号"),
107 107
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "otherUserId",value = "家属或租户ID,不填为本人")
108 108
     })
109
-    @RequestMapping(value = "/getUserIdFace",method = RequestMethod.GET)
109
+    @RequestMapping(value = "/deleteFace",method = RequestMethod.GET)
110 110
     public Object deleteFace(HttpSession session, @RequestParam(required = false) Integer otherUserId,
111 111
                                     @RequestParam(required = false) String phaseName,
112 112
                                     @RequestParam(required = false) String buildingName,
@@ -118,5 +118,3 @@ public class FaceController extends BaseController {
118 118
     }
119 119
 
120 120
 }
121
-
122
-}

+ 3
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java ファイルの表示

@@ -202,7 +202,10 @@ public class FaceServicelimpl implements FaceServiceI {
202 202
     @Override
203 203
     public ResponseBean deleteFace(Integer otherUserId, String phaseName, String buildingName, String unitName, String levelName, String roomNoName) {
204 204
         TaUserVerify taUserVerify= infoExist(phaseName,buildingName,unitName,levelName, roomNoName,otherUserId);
205
+        TaUser taUser= taUserMapper.selectById(taUserVerify.getUserId());
205 206
         // TODO 删除人脸,是否删除海康
207
+//        HKOpenApi.selectUser(taUser.getHkUserId());
208
+        HKOpenApi.deleteUser(taUser.getHkUserId());
206 209
         return null;
207 210
     }
208 211