|
@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import cn.com.qmth.stmms.biz.exam.dao.MarkGroupDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.dao.MarkGroupStudentDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.dao.MarkerDao;
|
|
|
+import cn.com.qmth.stmms.biz.exam.dao.SelectiveStudentDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.dao.SubjectiveScoreDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
@@ -29,6 +30,7 @@ import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroupStudent;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.SelectiveGroup;
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.SelectiveStudent;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.SubjectiveScore;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
@@ -132,6 +134,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
@Autowired
|
|
|
private SelectiveGroupService selectiveGroupService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SelectiveStudentDao selectiveStudentDao;
|
|
|
+
|
|
|
private Map<Integer, Long> markerLastUpdateTime = new ConcurrentHashMap<>();
|
|
|
|
|
|
/**
|
|
@@ -266,6 +271,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
group.getNumber());
|
|
|
scoreDao.deleteByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber());
|
|
|
+ selectiveStudentDao.deleteByExamIdAndSubjectCode(group.getExamId(), group.getSubjectCode());
|
|
|
// 删除分组
|
|
|
releaseByGroup(group);
|
|
|
groupDao.delete(group);
|
|
@@ -519,6 +525,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
// 主观状态与得分明细
|
|
|
groupStudentDao.deleteByStudentId(student.getId());
|
|
|
scoreDao.deleteByStudentId(student.getId());
|
|
|
+ selectiveStudentDao.delete(student.getId());
|
|
|
updateAllCount(student.getExamId(), student.getSubjectCode());
|
|
|
}
|
|
|
|
|
@@ -952,6 +959,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
// 计算选做题分数
|
|
|
BigDecimal totalScore = BigDecimal.ZERO;
|
|
|
+ boolean lessSelective = false;
|
|
|
+ boolean mutiSelective = false;
|
|
|
ExamStudent student = studentService.findById(studentId);
|
|
|
Map<Integer, List<SelectiveGroup>> indexMap = selectiveGroupService.findGroupByExamIdAndSubjectCode(
|
|
|
student.getExamId(), student.getSubjectCode());
|
|
@@ -1039,7 +1048,23 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (partScoreList.size() < selectiveCount) {
|
|
|
+ lessSelective = true;
|
|
|
+ }
|
|
|
+ if (partScoreList.size() > selectiveCount) {
|
|
|
+ mutiSelective = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ SelectiveStudent selectiveStudent = selectiveStudentDao.findOne(studentId);
|
|
|
+ if (selectiveStudent == null) {
|
|
|
+ selectiveStudent = new SelectiveStudent();
|
|
|
+ selectiveStudent.setExamId(student.getExamId());
|
|
|
+ selectiveStudent.setSubjectCode(student.getSubjectCode());
|
|
|
+ selectiveStudent.setStudentId(studentId);
|
|
|
}
|
|
|
+ selectiveStudent.setLessSelective(lessSelective);
|
|
|
+ selectiveStudent.setMutiSelective(mutiSelective);
|
|
|
+ selectiveStudentDao.saveAndFlush(selectiveStudent);
|
|
|
// 计算非选做题总分
|
|
|
for (Integer mainNumber : scoreMap.keySet()) {
|
|
|
totalScore = totalScore.add(BigDecimal.valueOf(scoreMap.get(mainNumber)));
|
|
@@ -1492,6 +1517,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
groupStudentDao.updateStatusByExamIdAndSubjectCodeAndGroupNumber(examId, subjectCode, groupNumber,
|
|
|
SubjectiveStatus.UNMARK);
|
|
|
scoreDao.deleteByExamIdAndSubjectCodeAndGroupNumber(examId, subjectCode, groupNumber);
|
|
|
+ selectiveStudentDao.deleteByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
studentService.updateSubjectiveStatusAndScoreAndInspectorId(examId, subjectCode, SubjectiveStatus.UNMARK, 0,
|
|
|
null, null, null);
|
|
|
}
|