|
@@ -7,7 +7,6 @@
|
|
|
|
|
|
package cn.com.qmth.examcloud.core.oe.admin.service.impl;
|
|
package cn.com.qmth.examcloud.core.oe.admin.service.impl;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamCaptureCameraInfoRepo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamCaptureCameraInfoRepo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamCaptureRepo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamCaptureRepo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
|
|
@@ -30,7 +29,6 @@ import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
-import org.json.JSONArray;
|
|
|
|
import org.json.JSONException;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -214,40 +212,40 @@ public class ExamCaptureServiceImpl implements ExamCaptureService {
|
|
String faceLivenessResult = entity.getFacelivenessResult();
|
|
String faceLivenessResult = entity.getFacelivenessResult();
|
|
info.setIsFacelivenessPass(isFaceLivenessPass(faceLivenessResult));
|
|
info.setIsFacelivenessPass(isFaceLivenessPass(faceLivenessResult));
|
|
|
|
|
|
- String cameraInfos = entity.getCameraInfos();
|
|
|
|
- info.setVirtualCameraNames(getVirtualCameraNames(cameraInfos));
|
|
|
|
|
|
+// String cameraInfos = entity.getCameraInfos();
|
|
|
|
+// info.setVirtualCameraNames(getVirtualCameraNames(cameraInfos));
|
|
return info;
|
|
return info;
|
|
}
|
|
}
|
|
|
|
|
|
- private String getVirtualCameraNames(String cameraInfos) {
|
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
|
- if (StringUtils.isNotBlank(cameraInfos)) {
|
|
|
|
- JSONArray jsonArray;
|
|
|
|
- try {
|
|
|
|
- jsonArray = new JSONArray(cameraInfos);
|
|
|
|
- for (int i = 0; i < jsonArray.length(); i++) {
|
|
|
|
- try {
|
|
|
|
- JSONObject jsonObject = (JSONObject) jsonArray.get(i);
|
|
|
|
- if (jsonObject.isNull("pid") || StringUtils.isBlank(jsonObject.getString("pid"))) {
|
|
|
|
- sb.append(jsonObject.getString("name") + ",");
|
|
|
|
- }
|
|
|
|
- } catch (JSONException e) {
|
|
|
|
- //主要针对json数组最后的空对象处理,不影响业务eg:"[ { \"name\" : \"Camera\", \"pid\" : \"\", \"vid\" : \"\" },]";
|
|
|
|
- LOG.error("抓拍照片格式不正确", e);
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } catch (JSONException e) {
|
|
|
|
- LOG.error("获取虚拟摄像头名称失败", e);
|
|
|
|
- throw new StatusException("ExamCaptureService-002", "获取虚拟摄像头名称失败");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (sb.lastIndexOf(",") > -1) {
|
|
|
|
- return sb.substring(0, sb.lastIndexOf(","));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return sb.toString();
|
|
|
|
- }
|
|
|
|
|
|
+// private String getVirtualCameraNames(String cameraInfos) {
|
|
|
|
+// StringBuffer sb = new StringBuffer();
|
|
|
|
+// if (StringUtils.isNotBlank(cameraInfos)) {
|
|
|
|
+// JSONArray jsonArray;
|
|
|
|
+// try {
|
|
|
|
+// jsonArray = new JSONArray(cameraInfos);
|
|
|
|
+// for (int i = 0; i < jsonArray.length(); i++) {
|
|
|
|
+// try {
|
|
|
|
+// JSONObject jsonObject = (JSONObject) jsonArray.get(i);
|
|
|
|
+// if (jsonObject.isNull("pid") || StringUtils.isBlank(jsonObject.getString("pid"))) {
|
|
|
|
+// sb.append(jsonObject.getString("name") + ",");
|
|
|
|
+// }
|
|
|
|
+// } catch (JSONException e) {
|
|
|
|
+// //主要针对json数组最后的空对象处理,不影响业务eg:"[ { \"name\" : \"Camera\", \"pid\" : \"\", \"vid\" : \"\" },]";
|
|
|
|
+// LOG.error("抓拍照片格式不正确", e);
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// } catch (JSONException e) {
|
|
|
|
+// LOG.error("获取虚拟摄像头名称失败", e);
|
|
|
|
+// throw new StatusException("ExamCaptureService-002", "获取虚拟摄像头名称失败");
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// if (sb.lastIndexOf(",") > -1) {
|
|
|
|
+// return sb.substring(0, sb.lastIndexOf(","));
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// return sb.toString();
|
|
|
|
+// }
|
|
|
|
|
|
private boolean isFaceLivenessPass(String faceLivenessResult) {
|
|
private boolean isFaceLivenessPass(String faceLivenessResult) {
|
|
if (StringUtils.isNotBlank(faceLivenessResult)) {
|
|
if (StringUtils.isNotBlank(faceLivenessResult)) {
|