|
@@ -21,6 +21,7 @@ import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 导入导出模版处理逻辑 impl
|
|
@@ -56,6 +57,9 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
@Resource
|
|
|
TBUserRoleService tbUserRoleService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TEExamCourseService teExamCourseService;
|
|
|
+
|
|
|
/**
|
|
|
* 考生导入逻辑
|
|
|
*
|
|
@@ -78,6 +82,24 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
Gson gson = new Gson();
|
|
|
Set<String> roomCodeAndNameSet = new HashSet<>();
|
|
|
Map<String, TEExamActivity> teExamActivityMap = (Map<String, TEExamActivity>) map.get("teExamActivityMap");
|
|
|
+ Map<String, String> courseCodeMap = (Map<String, String>) map.get("courseCodeMap");
|
|
|
+ QueryWrapper<TEExamCourse> teExamCourseQueryWrapper = new QueryWrapper<>();
|
|
|
+ Set<String> courseCodeSet = courseCodeMap.keySet().stream().collect(Collectors.toSet());
|
|
|
+ teExamCourseQueryWrapper.lambda().in(TEExamCourse::getCourseCode, courseCodeSet);
|
|
|
+ List<TEExamCourse> teExamCourseList = teExamCourseService.list(teExamCourseQueryWrapper);
|
|
|
+ if (Objects.nonNull(teExamCourseList) && teExamCourseList.size() > 0) {
|
|
|
+ teExamCourseList.forEach(s -> {
|
|
|
+ courseCodeMap.remove(s.getCourseCode());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ List<TEExamCourse> teExamCourses = new ArrayList<>();
|
|
|
+ courseCodeMap.forEach((k, v) -> {
|
|
|
+ TEExamCourse teExamCourse = new TEExamCourse(examId, k, v, createId);
|
|
|
+ teExamCourses.add(teExamCourse);
|
|
|
+ });
|
|
|
+ if (teExamCourses.size() > 0) {
|
|
|
+ teExamCourseService.saveBatch(teExamCourses);
|
|
|
+ }
|
|
|
|
|
|
//保存用户
|
|
|
for (int i = 0; i < finalList.size(); i++) {
|
|
@@ -118,6 +140,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
}
|
|
|
teExamStudent.setStudentId(teStudent.getId());
|
|
|
teExamStudent.setCreateId(createId);
|
|
|
+ teExamStudent.setCourseCode(examStudentImportDto.getCourseCode());
|
|
|
+ teExamStudent.setCourseName(examStudentImportDto.getCourseName());
|
|
|
} else {
|
|
|
teExamStudent.setUpdateId(createId);
|
|
|
teExamStudent.setName(examStudentImportDto.getName());
|
|
@@ -126,6 +150,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
teExamStudent.setClassNo(examStudentImportDto.getClassNo());
|
|
|
teExamStudent.setRoomCode(examStudentImportDto.getRoomCode());
|
|
|
teExamStudent.setRoomName(examStudentImportDto.getRoomName());
|
|
|
+ teExamStudent.setCourseCode(examStudentImportDto.getCourseCode());
|
|
|
+ teExamStudent.setCourseName(examStudentImportDto.getCourseName());
|
|
|
if (Objects.nonNull(teExamActivity)) {
|
|
|
teExamStudent.setExamActivityId(teExamActivity.getId());
|
|
|
}
|