wangwei преди 6 години
родител
ревизия
e7f172b436

+ 2 - 0
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamCourseRelationRepo.java

@@ -20,4 +20,6 @@ public interface ExamCourseRelationRepo
 			QueryByExampleExecutor<ExamCourseRelationEntity>,
 			JpaSpecificationExecutor<ExamCourseRelationEntity> {
 
+	void deleteByExamId(Long examId);
+
 }

+ 2 - 0
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamPaperTypeRelationRepo.java

@@ -17,4 +17,6 @@ public interface ExamPaperTypeRelationRepo
 
 	List<ExamPaperTypeRelationEntity> findByExamIdAndCourseId(Long examId, Long courseId);
 
+	void deleteByExamId(Long examId);
+
 }

+ 2 - 0
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamStudentServiceImpl.java

@@ -138,6 +138,8 @@ public class ExamStudentServiceImpl implements ExamStudentService {
 			throw new StatusException("E-150113", "该考试已开始,不能删除");
 		}
 		examStudentRepo.deleteByExamId(examId);
+		examCourseRelationRepo.deleteByExamId(examId);
+		examPaperTypeRelationRepo.deleteByExamId(examId);
 
 		// 同步操作
 		SyncExamStudentReq req = new SyncExamStudentReq();