|
@@ -3,7 +3,9 @@ package com.xjrsoft.module.personnel.service.impl;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
|
+import com.google.gson.JsonArray;
|
|
import com.google.gson.JsonObject;
|
|
import com.google.gson.JsonObject;
|
|
|
|
+import com.google.gson.JsonParser;
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
|
|
import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
|
|
import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
@@ -38,11 +40,34 @@ public class TeacherFaceProcessServiceImpl extends MPJBaseServiceImpl<TeacherFac
|
|
List<TeacherFaceProcess> list = this.baseMapper.selectBatchIds(ids);
|
|
List<TeacherFaceProcess> list = this.baseMapper.selectBatchIds(ids);
|
|
ApiUtil apiUtil = new ApiUtil();
|
|
ApiUtil apiUtil = new ApiUtil();
|
|
String apiPath = "/api/resource/v1/face/single/delete";
|
|
String apiPath = "/api/resource/v1/face/single/delete";
|
|
|
|
+ JsonParser parser = new JsonParser();
|
|
for (TeacherFaceProcess process : list) {
|
|
for (TeacherFaceProcess process : list) {
|
|
- String studentHikvisionId = hikvisionDataMapper.getStudentHikvisionId(process.getUserId());
|
|
|
|
|
|
+ String studentHikvisionId = hikvisionDataMapper.getTeacherHikvisionId(process.getUserId());
|
|
|
|
+
|
|
|
|
+ String apiUrl = "/api/resource/v1/person/condition/personInfo";
|
|
|
|
+ JsonObject paramsJson = new JsonObject();
|
|
|
|
+ paramsJson.addProperty("paramName", "personId");
|
|
|
|
+ JsonArray array = new JsonArray();
|
|
|
|
+ array.add(studentHikvisionId);
|
|
|
|
+ paramsJson.add("paramValue", array);
|
|
|
|
+ String personInfoRes = apiUtil.doPost(apiUrl, paramsJson.toString(), null);
|
|
|
|
+ String faceId = null;
|
|
|
|
+ JsonObject personInfoData = parser.parse(personInfoRes).getAsJsonObject();
|
|
|
|
+ if("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())){
|
|
|
|
+ JsonObject dataJson = personInfoData.get("data").getAsJsonObject();
|
|
|
|
+ if(dataJson.get("total").getAsInt() > 0){
|
|
|
|
+ JsonArray personPhoto = dataJson.get("list").getAsJsonArray().get(0)
|
|
|
|
+ .getAsJsonObject().get("personPhoto").getAsJsonArray();
|
|
|
|
+ if(personPhoto.size() > 0){
|
|
|
|
+ faceId = personPhoto.get(0).getAsJsonObject().get("personPhotoIndexCode").getAsString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
JsonObject paramJson = new JsonObject();
|
|
JsonObject paramJson = new JsonObject();
|
|
- paramJson.addProperty("faceId", studentHikvisionId);
|
|
|
|
|
|
+ paramJson.addProperty("faceId", faceId);
|
|
|
|
|
|
String result = apiUtil.doPost(apiPath, paramJson.toString(), null);
|
|
String result = apiUtil.doPost(apiPath, paramJson.toString(), null);
|
|
process.setExamStatus(2);
|
|
process.setExamStatus(2);
|