|
@@ -29,10 +29,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.File;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Optional;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -61,6 +58,9 @@ public class ExamAssignServiceImpl extends ServiceImpl<ExamAssignMapper, ExamAss
|
|
|
@Resource
|
|
|
ExamAssignMapper examAssignMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ ExamCourseMappingService examCourseMappingService;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<ExamAssignDto> pageData(Long semesterId, Long examTypeId, Long collegeId, String courseCode, Integer pageNumber, Integer pageSize) {
|
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
@@ -71,13 +71,24 @@ public class ExamAssignServiceImpl extends ServiceImpl<ExamAssignMapper, ExamAss
|
|
|
if (examSyncTotal == null) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("未设置使用数据文件,请联系管理员处理");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
List<ExamSyncStudent> examSyncStudents = examSyncStudentService.listByExamSyncTotalId(examSyncTotal);
|
|
|
for (ExamAssignDto record : assignListDtoIPage.getRecords()) {
|
|
|
int actualCount = 0;
|
|
|
String kkxy = "";
|
|
|
|
|
|
+ // 查询关联课程
|
|
|
+ List<ExamCourseMapping> examCourseMappings = examCourseMappingService.listBySemesterIdAndExamTypeIdAndCloudMarkCourseCode(schoolId, semesterId, examTypeId, record.getCourseCode());
|
|
|
if (!CollectionUtils.isEmpty(examSyncStudents)) {
|
|
|
- List<ExamSyncStudent> syncStudents = examSyncStudents.stream().filter(m -> m.getKch().equals(record.getCourseCode())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<String> courses = Arrays.asList(record.getCourseCode().split(","));
|
|
|
+ if(!CollectionUtils.isEmpty(examCourseMappings)){
|
|
|
+ courses = examCourseMappings.stream().map(ExamCourseMapping::getSyncCourseCode).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<String> finalCourses = courses;
|
|
|
+ List<ExamSyncStudent> syncStudents = examSyncStudents.stream().filter(m -> finalCourses.contains(m.getKch())).collect(Collectors.toList());
|
|
|
actualCount = syncStudents.size();
|
|
|
List<String> kkxyList = syncStudents.stream().map(ExamSyncStudent::getKkbm).distinct().collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(kkxyList) && kkxyList.size() > 1) {
|