|
@@ -2,10 +2,12 @@ package cn.com.qmth.examcloud.core.examwork.service.impl;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamSkipFaceRepo;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamSkipFaceEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamSkipFaceService;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.bean.ExamSkipFaceInfo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.bean.ExamSkipFaceQuery;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.ArrayUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -19,6 +21,8 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Service
|
|
@@ -106,4 +110,33 @@ public class ExamSkipFaceServiceImpl implements ExamSkipFaceService {
|
|
|
return sql.toString();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void settingExamSkipFace(Long examId, Long[] examStudentIds, Boolean enabled, Long operateId) {
|
|
|
+ if (examId == null) {
|
|
|
+ throw new StatusException("考试ID不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ArrayUtils.isEmpty(examStudentIds)) {
|
|
|
+ throw new StatusException("考生ID集合不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ log.warn("设置考试跳过人脸名单!examId:{} examStudentIds:{} enabled:{} operateId:{}",
|
|
|
+ examId, examStudentIds, enabled, operateId);
|
|
|
+
|
|
|
+ if (enabled) {
|
|
|
+ for (Long examStudentId : examStudentIds) {
|
|
|
+ ExamSkipFaceEntity entity = new ExamSkipFaceEntity();
|
|
|
+ entity.setExamId(examId);
|
|
|
+ entity.setExamStudentId(examStudentId);
|
|
|
+ entity.setOperateId(operateId);
|
|
|
+ entity.setCreationTime(new Date());
|
|
|
+ entity.setUpdateTime(new Date());
|
|
|
+ examSkipFaceRepo.save(entity);
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ examSkipFaceRepo.deleteByExamIdAndExamStudentIdIn(examId, Arrays.asList(examStudentIds));
|
|
|
+ }
|
|
|
+
|
|
|
}
|