Przeglądaj źródła

解决人脸批量导入出错问题

dzx 4 miesięcy temu
rodzic
commit
6cff441617

+ 1 - 1
src/main/java/com/xjrsoft/module/personnel/controller/StundentFaceProcessController.java

@@ -359,7 +359,7 @@ public class StundentFaceProcessController {
                 String faceId = null;
                 if(process.getHikvisionResult() != null && process.getHikvisionResult().startsWith("{") && process.getHikvisionResult().endsWith("}")){
                     JsonObject object = parser.parse(process.getHikvisionResult()).getAsJsonObject();
-                    if("0".equals(object.get("code").getAsString()) && "success".equals(object.get("msg").getAsString())){
+                    if("0".equals(object.get("code").getAsString()) && "success".equals(object.get("msg").getAsString()) && !object.get("data").isJsonNull()){
                         faceId = object.get("data").getAsJsonObject().get("faceId").getAsString();
                     }
                 }

+ 1 - 1
src/main/java/com/xjrsoft/module/personnel/controller/TeacherFaceProcessController.java

@@ -317,7 +317,7 @@ public class TeacherFaceProcessController {
                 String faceId = null;
                 if(process.getHikvisionResult() != null && process.getHikvisionResult().startsWith("{") && process.getHikvisionResult().endsWith("}")){
                     JsonObject object = parser.parse(process.getHikvisionResult()).getAsJsonObject();
-                    if("0".equals(object.get("code").getAsString()) && "success".equals(object.get("msg").getAsString())){
+                    if("0".equals(object.get("code").getAsString()) && "success".equals(object.get("msg").getAsString()) && !object.get("data").isJsonNull()){
                         faceId = object.get("data").getAsJsonObject().get("faceId").getAsString();
                     }
                 }