|
@@ -1,13 +1,16 @@
|
|
package com.qmth.distributed.print.business.service.impl;
|
|
package com.qmth.distributed.print.business.service.impl;
|
|
|
|
|
|
-import com.qmth.distributed.print.business.bean.dto.open.PaperConfig;
|
|
|
|
-import com.qmth.distributed.print.business.bean.dto.open.PaperDimension;
|
|
|
|
-import com.qmth.distributed.print.business.bean.dto.open.PaperEvaluation;
|
|
|
|
-import com.qmth.distributed.print.business.bean.dto.open.PaperStructure;
|
|
|
|
-import com.qmth.distributed.print.business.entity.GradeBatchPaper;
|
|
|
|
-import com.qmth.distributed.print.business.entity.GradeModuleDefine;
|
|
|
|
-import com.qmth.distributed.print.business.entity.GradeModuleEvaluation;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.qmth.distributed.print.business.bean.dto.open.*;
|
|
|
|
+import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
|
+import com.qmth.teachcloud.common.entity.BasicMajor;
|
|
|
|
+import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
|
|
+import com.qmth.teachcloud.common.service.BasicMajorService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -37,9 +40,18 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
@Resource
|
|
@Resource
|
|
private GradeModuleEvaluationService gradeModuleEvaluationService;
|
|
private GradeModuleEvaluationService gradeModuleEvaluationService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ ExamTaskService examTaskService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ BasicMajorService basicMajorService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private TSyncExamStudentScoreService tSyncExamStudentScoreService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
- public PaperConfig getPaperConfig(String thirdExamId, String gradeCourseCode) {
|
|
|
|
- GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(thirdExamId, gradeCourseCode);
|
|
|
|
|
|
+ public PaperConfig getPaperConfig(BasicSchool basicSchool, String thirdExamId, String gradeCourseCode) {
|
|
|
|
+ GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(basicSchool.getId(), thirdExamId, gradeCourseCode);
|
|
if (gradeBatchPaper == null) {
|
|
if (gradeBatchPaper == null) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -47,8 +59,8 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public PaperDimension getPaperDimension(String thirdExamId, String gradeCourseCode) {
|
|
|
|
- GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(thirdExamId, gradeCourseCode);
|
|
|
|
|
|
+ public PaperDimension getPaperDimension(BasicSchool basicSchool, String thirdExamId, String gradeCourseCode) {
|
|
|
|
+ GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(basicSchool.getId(), thirdExamId, gradeCourseCode);
|
|
if (gradeBatchPaper == null) {
|
|
if (gradeBatchPaper == null) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -56,8 +68,8 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public PaperStructure getPaperStructure(String thirdExamId, String gradeCourseCode) {
|
|
|
|
- GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(thirdExamId, gradeCourseCode);
|
|
|
|
|
|
+ public PaperStructure getPaperStructure(BasicSchool basicSchool, String thirdExamId, String gradeCourseCode) {
|
|
|
|
+ GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(basicSchool.getId(), thirdExamId, gradeCourseCode);
|
|
if (gradeBatchPaper == null) {
|
|
if (gradeBatchPaper == null) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -66,16 +78,17 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<PaperEvaluation> getPaperEvaluation(String thirdExamId, String gradeCourseCode) {
|
|
|
|
- GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(thirdExamId, gradeCourseCode);
|
|
|
|
|
|
+ public List<PaperEvaluation> getPaperEvaluation(BasicSchool basicSchool, String thirdExamId, String gradeCourseCode) {
|
|
|
|
+ List<PaperEvaluation> paperEvaluations = new ArrayList<>();
|
|
|
|
+ GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(basicSchool.getId(), thirdExamId, gradeCourseCode);
|
|
if (gradeBatchPaper == null) {
|
|
if (gradeBatchPaper == null) {
|
|
- return null;
|
|
|
|
|
|
+ return paperEvaluations;
|
|
}
|
|
}
|
|
List<GradeModuleDefine> gradeModuleDefineList = gradeModuleDefineService.findBySchoolIdAndPaperNumberAndPaperType(gradeBatchPaper.getSchoolId(), gradeBatchPaper.getPaperNumber(), gradeBatchPaper.getPaperType());
|
|
List<GradeModuleDefine> gradeModuleDefineList = gradeModuleDefineService.findBySchoolIdAndPaperNumberAndPaperType(gradeBatchPaper.getSchoolId(), gradeBatchPaper.getPaperNumber(), gradeBatchPaper.getPaperType());
|
|
List<GradeModuleEvaluation> gradeModuleEvaluationList = gradeModuleEvaluationService.findBySchoolIdAndPaperNumberAndPaperType(gradeBatchPaper.getSchoolId(), gradeBatchPaper.getPaperNumber(), gradeBatchPaper.getPaperType());
|
|
List<GradeModuleEvaluation> gradeModuleEvaluationList = gradeModuleEvaluationService.findBySchoolIdAndPaperNumberAndPaperType(gradeBatchPaper.getSchoolId(), gradeBatchPaper.getPaperNumber(), gradeBatchPaper.getPaperType());
|
|
// 分组(分隔符_)
|
|
// 分组(分隔符_)
|
|
if (!gradeModuleDefineList.isEmpty()) {
|
|
if (!gradeModuleDefineList.isEmpty()) {
|
|
- List<PaperEvaluation> paperEvaluations = new ArrayList<>();
|
|
|
|
|
|
+
|
|
Map<String, List<GradeModuleDefine>> stringListMap = gradeModuleDefineList.stream().collect(Collectors.groupingBy(m -> m.getModuleType() + "_" + m.getInterpret() + "_" + m.getRemark()));
|
|
Map<String, List<GradeModuleDefine>> stringListMap = gradeModuleDefineList.stream().collect(Collectors.groupingBy(m -> m.getModuleType() + "_" + m.getInterpret() + "_" + m.getRemark()));
|
|
for (Map.Entry<String, List<GradeModuleDefine>> stringListEntry : stringListMap.entrySet()) {
|
|
for (Map.Entry<String, List<GradeModuleDefine>> stringListEntry : stringListMap.entrySet()) {
|
|
String[] key = stringListEntry.getKey().split("_");
|
|
String[] key = stringListEntry.getKey().split("_");
|
|
@@ -117,6 +130,62 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|
}
|
|
}
|
|
return paperEvaluations;
|
|
return paperEvaluations;
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
+ return paperEvaluations;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<ExamStudentScore> listExamStudentScore(BasicSchool basicSchool, String thirdExamId, String gradeCourseCode, Integer pageNumber, Integer pageSize) {
|
|
|
|
+ GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.findByThirdExamIdAndGradeCourseCode(basicSchool.getId(), thirdExamId, gradeCourseCode);
|
|
|
|
+ if (gradeBatchPaper == null) {
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ QueryWrapper<ExamTask> examTaskQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ examTaskQueryWrapper.lambda().eq(ExamTask::getSchoolId, gradeBatchPaper.getSchoolId())
|
|
|
|
+ .eq(ExamTask::getPaperNumber, gradeBatchPaper.getPaperNumber());
|
|
|
|
+ ExamTask examTask = examTaskService.getOne(examTaskQueryWrapper);
|
|
|
|
+
|
|
|
|
+ QueryWrapper<TSyncExamStudentScore> examStudentScoreQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ String subjectCode = examTask.getCourseCode() + gradeBatchPaper.getPaperType() + examTask.getSequence();
|
|
|
|
+ examStudentScoreQueryWrapper.lambda().eq(TSyncExamStudentScore::getSchoolId, gradeBatchPaper.getSchoolId())
|
|
|
|
+ .eq(TSyncExamStudentScore::getSubjectCode, subjectCode);
|
|
|
|
+
|
|
|
|
+ Page<TSyncExamStudentScore> page = new Page<>(pageNumber, pageSize);
|
|
|
|
+ IPage<TSyncExamStudentScore> tSyncExamStudentScoreIPage = tSyncExamStudentScoreService.page(page, examStudentScoreQueryWrapper);
|
|
|
|
+ return 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());
|
|
|
|
+ examStudentScore.setTeacherName(m.getTeacher());
|
|
|
|
+ // todo 任课老师code 20220530
|
|
|
|
+// examStudentScore.setTeacherCode(m.g);
|
|
|
|
+ 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);
|
|
|
|
+ List<ExamStudentScore.TopicInfo> objectiveTopic = new ArrayList<>();
|
|
|
|
+ if (jsonObject.containsKey("objectiveScoreDetail")) {
|
|
|
|
+ String objective = jsonObject.getString("objectiveScoreDetail");
|
|
|
|
+ objectiveTopic = JSON.parseArray(objective, ExamStudentScore.TopicInfo.class);
|
|
|
|
+ }
|
|
|
|
+ examStudentScore.setObjectiveScoreDetail(objectiveTopic);
|
|
|
|
+
|
|
|
|
+ List<ExamStudentScore.TopicInfo> subjectiveTopic = new ArrayList<>();
|
|
|
|
+ if (jsonObject.containsKey("subjectiveScoreDetail")) {
|
|
|
|
+ String subjective = jsonObject.getString("subjectiveScoreDetail");
|
|
|
|
+ subjectiveTopic = JSON.parseArray(subjective, ExamStudentScore.TopicInfo.class);
|
|
|
|
+ }
|
|
|
|
+ examStudentScore.setSubjectiveScoreDetail(subjectiveTopic);
|
|
|
|
+ return examStudentScore;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
}
|
|
}
|
|
}
|
|
}
|