|
@@ -27,6 +27,9 @@ import cn.com.qmth.markingaudit.bean.QuestionDataQuery;
|
|
import cn.com.qmth.markingaudit.bean.QuestionDataVo;
|
|
import cn.com.qmth.markingaudit.bean.QuestionDataVo;
|
|
import cn.com.qmth.markingaudit.bean.RejectDataQuery;
|
|
import cn.com.qmth.markingaudit.bean.RejectDataQuery;
|
|
import cn.com.qmth.markingaudit.bean.RejectDataVo;
|
|
import cn.com.qmth.markingaudit.bean.RejectDataVo;
|
|
|
|
+import cn.com.qmth.markingaudit.bean.ScoreDataQuery;
|
|
|
|
+import cn.com.qmth.markingaudit.bean.ScoreDataVo;
|
|
|
|
+import cn.com.qmth.markingaudit.bean.ScoreInfo;
|
|
import cn.com.qmth.markingaudit.bean.StudentDataQuery;
|
|
import cn.com.qmth.markingaudit.bean.StudentDataQuery;
|
|
import cn.com.qmth.markingaudit.bean.StudentDataVo;
|
|
import cn.com.qmth.markingaudit.bean.StudentDataVo;
|
|
import cn.com.qmth.markingaudit.bean.SubjectDataQuery;
|
|
import cn.com.qmth.markingaudit.bean.SubjectDataQuery;
|
|
@@ -184,4 +187,70 @@ public class MonitorServiceImpl implements MonitorService {
|
|
return monitorDao.rejectData(req);
|
|
return monitorDao.rejectData(req);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<ScoreDataVo> scoreData(ScoreDataQuery req) {
|
|
|
|
+ checkExamIdValid(req.getExamId(), req.getSchoolCode());
|
|
|
|
+ List<ScoreDataVo> ret = monitorDao.scoreData(req);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(ret)) {
|
|
|
|
+ QuestionDataQuery qreq = new QuestionDataQuery();
|
|
|
|
+ qreq.setExamId(req.getExamId());
|
|
|
|
+ qreq.setSubjectCode(req.getSubjectCode());
|
|
|
|
+ List<QuestionDataVo> qs = monitorDao.questionData(qreq);
|
|
|
|
+ for (ScoreDataVo vo : ret) {
|
|
|
|
+ if (SubjectiveStatus.MARKED.equals(vo.getSubjectiveStatus())) {
|
|
|
|
+ List<ScoreInfo> scores = new ArrayList<>();
|
|
|
|
+ vo.setExamInfo(scores);
|
|
|
|
+ int objectiveIndex = 0;
|
|
|
|
+ int subjectiveIndex = 0;
|
|
|
|
+ String[] objectiveStr = null;
|
|
|
|
+ String[] subjectiveStr = null;
|
|
|
|
+ if (StringUtils.isNotBlank(vo.getObjectiveScoreList())) {
|
|
|
|
+ objectiveStr = vo.getObjectiveScoreList().split(";");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(vo.getSubjectiveScoreList())) {
|
|
|
|
+ subjectiveStr = vo.getSubjectiveScoreList().split(";");
|
|
|
|
+ }
|
|
|
|
+ for (QuestionDataVo q : qs) {
|
|
|
|
+ ScoreInfo score = new ScoreInfo();
|
|
|
|
+ scores.add(score);
|
|
|
|
+ if (q.getIsObjective()) {
|
|
|
|
+ score.setMajorName(q.getMajorName());
|
|
|
|
+ score.setMajorNo(q.getMajorNo());
|
|
|
|
+ score.setMinorNo(q.getMinorNo());
|
|
|
|
+ score.setScore(getObjectiveScore(objectiveStr, objectiveIndex));
|
|
|
|
+ objectiveIndex++;
|
|
|
|
+ } else {
|
|
|
|
+ score.setMajorName(q.getMajorName());
|
|
|
|
+ score.setMajorNo(q.getMajorNo());
|
|
|
|
+ score.setMinorNo(q.getMinorNo());
|
|
|
|
+ score.setScore(getSubjectiveScore(subjectiveStr, subjectiveIndex));
|
|
|
|
+ subjectiveIndex++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ vo.setSubjectiveScoreList(null);
|
|
|
|
+ vo.setObjectiveScoreList(null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Double getObjectiveScore(String[] scores, int index) {
|
|
|
|
+ if (scores == null) {
|
|
|
|
+ return 0.0;
|
|
|
|
+ }
|
|
|
|
+ if (index >= scores.length) {
|
|
|
|
+ return 0.0;
|
|
|
|
+ }
|
|
|
|
+ String[] tem = scores[index].split(":");
|
|
|
|
+ return Double.valueOf(tem[1]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Double getSubjectiveScore(String[] scores, int index) {
|
|
|
|
+ if (scores == null) {
|
|
|
|
+ return 0.0;
|
|
|
|
+ }
|
|
|
|
+ return Double.valueOf(scores[index]);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|