|
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
@@ -201,8 +202,11 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
List<Integer> organIds = dataList.stream().filter(e -> Objects.nonNull(e.getOrganId())).map(ExamRegistration::getOrganId).collect(Collectors.toList());
|
|
|
Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
|
|
|
|
|
|
- List<Integer> subjectIds = dataList.stream().map(ExamRegistration::getSubjectId).collect(Collectors.toList());
|
|
|
- Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
|
|
|
+ List<Integer> subjectIds = dataList.stream().filter(e->Objects.nonNull(e.getSubjectId())).map(ExamRegistration::getSubjectId).collect(Collectors.toList());
|
|
|
+ Map<Integer, String> subjectIdNameMap = new HashMap<>();
|
|
|
+ if(!CollectionUtils.isEmpty(subjectIds)){
|
|
|
+ subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
|
|
|
+ }
|
|
|
|
|
|
List<Integer> studentIds = dataList.stream().map(ExamRegistration::getStudentId).collect(Collectors.toList());
|
|
|
Map<Integer, String> idPhotoMap = this.getMap("student", "user_id_", "certificate_photo_", studentIds, Integer.class, String.class);
|
|
@@ -212,7 +216,9 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
|
|
|
for (ExamRegistrationRoomDto examRegistration : dataList) {
|
|
|
examRegistration.setOrganization(new Organization(examRegistration.getOrganId(), organIdNameMap.get(examRegistration.getOrganId())));
|
|
|
- examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getSubjectId()));
|
|
|
+ if(Objects.nonNull(examRegistration.getSubjectId())){
|
|
|
+ examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getSubjectId()));
|
|
|
+ }
|
|
|
examRegistration.getSysUser().setCertificatePhoto(idPhotoMap.get(examRegistration.getStudentId()));
|
|
|
examRegistration.setIsFinishedExam(Objects.isNull(registExamStatusMap.get(examRegistration.getId())) ? 3 : registExamStatusMap.get(examRegistration.getId()));
|
|
|
examRegistration.setExaminationBasic(new ExaminationBasic(examRegistration.getExaminationBasicId(), examIdNameMap.get(examRegistration.getExaminationBasicId())));
|