浏览代码

人员数据上传设备逻辑修改

M墨鱼—_mo 5 年之前
父节点
当前提交
5b455aa829

+ 1 - 1
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceFilterLogServiceImpl.java

@@ -127,7 +127,7 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
 
         }catch (Exception e){
 
-            log.warn(e.getMessage());
+            log.error(e.getMessage());
         }
 
 

+ 5 - 3
common/src/main/java/com/jpsoft/smart/modules/lapi/service/impl/LapiServiceImpl.java

@@ -130,9 +130,10 @@ public class LapiServiceImpl implements ILapiService {
             map.put("PersonInfoList", listMap1);
 
 
+            String faceDbId = getFaceDbId(deviceInfo, companyInfo.getName());
             try {
                 //获取人员人脸库id
-                String faceDbId = getFaceDbId(deviceInfo, companyInfo.getName());
+
                 JSONObject jsonObject = LApiUtil.PostRequest(deviceInfo.getIpAddress() + ":" + deviceInfo.getPort() + LApiConstant.ADDPERSON + faceDbId + "/People", map);
                 JSONObject dataJson = jsonObject.getJSONObject("Response");
                 JSONObject response = LApiUtil.getResponse(dataJson);
@@ -173,7 +174,7 @@ public class LapiServiceImpl implements ILapiService {
         JSONObject response = LApiUtil.getResponse(dataJson);
         List listData = response.getJSONArray("LibList");
         if (listData.size() <= 0) {
-            throw new Exception("设备没有配置人脸库");
+            throw new Exception(deviceInfo.getAliasName()+"设备没有配置人脸库");
         }
         for (int i = 0; i < listData.size(); i++) {
             JSONObject jsonObject1 = (JSONObject) JSONArray.toJSON(listData.get(i));
@@ -184,7 +185,8 @@ public class LapiServiceImpl implements ILapiService {
         }
         //人员所属的公司库不存在,保存到默认库
         if (StringUtils.isBlank(faceDbId)) {
-            faceDbId = deviceInfo.getDefaultFaceLibraryId();
+            throw new Exception(deviceInfo.getAliasName()+"设备中未配置"+companyName+"人脸库");
+       //    faceDbId = deviceInfo.getDefaultFaceLibraryId();
         }
         return faceDbId;
     }

+ 2 - 2
web/src/test/java/com/jpsoft/smart/LApiTest.java

@@ -26,7 +26,7 @@ public class LApiTest {
     @Test
     public void testKeepLive(){
         try {
-            Boolean result = lapiService.keepAlive("1");
+            Boolean result = lapiService.keepAlive("9f254a38-2b6c-4169-a53c-765ec5e16c51");
             System.out.println(result);
         } catch (Exception e) {
             e.printStackTrace();
@@ -39,7 +39,7 @@ public class LApiTest {
     public void testAddPerson(){
         try {
 
-            List<LapiMsgResult> result = lapiService.addPerson(1111L);
+            List<LapiMsgResult> result = lapiService.addPerson(11838L);
             System.out.println(result);
         } catch (Exception e) {
             e.printStackTrace();