|
@@ -73,7 +73,7 @@ public class WarningServiceImpl implements WarningService {
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getTitle(), warningEnum, photoUrl, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getTitle(), warningEnum, photoUrl, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
this.setWarningCount(recordId);
|
|
this.setWarningCount(recordId);
|
|
- this.setPhotoUrls(map, tIeInvigilateWarnInfo, examStudentCacheBean, recordId);
|
|
|
|
|
|
+ this.setPhotoUrls(map, tIeInvigilateWarnInfo, examStudentCacheBean, recordId, teConfig.getMultipleFaceCountError());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (faceCount <= 0) {//未检测到人脸
|
|
} else if (faceCount <= 0) {//未检测到人脸
|
|
@@ -85,7 +85,7 @@ public class WarningServiceImpl implements WarningService {
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getTitle(), warningEnum, photoUrl, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getTitle(), warningEnum, photoUrl, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
this.setWarningCount(recordId);
|
|
this.setWarningCount(recordId);
|
|
- this.setPhotoUrls(map, tIeInvigilateWarnInfo, examStudentCacheBean, recordId);
|
|
|
|
|
|
+ this.setPhotoUrls(map, tIeInvigilateWarnInfo, examStudentCacheBean, recordId, teConfig.getNoFaceCountError());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -115,13 +115,13 @@ public class WarningServiceImpl implements WarningService {
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getTitle(), warningEnum, photoUrl, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getTitle(), warningEnum, photoUrl, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
this.setWarningCount(recordId);
|
|
this.setWarningCount(recordId);
|
|
- this.setPhotoUrls(map, tIeInvigilateWarnInfo, examStudentCacheBean, recordId);
|
|
|
|
|
|
+ this.setPhotoUrls(map, tIeInvigilateWarnInfo, examStudentCacheBean, recordId, teConfig.getMatchFaceCompareErrorCount());
|
|
}
|
|
}
|
|
if (count >= teConfig.getTotalFaceCompareErrorCount()) {
|
|
if (count >= teConfig.getTotalFaceCompareErrorCount()) {
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getTitle(), warningEnum, photoUrl, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getTitle(), warningEnum, photoUrl, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
this.setWarningCount(recordId);
|
|
this.setWarningCount(recordId);
|
|
- this.setPhotoUrls(map, tIeInvigilateWarnInfo, examStudentCacheBean, recordId);
|
|
|
|
|
|
+ this.setPhotoUrls(map, tIeInvigilateWarnInfo, examStudentCacheBean, recordId, teConfig.getTotalFaceCompareErrorCount());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -168,7 +168,7 @@ public class WarningServiceImpl implements WarningService {
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, WarningLevelEnum.D15.name(), WarningLevelEnum.D15.getTitle(), warningEnum, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, WarningLevelEnum.D15.name(), WarningLevelEnum.D15.getTitle(), warningEnum, Objects.nonNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? ExamRecordCacheUtil.getBreachStatus(recordId) : 1);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
|
|
this.setWarningCount(recordId);
|
|
this.setWarningCount(recordId);
|
|
- TEExamStudentLog teExamStudentLog = new TEExamStudentLog(tIeInvigilateWarnInfo.getType().name(), WarningLevelEnum.valueOf(tIeInvigilateWarnInfo.getLevel()).getTitle(), tIeInvigilateWarnInfo.getType().getCode(), examStudentCacheBean.getStudentId(), examStudentCacheBean.getId(), recordId);
|
|
|
|
|
|
+ TEExamStudentLog teExamStudentLog = new TEExamStudentLog(tIeInvigilateWarnInfo.getType().name(), WarningLevelEnum.valueOf(tIeInvigilateWarnInfo.getLevel()).getTitle(), tIeInvigilateWarnInfo.getType().getCode(), examStudentCacheBean.getStudentId(), examStudentCacheBean.getId(), recordId, WarningLevelEnum.valueOf(tIeInvigilateWarnInfo.getLevel()).getSecondTitle());
|
|
teExamStudentLogService.saveOrUpdate(teExamStudentLog);
|
|
teExamStudentLogService.saveOrUpdate(teExamStudentLog);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -195,17 +195,21 @@ public class WarningServiceImpl implements WarningService {
|
|
* @param tIeInvigilateWarnInfo
|
|
* @param tIeInvigilateWarnInfo
|
|
* @param examStudentCacheBean
|
|
* @param examStudentCacheBean
|
|
* @param recordId
|
|
* @param recordId
|
|
|
|
+ * @param count
|
|
*/
|
|
*/
|
|
- public void setPhotoUrls(Map<String, Object> map, TIeInvigilateWarnInfo tIeInvigilateWarnInfo, ExamStudentCacheBean examStudentCacheBean, Long recordId) {
|
|
|
|
|
|
+ public void setPhotoUrls(Map<String, Object> map, TIeInvigilateWarnInfo tIeInvigilateWarnInfo, ExamStudentCacheBean examStudentCacheBean, Long recordId, Integer count) {
|
|
List<String> photoUrls = new ArrayList();
|
|
List<String> photoUrls = new ArrayList();
|
|
if (Objects.nonNull(map.get("photoUrls")) && !Objects.equals(map.get("photoUrls"), "")) {
|
|
if (Objects.nonNull(map.get("photoUrls")) && !Objects.equals(map.get("photoUrls"), "")) {
|
|
String[] s = String.valueOf(map.get("photoUrls")).split(",");
|
|
String[] s = String.valueOf(map.get("photoUrls")).split(",");
|
|
Collections.addAll(photoUrls, s);
|
|
Collections.addAll(photoUrls, s);
|
|
|
|
+ if (photoUrls.size() > count) {
|
|
|
|
+ photoUrls = photoUrls.subList(0, count);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("PHOTOS", photoUrls);
|
|
jsonObject.put("PHOTOS", photoUrls);
|
|
jsonObject.put("MIN_CREATE_TIME", map.get("createTime"));
|
|
jsonObject.put("MIN_CREATE_TIME", map.get("createTime"));
|
|
- TEExamStudentLog teExamStudentLog = new TEExamStudentLog(tIeInvigilateWarnInfo.getType().name(), WarningLevelEnum.valueOf(tIeInvigilateWarnInfo.getLevel()).getTitle(), jsonObject.toJSONString(), examStudentCacheBean.getStudentId(), examStudentCacheBean.getId(), recordId);
|
|
|
|
|
|
+ TEExamStudentLog teExamStudentLog = new TEExamStudentLog(tIeInvigilateWarnInfo.getType().name(), WarningLevelEnum.valueOf(tIeInvigilateWarnInfo.getLevel()).getTitle(), jsonObject.toJSONString(), examStudentCacheBean.getStudentId(), examStudentCacheBean.getId(), recordId, WarningLevelEnum.valueOf(tIeInvigilateWarnInfo.getLevel()).getSecondTitle());
|
|
teExamStudentLogService.saveOrUpdate(teExamStudentLog);
|
|
teExamStudentLogService.saveOrUpdate(teExamStudentLog);
|
|
}
|
|
}
|
|
}
|
|
}
|