|
@@ -38,10 +38,12 @@ import cn.com.qmth.examcloud.core.oe.admin.base.utils.Check;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamAuditRepo;
|
|
|
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.ExamScoreRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamStudentRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamAuditEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamCaptureEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamScoreEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentFinalScoreEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.DisciplineType;
|
|
@@ -72,8 +74,8 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
*/
|
|
|
private static final long serialVersionUID = 8280332746440316604L;
|
|
|
|
|
|
-// @Autowired
|
|
|
-// private ExamScoreRepo examScoreRepo;
|
|
|
+ @Autowired
|
|
|
+ private ExamScoreRepo examScoreRepo;
|
|
|
|
|
|
@Autowired
|
|
|
private ExamRecordDataRepo examRecordDataRepo;
|
|
@@ -106,14 +108,14 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
@ApiOperation(value = "根据分数id查询考试记录,学生信息,分数信息等数据")
|
|
|
@PostMapping("/findExamScoreDataByScoreId")
|
|
|
public FindExamScoreDataResp findExamScoreDataByScoreId(@RequestBody FindExamScoreDataReq findExamScoreDataReq) {
|
|
|
-// long scoreId = findExamScoreDataReq.getScoreId();
|
|
|
-// ExamScoreEntity examScore = GlobalHelper.getEntity(examScoreRepo, scoreId, ExamScoreEntity.class);
|
|
|
- ExamRecordDataEntity examRecordDataEntity = GlobalHelper.getEntity(examRecordDataRepo, findExamScoreDataReq.getExamRecordDataId(), ExamRecordDataEntity.class);
|
|
|
+ long scoreId = findExamScoreDataReq.getScoreId();
|
|
|
+ ExamScoreEntity examScore = GlobalHelper.getEntity(examScoreRepo, scoreId, ExamScoreEntity.class);
|
|
|
+ ExamRecordDataEntity examRecordDataEntity = GlobalHelper.getEntity(examRecordDataRepo, examScore.getExamRecordDataId(), ExamRecordDataEntity.class);
|
|
|
ExamStudentEntity examStudentEntity = examStudentRepo.findByExamStudentId(examRecordDataEntity.getExamStudentId());
|
|
|
|
|
|
FindExamScoreDataResp findExamScoreDataResp = new FindExamScoreDataResp();
|
|
|
List<ExamScoreDataBean> examScoreDatas = new ArrayList<ExamScoreDataBean>();
|
|
|
- examScoreDatas.add(buildExamScoreDataBean(examRecordDataEntity, examStudentEntity));
|
|
|
+ examScoreDatas.add(buildExamScoreDataBean(examScore, examRecordDataEntity, examStudentEntity));
|
|
|
findExamScoreDataResp.setExamScoreDatas(examScoreDatas);
|
|
|
|
|
|
return findExamScoreDataResp;
|
|
@@ -129,9 +131,9 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
|
|
|
List<ExamScoreDataBean> examScoreDatas = new ArrayList<ExamScoreDataBean>();
|
|
|
for (ExamRecordDataEntity examRecordData : examRecordDataList) {
|
|
|
-// ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
+ ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
ExamStudentEntity examStudent = examStudentRepo.findByExamStudentId(examRecordData.getExamStudentId());
|
|
|
- examScoreDatas.add(buildExamScoreDataBean(examRecordData, examStudent));
|
|
|
+ examScoreDatas.add(buildExamScoreDataBean(examScore, examRecordData, examStudent));
|
|
|
}
|
|
|
|
|
|
FindExamScoreDataResp findExamScoreDataResp = new FindExamScoreDataResp();
|
|
@@ -139,7 +141,8 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
return findExamScoreDataResp;
|
|
|
}
|
|
|
|
|
|
- private ExamScoreDataBean buildExamScoreDataBean(ExamRecordDataEntity examRecordDataEntity, ExamStudentEntity examStudentEntity) {
|
|
|
+ private ExamScoreDataBean buildExamScoreDataBean(
|
|
|
+ ExamScoreEntity examScore, ExamRecordDataEntity examRecordDataEntity, ExamStudentEntity examStudentEntity) {
|
|
|
ExamScoreDataBean examScoreDataBean = new ExamScoreDataBean();
|
|
|
examScoreDataBean.setExamId(examStudentEntity.getExamId());
|
|
|
examScoreDataBean.setStudentName(examStudentEntity.getStudentName());
|
|
@@ -153,10 +156,10 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
examScoreDataBean.setEndTime(examRecordDataEntity.getEndTime());
|
|
|
examScoreDataBean.setSuccPercent(examRecordDataEntity.getFaceSuccessPercent());
|
|
|
examScoreDataBean.setIsIllegality(examRecordDataEntity.getIsIllegality());
|
|
|
- examScoreDataBean.setScoreId(examRecordDataEntity.getId());
|
|
|
- examScoreDataBean.setTotalScore(examRecordDataEntity.getTotalScore());
|
|
|
- examScoreDataBean.setObjectiveScore(examRecordDataEntity.getObjectiveScore());
|
|
|
- examScoreDataBean.setSubjectiveScore(examRecordDataEntity.getSubjectiveScore());
|
|
|
+ examScoreDataBean.setScoreId(examScore.getId());
|
|
|
+ examScoreDataBean.setTotalScore(examScore.getTotalScore());
|
|
|
+ examScoreDataBean.setObjectiveScore(examScore.getObjectiveScore());
|
|
|
+ examScoreDataBean.setSubjectiveScore(examScore.getSubjectiveScore());
|
|
|
return examScoreDataBean;
|
|
|
}
|
|
|
|
|
@@ -169,7 +172,7 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
if (null == examRecordData) {
|
|
|
throw new StatusException("getScoreData-exception", "请求参数不正确");
|
|
|
}
|
|
|
-// ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examRecordDataId);
|
|
|
+ ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examRecordDataId);
|
|
|
|
|
|
GetScoreDataResp resp = new GetScoreDataResp();
|
|
|
resp.setExamRecordDataId(examRecordDataId);
|
|
@@ -182,7 +185,7 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
resp.setCourseName(courseBean.getName());
|
|
|
resp.setStartTime(examRecordData.getStartTime());
|
|
|
resp.setEndTime(examRecordData.getEndTime());
|
|
|
- resp.setTotalScore(examRecordData.getTotalScore());
|
|
|
+ resp.setTotalScore(examScore.getTotalScore());
|
|
|
|
|
|
resp.setIsWarn(examRecordData.getIsWarn());
|
|
|
resp.setIsAudit(examRecordData.getIsAudit());
|
|
@@ -327,10 +330,10 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
List<ScoreDataBean> scoreDataBeanList = new ArrayList<ScoreDataBean>();
|
|
|
List<ExamRecordDataEntity> examRecordList = examRecordDataRepo.findAll(Example.of(selectCondition));
|
|
|
for (ExamRecordDataEntity examRecordData : examRecordList) {
|
|
|
-// ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
-// if (examScore == null) {
|
|
|
-// throw new StatusException("100001", "该考生未交卷");
|
|
|
-// }
|
|
|
+ ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
+ if (examScore == null) {
|
|
|
+ throw new StatusException("100001", "该考生未交卷");
|
|
|
+ }
|
|
|
|
|
|
ScoreDataBean scoreDataBean = new ScoreDataBean();
|
|
|
scoreDataBean.setExamRecordDataId(examRecordData.getId());
|
|
@@ -342,7 +345,7 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
scoreDataBean.setCourseName(courseBean.getName());
|
|
|
scoreDataBean.setStartTime(examRecordData.getStartTime());
|
|
|
scoreDataBean.setEndTime(examRecordData.getEndTime());
|
|
|
- scoreDataBean.setTotalScore(examRecordData.getTotalScore());
|
|
|
+ scoreDataBean.setTotalScore(examScore.getTotalScore());
|
|
|
|
|
|
scoreDataBean.setIsWarn(examRecordData.getIsWarn());
|
|
|
scoreDataBean.setIsAudit(examRecordData.getIsAudit());
|
|
@@ -422,16 +425,16 @@ public class ExamScoreDataCloudServiceProvider extends ControllerSupport impleme
|
|
|
|
|
|
//如果查不到有效的分数集合,则将所有的考试分数集合均返回
|
|
|
resp.setAbsent(false);
|
|
|
- List<ExamRecordDataEntity> allExamScoreList =
|
|
|
+ List<ExamScoreEntity> allExamScoreList =
|
|
|
examScoreService.getAllExamScoreList(req.getExamId(), identityNumber, courseId);
|
|
|
if (allExamScoreList == null) {
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
List<ScoreDataBean> scoreDataBeanList = new ArrayList<>();
|
|
|
- for (ExamRecordDataEntity scoreEntity : allExamScoreList) {
|
|
|
+ for (ExamScoreEntity scoreEntity : allExamScoreList) {
|
|
|
scoreDataBeanList.add(buildScoreDataBean(identityNumber,
|
|
|
- courseBean, scoreEntity.getTotalScore(), scoreEntity.getId()));
|
|
|
+ courseBean, scoreEntity.getTotalScore(), scoreEntity.getExamRecordDataId()));
|
|
|
}
|
|
|
resp.setAllScoreDataBeanList(scoreDataBeanList);
|
|
|
resp.setAudit(scoreDataBeanList.stream().anyMatch(p -> p.getIsAudit() == null || !p.getIsAudit()));
|