|
@@ -23,16 +23,12 @@ import cn.com.qmth.stmms.biz.exam.bean.ExamStudentVo;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.InspectHistory;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.SelectiveGroup;
|
|
|
import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
|
|
|
import cn.com.qmth.stmms.biz.exam.query.InspectQuery;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.InspectHistoryService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.InspectedService;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.SelectiveGroupService;
|
|
|
import cn.com.qmth.stmms.biz.utils.TaskLock;
|
|
|
import cn.com.qmth.stmms.biz.utils.TaskLockUtil;
|
|
|
import cn.com.qmth.stmms.common.enums.SelectiveStatus;
|
|
@@ -50,12 +46,6 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
|
|
|
@Autowired
|
|
|
private ExamSubjectService examSubjectService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private MarkGroupService groupService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private SelectiveGroupService selectiveGroupService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private InspectHistoryService inspectHistoryService;
|
|
|
|
|
@@ -162,29 +152,38 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
|
|
|
whereSql.append(" ) ");
|
|
|
}
|
|
|
// 全部选做题为未选做
|
|
|
- List<MarkGroup> groups = groupService
|
|
|
- .findByExamAndSubjectAndSelective(query.getExamId(), query.getSubjectCode(), true);
|
|
|
- List<SelectiveGroup> selectiveGroups = selectiveGroupService
|
|
|
- .findByExamIdAndSubjectCode(query.getExamId(), query.getSubjectCode());
|
|
|
- if (selectiveStatus != null && SelectiveStatus.UN_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
|
|
|
- && !selectiveGroups.isEmpty()) {
|
|
|
- List<Integer> groupNumbers = new ArrayList<Integer>();
|
|
|
- for (int i = 0; i < groups.size(); i++) {
|
|
|
- groupNumbers.add(groups.get(i).getNumber());
|
|
|
- }
|
|
|
- whereSql.append(
|
|
|
- " and not exists (select e.student_id from eb_subjective_score e where e.student_id = s.id and e.group_number in ("
|
|
|
- +StringUtils.join(groupNumbers,",")+") and e.group_score != -1 )");
|
|
|
+// List<MarkGroup> groups = groupService
|
|
|
+// .findByExamAndSubjectAndSelective(query.getExamId(), query.getSubjectCode(), true);
|
|
|
+// List<SelectiveGroup> selectiveGroups = selectiveGroupService
|
|
|
+// .findByExamIdAndSubjectCode(query.getExamId(), query.getSubjectCode());
|
|
|
+// if (selectiveStatus != null && SelectiveStatus.UN_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
|
|
|
+// && !selectiveGroups.isEmpty()) {
|
|
|
+// List<Integer> groupNumbers = new ArrayList<Integer>();
|
|
|
+// for (int i = 0; i < groups.size(); i++) {
|
|
|
+// groupNumbers.add(groups.get(i).getNumber());
|
|
|
+// }
|
|
|
+// whereSql.append(
|
|
|
+// " and not exists (select e.student_id from eb_subjective_score e where e.student_id = s.id and e.group_number in ("
|
|
|
+// +StringUtils.join(groupNumbers,",")+") and e.group_score != -1 )");
|
|
|
+// }
|
|
|
+ if (SelectiveStatus.UN_SELECTIVE.equals(selectiveStatus)) {
|
|
|
+ whereSql.append(
|
|
|
+ " and not exists (select 1 from eb_subjective_score e left join eb_mark_group mg "
|
|
|
+ + " on e.exam_id=mg.exam_id and e.subject_code=mg.subject_code and e.group_number=mg.number"
|
|
|
+ + " where e.student_id = s.id and e.group_score != -1 and mg.is_selective=1)"
|
|
|
+ +" and es.selective=1");
|
|
|
}
|
|
|
// 选做题多选做
|
|
|
- if (selectiveStatus != null && SelectiveStatus.MUTI_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
|
|
|
- && !selectiveGroups.isEmpty()) {
|
|
|
+// if (selectiveStatus != null && SelectiveStatus.MUTI_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
|
|
|
+// && !selectiveGroups.isEmpty()) {
|
|
|
+ if (SelectiveStatus.MUTI_SELECTIVE.equals(selectiveStatus)) {
|
|
|
whereSql.append(
|
|
|
" and exists (select ss.student_id from eb_selective_student ss where ss.student_id = s.id and ss.muti_selective=1)");
|
|
|
}
|
|
|
// 选做题少选做
|
|
|
- if (selectiveStatus != null && SelectiveStatus.LESS_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
|
|
|
- && !selectiveGroups.isEmpty()) {
|
|
|
+// if (selectiveStatus != null && SelectiveStatus.LESS_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
|
|
|
+// && !selectiveGroups.isEmpty()) {
|
|
|
+ if (SelectiveStatus.LESS_SELECTIVE.equals(selectiveStatus)) {
|
|
|
whereSql.append(
|
|
|
" and exists (select ss.student_id from eb_selective_student ss where ss.student_id = s.id and ss.less_selective=1) ");
|
|
|
}
|