|
@@ -1,9 +1,11 @@
|
|
|
package cn.com.qmth.stmms.biz.report.utils;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
@@ -12,9 +14,6 @@ import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
|
import cn.com.qmth.stmms.biz.report.model.SasConfigItem;
|
|
|
-import cn.com.qmth.stmms.biz.report.service.ReportSubjectClassGroupService;
|
|
|
-import cn.com.qmth.stmms.biz.report.service.ReportSubjectGroupService;
|
|
|
-import cn.com.qmth.stmms.biz.report.service.ReportSubjectService;
|
|
|
import cn.com.qmth.stmms.biz.report.service.ReportSubjectTeacherClassService;
|
|
|
import cn.com.qmth.stmms.biz.report.service.ReportSubjectTeacherService;
|
|
|
import cn.com.qmth.stmms.biz.report.utils.module.SubjectClassGroupModule;
|
|
@@ -46,6 +45,8 @@ public class ReportContext {
|
|
|
|
|
|
private Map<String, ExamQuestion> groupMap;
|
|
|
|
|
|
+ private Map<String, Set<String>> paperTypeMap;
|
|
|
+
|
|
|
private SasConfigItem sasConfigItem;
|
|
|
|
|
|
public ReportContext(Exam exam) {
|
|
@@ -54,6 +55,7 @@ public class ReportContext {
|
|
|
this.subjectMap = new HashMap<String, ExamSubject>();
|
|
|
this.questionMap = new HashMap<String, ExamQuestion>();
|
|
|
this.groupMap = new HashMap<String, ExamQuestion>();
|
|
|
+ this.paperTypeMap = new HashMap<String, Set<String>>();
|
|
|
// 以下modules创建有顺序
|
|
|
this.sasConfigItem = SpringContextHolder.getBean(SasConfigItem.class);
|
|
|
this.modules.add(new SubjectModule(this));
|
|
@@ -109,6 +111,15 @@ public class ReportContext {
|
|
|
groupMap.put(groupKey, question);
|
|
|
}
|
|
|
}
|
|
|
+ Set<String> paparTypeSet = paperTypeMap.get(student.getSubjectCode());
|
|
|
+ if (paparTypeSet == null) {
|
|
|
+ paparTypeSet = new HashSet<String>();
|
|
|
+ }
|
|
|
+ String paperType = StringUtils.trimToNull(student.getPaperType());
|
|
|
+ if (paperType != null) {
|
|
|
+ paparTypeSet.add(paperType);
|
|
|
+ }
|
|
|
+ paperTypeMap.put(student.getSubjectCode(), paparTypeSet);
|
|
|
}
|
|
|
|
|
|
private String getQuestionKey(ExamQuestion question) {
|
|
@@ -130,13 +141,6 @@ public class ReportContext {
|
|
|
ReportSubjectTeacherClassService teacherClassService = SpringContextHolder
|
|
|
.getBean(ReportSubjectTeacherClassService.class);
|
|
|
teacherClassService.updateRelativeAvgScore(this.getExamId());
|
|
|
- ReportSubjectGroupService subjectGroupService = SpringContextHolder.getBean(ReportSubjectGroupService.class);
|
|
|
- subjectGroupService.updateQuestionCount(this.getExamId());
|
|
|
- ReportSubjectClassGroupService subjectClassGroupService = SpringContextHolder
|
|
|
- .getBean(ReportSubjectClassGroupService.class);
|
|
|
- subjectClassGroupService.updateQuestionCount(this.getExamId());
|
|
|
- ReportSubjectService subjectService = SpringContextHolder.getBean(ReportSubjectService.class);
|
|
|
- subjectService.updateQuestionCount(this.getExamId());
|
|
|
}
|
|
|
|
|
|
public Double getPassScore() {
|
|
@@ -199,4 +203,8 @@ public class ReportContext {
|
|
|
public Double getLowValueConfig() {
|
|
|
return sasConfigItem.getHighValue();
|
|
|
}
|
|
|
+
|
|
|
+ public Set<String> getPaperType(String subjectCode) {
|
|
|
+ return paperTypeMap.get(subjectCode);
|
|
|
+ }
|
|
|
}
|