|
|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
+import com.google.gson.JsonObject;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
@@ -21,6 +22,7 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
|
import com.xjrsoft.module.base.vo.StudentClassVo;
|
|
|
+import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
|
import com.xjrsoft.module.hikvision.util.FaceImportUtil;
|
|
|
import com.xjrsoft.module.personnel.dto.AddStundentFaceProcessDto;
|
|
|
import com.xjrsoft.module.personnel.dto.StundentFaceProcessPageDto;
|
|
|
@@ -181,6 +183,7 @@ public class StundentFaceProcessController {
|
|
|
studentClassMap.put(classVo.getUserId(), classVo);
|
|
|
}
|
|
|
|
|
|
+ ApiUtil apiUtil = new ApiUtil();
|
|
|
Long folderId = IdWorker.getId();
|
|
|
ZipFile zipFile = FileZipUtil.convertToZipFile(file);
|
|
|
Enumeration<? extends ZipEntry> entries = zipFile.entries();
|
|
|
@@ -189,7 +192,7 @@ public class StundentFaceProcessController {
|
|
|
String filename = entry.getName();
|
|
|
InputStream inputStream = zipFile.getInputStream(entry); //读取文件内容
|
|
|
|
|
|
- String idNumber = filename.substring(0, 17);
|
|
|
+ String idNumber = filename.substring(0, 18);
|
|
|
BaseStudentUser studentUser = studentMap.get(idNumber);
|
|
|
if(studentUser == null){
|
|
|
continue;
|
|
|
@@ -257,11 +260,21 @@ public class StundentFaceProcessController {
|
|
|
studentFace.setTeacherId(classVo.getTeacherId());
|
|
|
studentFace.setIdentityCard(studentUser.getCredentialNumber());
|
|
|
studentFace.setStatus(1);
|
|
|
+ studentFace.setUserId(studentUser.getId());
|
|
|
studentFace.setExamStatus(1);
|
|
|
- stundentFaceProcessService.save(studentFace);
|
|
|
+
|
|
|
|
|
|
//将人脸上传海康
|
|
|
- FaceImportUtil.ImportStudentFace(studentFace.getId());
|
|
|
+ JsonObject paramJson = new JsonObject();
|
|
|
+ paramJson.addProperty("personId", studentUser.getId());
|
|
|
+ paramJson.addProperty("faceData", base64String);
|
|
|
+
|
|
|
+ Map<String, String> querys = new HashMap<>();
|
|
|
+ querys.put("tagId", "frs");
|
|
|
+
|
|
|
+ String apiPath = "/api/resource/v1/face/single/add";
|
|
|
+ String response = apiUtil.doPost(apiPath, String.valueOf(paramJson), querys);
|
|
|
+ stundentFaceProcessService.save(studentFace);
|
|
|
}
|
|
|
return RT.ok(true);
|
|
|
}
|