|
@@ -9,8 +9,10 @@ import com.keao.edu.common.tenant.TenantContextHolder;
|
|
import com.keao.edu.user.api.entity.ExamRoom;
|
|
import com.keao.edu.user.api.entity.ExamRoom;
|
|
import com.keao.edu.user.dao.ExamRoomDao;
|
|
import com.keao.edu.user.dao.ExamRoomDao;
|
|
import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
|
|
import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
|
|
|
|
+import com.keao.edu.user.dao.StudentExamResultDao;
|
|
import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
|
|
import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
|
|
import com.keao.edu.user.entity.ExamRoomStudentRelation;
|
|
import com.keao.edu.user.entity.ExamRoomStudentRelation;
|
|
|
|
+import com.keao.edu.user.entity.StudentExamResult;
|
|
import com.keao.edu.user.entity.Subject;
|
|
import com.keao.edu.user.entity.Subject;
|
|
import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
|
|
import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
|
|
import com.keao.edu.user.service.ExamRoomStudentRelationService;
|
|
import com.keao.edu.user.service.ExamRoomStudentRelationService;
|
|
@@ -33,6 +35,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
private ExamRoomDao examRoomDao;
|
|
private ExamRoomDao examRoomDao;
|
|
@Autowired
|
|
@Autowired
|
|
private OrganizationService organizationService;
|
|
private OrganizationService organizationService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private StudentExamResultDao studentExamResultDao;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
|
|
public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
|
|
@@ -60,6 +64,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
Set<Integer> existStudentIds = studentsWithExamRoom.stream().map(ExamRoomStudentRelation::getStudentId).collect(Collectors.toSet());
|
|
Set<Integer> existStudentIds = studentsWithExamRoom.stream().map(ExamRoomStudentRelation::getStudentId).collect(Collectors.toSet());
|
|
String[] studentIds = studentIdsStr.split(",");
|
|
String[] studentIds = studentIdsStr.split(",");
|
|
List<ExamRoomStudentRelation> examRoomStudentRelations=new ArrayList<>();
|
|
List<ExamRoomStudentRelation> examRoomStudentRelations=new ArrayList<>();
|
|
|
|
+ List<StudentExamResult> studentExamResults=new ArrayList<>();
|
|
for (String studentId : studentIds) {
|
|
for (String studentId : studentIds) {
|
|
if(existStudentIds.contains(Integer.valueOf(studentId))){
|
|
if(existStudentIds.contains(Integer.valueOf(studentId))){
|
|
continue;
|
|
continue;
|
|
@@ -70,10 +75,21 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
e.setStudentId(Integer.valueOf(studentId));
|
|
e.setStudentId(Integer.valueOf(studentId));
|
|
e.setTenantId(TenantContextHolder.getTenantId().toString());
|
|
e.setTenantId(TenantContextHolder.getTenantId().toString());
|
|
examRoomStudentRelations.add(e);
|
|
examRoomStudentRelations.add(e);
|
|
|
|
+
|
|
|
|
+ StudentExamResult ser = new StudentExamResult();
|
|
|
|
+ ser.setExaminationBasicId(examRoom.getExaminationBasicId());
|
|
|
|
+ ser.setStudentId(Integer.valueOf(studentId));
|
|
|
|
+ ser.setIsFinishedExam(false);
|
|
|
|
+ ser.setConfirmStatus(false);
|
|
|
|
+ ser.setTenantId(TenantContextHolder.getTenantId().toString());
|
|
|
|
+ studentExamResults.add(ser);
|
|
}
|
|
}
|
|
if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
|
|
if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
|
|
examRoomStudentRelationDao.batchInsert(examRoomStudentRelations);
|
|
examRoomStudentRelationDao.batchInsert(examRoomStudentRelations);
|
|
}
|
|
}
|
|
|
|
+ if(!CollectionUtils.isEmpty(studentExamResults)){
|
|
|
|
+ studentExamResultDao.batchInsert(studentExamResults);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|