|
@@ -17,6 +17,7 @@ import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -170,24 +171,8 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
|
IPage<TSyncExamStudentScore> tSyncExamStudentScoreIPage = tSyncExamStudentScoreService.page(page, examStudentScoreQueryWrapper);
|
|
|
examStudentScoreList = tSyncExamStudentScoreIPage.getRecords().stream().map(m -> {
|
|
|
ExamStudentScore examStudentScore = new ExamStudentScore();
|
|
|
- examStudentScore.setName(m.getName());
|
|
|
- examStudentScore.setStudentCode(m.getStudentCode());
|
|
|
- examStudentScore.setPaperNumber(gradeBatchPaper.getPaperNumber());
|
|
|
- examStudentScore.setPaperName(m.getSubjectName());
|
|
|
- examStudentScore.setPaperType(gradeBatchPaper.getPaperType());
|
|
|
- examStudentScore.setCollege(m.getCollege());
|
|
|
- BasicMajor basicMajor = basicMajorService.getById(m.getMajorId());
|
|
|
- examStudentScore.setMajor(basicMajor == null ? null : basicMajor.getName());
|
|
|
- examStudentScore.setClassName(m.getClazzName());
|
|
|
- GradeBatchStudentClazz gradeBatchStudentClazz = gradeBatchStudentClazzList.isEmpty() ? null : gradeBatchStudentClazzList.stream().filter(s -> s.getClazzId().equals(m.getClazzId().toString()) && s.getPaperNumber().equals(examStudentScore.getPaperNumber()) && s.getPaperType().equals(examStudentScore.getPaperType())).findFirst().orElseGet(null);
|
|
|
- examStudentScore.setTeacherName(gradeBatchStudentClazz != null ? gradeBatchStudentClazz.getTeacherName() : null);
|
|
|
- examStudentScore.setTeacherCode(gradeBatchStudentClazz != null ? gradeBatchStudentClazz.getTeacherNumber() : null);
|
|
|
- examStudentScore.setStatus(m.getStatus());
|
|
|
- examStudentScore.setTotalScore(m.getTotalScore());
|
|
|
- examStudentScore.setObjectiveScore(m.getObjectiveScore());
|
|
|
- examStudentScore.setSubjectiveScore(m.getSubjectiveScore());
|
|
|
String syncData = m.getSyncData();
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(syncData);
|
|
|
+ JSONObject jsonObject = JSON.parseObject(syncData);
|
|
|
List<ExamStudentScore.TopicInfo> objectiveTopic = new ArrayList<>();
|
|
|
if (jsonObject.containsKey("objectiveScoreDetail")) {
|
|
|
String objective = jsonObject.getString("objectiveScoreDetail");
|
|
@@ -201,8 +186,30 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
|
subjectiveTopic = JSON.parseArray(subjective, ExamStudentScore.TopicInfo.class);
|
|
|
}
|
|
|
examStudentScore.setSubjectiveScoreDetail(subjectiveTopic);
|
|
|
- return examStudentScore;
|
|
|
+
|
|
|
+ if (objectiveTopic.isEmpty() && subjectiveTopic.isEmpty()) {
|
|
|
+ return null;
|
|
|
+ } else {
|
|
|
+ examStudentScore.setName(m.getName());
|
|
|
+ examStudentScore.setStudentCode(m.getStudentCode());
|
|
|
+ examStudentScore.setPaperNumber(gradeBatchPaper.getPaperNumber());
|
|
|
+ examStudentScore.setPaperName(m.getSubjectName());
|
|
|
+ examStudentScore.setPaperType(gradeBatchPaper.getPaperType());
|
|
|
+ examStudentScore.setCollege(m.getCollege());
|
|
|
+ BasicMajor basicMajor = basicMajorService.getById(m.getMajorId());
|
|
|
+ examStudentScore.setMajor(basicMajor == null ? null : basicMajor.getName());
|
|
|
+ examStudentScore.setClassName(m.getClazzName());
|
|
|
+ GradeBatchStudentClazz gradeBatchStudentClazz = gradeBatchStudentClazzList.isEmpty() ? null : gradeBatchStudentClazzList.stream().filter(s -> s.getClazzId().equals(m.getClazzId().toString()) && s.getPaperNumber().equals(examStudentScore.getPaperNumber()) && s.getPaperType().equals(examStudentScore.getPaperType())).findFirst().orElseGet(null);
|
|
|
+ examStudentScore.setTeacherName(gradeBatchStudentClazz != null ? gradeBatchStudentClazz.getTeacherName() : null);
|
|
|
+ examStudentScore.setTeacherCode(gradeBatchStudentClazz != null ? gradeBatchStudentClazz.getTeacherNumber() : null);
|
|
|
+ examStudentScore.setStatus(m.getStatus());
|
|
|
+ examStudentScore.setTotalScore(m.getTotalScore());
|
|
|
+ examStudentScore.setObjectiveScore(m.getObjectiveScore());
|
|
|
+ examStudentScore.setSubjectiveScore(m.getSubjectiveScore());
|
|
|
+
|
|
|
+ return examStudentScore;
|
|
|
+ }
|
|
|
}).collect(Collectors.toList());
|
|
|
- return examStudentScoreList;
|
|
|
+ return examStudentScoreList.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
}
|
|
|
}
|