1
0
xiatian 10 сар өмнө
parent
commit
11148d6451

+ 10 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/bean/ExamStudentVo.java

@@ -283,6 +283,8 @@ public class ExamStudentVo {
     private Map<String,InspectHistory> inspectHistoryMap;
     
     private Boolean selective;
+    
+    private String selectiveErr;
 
     public Integer getId() {
         return id;
@@ -877,5 +879,13 @@ public class ExamStudentVo {
 	public void setSelective(Boolean selective) {
 		this.selective = selective;
 	}
+
+	public String getSelectiveErr() {
+		return selectiveErr;
+	}
+
+	public void setSelectiveErr(String selectiveErr) {
+		this.selectiveErr = selectiveErr;
+	}
 	
 }

+ 8 - 4
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/impl/InspectedServiceImpl.java

@@ -65,8 +65,10 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
         sql.append(" s.subject_level subjectLevel,s.subject_category subjectCategory,s.college,s.class_name className,s.teacher,");
         sql.append(" s.card_number cardNumber,s.inspect_count inspectCount,s.score_verify_user scoreVerifyUser,");
         sql.append(" s.score_verify_time scoreVerifyTime,s.score_verify_flagged scoreVerifyFlagged,s.inspect_time inspectTime,");
-        sql.append(" s.inspector_id inspectorId,s.inspected ");
+        sql.append(" s.inspector_id inspectorId,s.inspected, ");
+        sql.append(" (case when ss.not_selective=1 or ss.less_selective=1 then '是' else '否' end) selectiveErr ");
         sql.append(" from eb_exam_student s left join eb_exam_subject es on s.exam_id=es.exam_id and s.subject_code=es.code ");
+        sql.append(" left join eb_selective_student ss on ss.student_id = s.id ");
         String whereSql = getWhereSql(query, status, mainNumber, mainStartScore, mainEndScore, selectiveStatus);
         sql.append(whereSql).append(" order by s.inspect_time desc,s.id asc");
         if (!query.isExport()) {
@@ -184,7 +186,7 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
 //                    + " 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");
-            whereSql.append(" and exists (select ss.student_id from eb_selective_student ss where ss.student_id = s.id and ss.not_selective=1)");
+            whereSql.append(" and  ss.not_selective=1 ");
         }
         // 选做题多选做
         // if (selectiveStatus != null &&
@@ -192,7 +194,7 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
         // !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)");
+            whereSql.append(" and  ss.muti_selective=1 ");
         }
         // 选做题少选做
         // if (selectiveStatus != null &&
@@ -200,7 +202,7 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
         // !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) ");
+            whereSql.append(" and  ss.less_selective=1 ");
         }
         return whereSql.toString();
     }
@@ -210,6 +212,7 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
             Double mainEndScore, SelectiveStatus selectiveStatus) {
         StringBuilder countSql = new StringBuilder("select count(s.id) from eb_exam_student s  "
                 + " left join eb_exam_subject es on s.exam_id=es.exam_id and s.subject_code=es.code ");
+        countSql.append(" left join eb_selective_student ss on ss.student_id = s.id ");
         String whereSql = getWhereSql(query, status, mainNumber, mainStartScore, mainEndScore, selectiveStatus);
         countSql.append(whereSql);
         Query countQuery = entityManager.createNativeQuery(countSql.toString());
@@ -225,6 +228,7 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
         query.setInspected(false);
         StringBuilder countSql = new StringBuilder("select count(s.id) from eb_exam_student s "
                 + " left join eb_exam_subject es on s.exam_id=es.exam_id and s.subject_code=es.code ");
+        countSql.append(" left join eb_selective_student ss on ss.student_id = s.id ");
         String whereSql = getWhereSql(query, SubjectiveStatus.MARKED, mainNumber, mainStartScore, mainEndScore,
                 selectiveStatus);
         countSql.append(whereSql);

+ 2 - 0
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/inspectedList.jsp

@@ -144,6 +144,7 @@
     <tr>
         <th><input type="checkbox" id="ids">科目</th>
         <th>密号</th>
+        <th>选做异常</th>
         <th>客观分</th>
         <th>主观分</th>
         <th>试卷总分</th>
@@ -161,6 +162,7 @@
         <tr>
             <td><input type="checkbox" class="ids" name="ids" value="${result.id}">${result.subjectCode}-${result.subjectName}</td>
             <td>${result.secretNumber}</td>
+            <td>${result.selectiveErr}</td>
             <td>${result.objectiveScoreString}</td>
             <td>${result.subjectiveScoreString}</td>
             <td><fmt:formatNumber pattern="###.###" value="${result.totalScore}"/></td>