|
@@ -9,19 +9,26 @@ import com.qmth.eds.bean.dto.ExamSyncStudentDto;
|
|
|
import com.qmth.eds.bean.dto.ScoreDownloadDto;
|
|
|
import com.qmth.eds.bean.result.StudentMarkResult;
|
|
|
import com.qmth.eds.common.entity.CloudMarkingScore;
|
|
|
+import com.qmth.eds.common.entity.ExamCourseMapping;
|
|
|
import com.qmth.eds.common.entity.SysUser;
|
|
|
import com.qmth.eds.common.util.ServletUtil;
|
|
|
import com.qmth.eds.mapper.CloudMarkingScoreMapper;
|
|
|
import com.qmth.eds.service.CloudMarkingScoreService;
|
|
|
+import com.qmth.eds.service.ExamCourseMappingService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class CloudMarkingScoreServiceImpl extends ServiceImpl<CloudMarkingScoreMapper, CloudMarkingScore> implements CloudMarkingScoreService {
|
|
|
|
|
|
+ @Resource
|
|
|
+ ExamCourseMappingService examCourseMappingService;
|
|
|
@Resource
|
|
|
CloudMarkingScoreMapper cloudMarkingScoreMapper;
|
|
|
|
|
@@ -42,8 +49,8 @@ public class CloudMarkingScoreServiceImpl extends ServiceImpl<CloudMarkingScoreM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<ExamSyncStudentDto> listExamSyncStudentDtos(Long schoolId, Long semesterId, Long examTypeId, String courseCode, String openCollege) {
|
|
|
- return this.baseMapper.listExamSyncStudentDtos(schoolId, semesterId, examTypeId, courseCode, openCollege);
|
|
|
+ public List<ExamSyncStudentDto> listExamSyncStudentDtos(Long schoolId, Long semesterId, Long examTypeId, List<String> courses, String openCollege) {
|
|
|
+ return this.baseMapper.listExamSyncStudentDtos(schoolId, semesterId, examTypeId, courses, openCollege);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -58,7 +65,14 @@ public class CloudMarkingScoreServiceImpl extends ServiceImpl<CloudMarkingScoreM
|
|
|
@Override
|
|
|
public List<StudentMarkResult> queryStudentMark(Long semesterId, Long examTypeId, Long collegeId, String openCollege, String courseCode) {
|
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
- return cloudMarkingScoreMapper.queryStudentMark(schoolId, collegeId, semesterId, examTypeId, openCollege, courseCode);
|
|
|
+ // 查询关联课程
|
|
|
+ List<ExamCourseMapping> examCourseMappings = examCourseMappingService.listBySemesterIdAndExamTypeIdAndCloudMarkCourseCode(schoolId, semesterId, examTypeId, courseCode);
|
|
|
+
|
|
|
+ List<String> courses = Arrays.asList(courseCode.split(","));
|
|
|
+ if (!CollectionUtils.isEmpty(examCourseMappings)) {
|
|
|
+ courses = examCourseMappings.stream().map(ExamCourseMapping::getSyncCourseCode).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ return cloudMarkingScoreMapper.queryStudentMark(schoolId, collegeId, semesterId, examTypeId, openCollege, courses);
|
|
|
}
|
|
|
|
|
|
@Override
|