WANG 5 年之前
父节点
当前提交
f973f30e81

+ 8 - 2
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamStudentCloudServiceProvider.java

@@ -422,6 +422,7 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
 		Long rootOrgId = req.getRootOrgId();
 		Long examId = req.getExamId();
 		String examCode = req.getExamCode();
+		String examName = req.getExamName();
 		Long studentId = req.getStudentId();
 		String identityNumber = req.getIdentityNumber();
 		Long courseId = req.getCourseId();
@@ -441,6 +442,11 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
 			if (null == examEntity) {
 				throw new StatusException("088002", "exam is not present");
 			}
+		} else if (StringUtils.isNotBlank(examName)) {
+			examEntity = examRepo.findByNameAndRootOrgId(examName, rootOrgId);
+			if (null == examEntity) {
+				throw new StatusException("088003", "exam is not present");
+			}
 		}
 
 		if (null == courseId && StringUtils.isBlank(courseCode)) {
@@ -461,8 +467,8 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
 		GetStudentResp gsResp = studentCloudService.getStudent(gsReq);
 		StudentBean studentBean = gsResp.getStudentInfo();
 
-		ExamStudentEntity es = examStudentRepo.findByExamIdAndStudentIdAndCourseId(examId,
-				studentBean.getId(), courseBean.getId());
+		ExamStudentEntity es = examStudentRepo.findByExamIdAndStudentIdAndCourseId(
+				examEntity.getId(), studentBean.getId(), courseBean.getId());
 
 		es.setEnable(enable);