|
@@ -1,9 +1,11 @@
|
|
|
package cn.com.qmth.stmms.biz.report.utils.module;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
+import cn.com.qmth.stmms.biz.exam.dao.ExamStudentDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
import cn.com.qmth.stmms.biz.report.model.ReportSubject;
|
|
|
import cn.com.qmth.stmms.biz.report.model.ReportSubjectRange;
|
|
@@ -64,12 +66,15 @@ public class SubjectRangeModule implements Module {
|
|
|
service.save(subjectRange);
|
|
|
|
|
|
ReportSubjectService subjectService = SpringContextHolder.getBean(ReportSubjectService.class);
|
|
|
-// ExamStudentService studentService = SpringContextHolder.getBean(ExamStudentService.class);
|
|
|
+ ExamStudentDao studentDao = SpringContextHolder.getBean(ExamStudentDao.class);
|
|
|
ReportSubject subject = subjectService.findOne(this.context.getExamId(), subjectCode);
|
|
|
JSONObject rangeLevel = new JSONObject();
|
|
|
-
|
|
|
- rangeLevel.accumulate("highScore", counter.countGeAndLt(100 - context.getHighValueConfig(), null));
|
|
|
- rangeLevel.accumulate("lowScore", counter.countGeAndLt(null, context.getLowValueConfig()));
|
|
|
+ double highCount = Math.ceil(context.getHighValueConfig() * subject.getRealityCount() * 0.01);
|
|
|
+ double lowCount = Math.ceil(context.getLowValueConfig() * subject.getRealityCount() * 0.01);
|
|
|
+ List<Double> highScore = studentDao.findHighCountTotalSocreByExamIdAndSubjectCode(context.getExamId(), subjectCode, (int)highCount);
|
|
|
+ List<Double> lowScore = studentDao.findLowCountTotalSocreByExamIdAndSubjectCode(context.getExamId(), subjectCode, (int)lowCount);
|
|
|
+ rangeLevel.accumulate("highScore", highScore.isEmpty()?0:highScore.get(highScore.size()-1));
|
|
|
+ rangeLevel.accumulate("lowScore", lowScore.isEmpty()?0:lowScore.get(lowScore.size()-1));
|
|
|
subject.setRangeLevel(rangeLevel.toString());
|
|
|
|
|
|
JSONObject scoreRange = new JSONObject();
|