wangwei hace 7 años
padre
commit
f92e830f1b

+ 2 - 7
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamStudentTempRepo.java

@@ -1,14 +1,7 @@
 package cn.com.qmth.examcloud.core.examwork.dao;
 
-import java.util.List;
-
-import javax.persistence.QueryHint;
-
-import org.springframework.cache.annotation.Cacheable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.jpa.repository.QueryHints;
 import org.springframework.data.jpa.repository.query.Procedure;
 import org.springframework.data.repository.query.Param;
 import org.springframework.data.repository.query.QueryByExampleExecutor;
@@ -31,4 +24,6 @@ public interface ExamStudentTempRepo
 	@Procedure(name = "import_exam_students")
 	void processExamStudentTemp(@Param("batch_id") Long batchId);
 
+	void deleteByBatchId(Long batchId);
+
 }

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

@@ -110,6 +110,8 @@ public class ExamStudentImportServiceImpl implements ExamStudentImportService {
 		examStudentTempRepo.processExamStudentTemp(batchId);
 
 		saveExamStudents(batchId);
+
+		examStudentTempRepo.deleteByBatchId(batchId);
 	}
 
 	private void saveExamStudents(Long batchId) {