Bläddra i källkod

复核查询增加科目选做

xiatian 1 år sedan
förälder
incheckning
0cfb4773d7

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

@@ -281,6 +281,8 @@ public class ExamStudentVo {
     private String problemRestTime;
 
     private Map<String,InspectHistory> inspectHistoryMap;
+    
+    private Boolean selective;
 
     public Integer getId() {
         return id;
@@ -867,4 +869,13 @@ public class ExamStudentVo {
 		vo.copySubjectiveStatus(e.getSubjectiveStatus());
 		return vo;
 	}
+
+	public Boolean getSelective() {
+		return selective;
+	}
+
+	public void setSelective(Boolean selective) {
+		this.selective = selective;
+	}
+	
 }

+ 10 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/query/InspectQuery.java

@@ -119,6 +119,8 @@ public class InspectQuery extends BaseQuery<ExamStudentVo> {
     private Boolean inspectUnrepeated;
     
     private boolean export;
+    
+    private Boolean selective;
 
     public InspectQuery() {
         super();
@@ -557,4 +559,12 @@ public class InspectQuery extends BaseQuery<ExamStudentVo> {
 		this.export = export;
 	}
 
+	public Boolean getSelective() {
+		return selective;
+	}
+
+	public void setSelective(Boolean selective) {
+		this.selective = selective;
+	}
+
 }

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

@@ -76,7 +76,7 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
         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(" from eb_exam_student s ");
+        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 ");
         String whereSql = getWhereSql(query, status, mainNumber, mainStartScore, mainEndScore,selectiveStatus);
         sql.append(whereSql).append(" order by s.inspect_time desc ");
         if(!query.isExport()) {
@@ -98,6 +98,9 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
         if (StringUtils.isNotBlank(query.getSubjectCode())) {
             whereSql.append(" and s.subject_code ='"+query.getSubjectCode()+"'");
         }
+        if (query.getSelective() != null) {
+            whereSql.append(" and es.selective ="+(query.getSelective()?1:0));
+        }
         if (StringUtils.isNotBlank(query.getInspectorName())) {
             whereSql.append(" and exists (select 1 from eb_inspect_history ei left join b_user bu on ei.inspector_id=bu.id "
             		+" where ei.student_id = s.id and bu.login_name like '"+query.getInspectorName()+"%')");
@@ -190,7 +193,8 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
     @Override
     public Integer countByQuery(InspectQuery query, SubjectiveStatus status, Integer mainNumber,
             Double mainStartScore, Double mainEndScore,SelectiveStatus selectiveStatus) {
-        StringBuilder countSql = new StringBuilder("select count(s.id) from eb_exam_student s ");
+        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 ");
         String whereSql = getWhereSql(query, status, mainNumber, mainStartScore, mainEndScore, selectiveStatus);
         countSql.append(whereSql);
         Query countQuery = entityManager.createNativeQuery(countSql.toString());
@@ -202,7 +206,8 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
     @Override
     public Integer needInspectCount(InspectQuery query, Integer mainNumber,
             Double mainStartScore, Double mainEndScore,SelectiveStatus selectiveStatus) {
-    	StringBuilder countSql = new StringBuilder("select count(s.id) from eb_exam_student s ");
+    	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 ");
         String whereSql = getWhereSql(query, SubjectiveStatus.MARKED, mainNumber, mainStartScore, mainEndScore,selectiveStatus);
         countSql.append(whereSql);
         Query countQuery = entityManager.createNativeQuery(countSql.toString());

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

@@ -28,6 +28,12 @@
 				<option value="${subject.code}" <c:if test="${subject.code==query.code}">selected</c:if>>${subject.code}-${subject.name}</option>
 				</c:forEach>
 			</select>
+			<label>选做科目</label>
+			<select class="input-small" name="selective">
+				<option value="" <c:if test="${null==query.selective}">selected</c:if>>不限</option>
+				<option value="1" <c:if test="${query.selective!=null &&query.selective}">selected</c:if>>是</option>
+				<option value="0" <c:if test="${query.selective!=null &&!query.selective}">selected</c:if>>否</option>
+			</select>
 			<c:if test="${web_user.schoolAdmin==true }">
 			<label>完成进度</label>
 			<select class="input-small" name="finished">
@@ -46,6 +52,7 @@
 		<thead>
 			<tr>
 				<th>科目</th>
+				<th>选做科目</th>
 				<th>试卷总量</th>
 				<th>任务数</th>
 				<th>已复核数</th>
@@ -60,6 +67,14 @@
 				<td>
 				${result.subject.code}-${result.subject.name}
 				</td>
+				<td>
+					<c:if test="${result.subject.selective}">
+					是
+					</c:if>
+					<c:if test="${!result.subject.selective}">
+					否
+					</c:if>
+				</td>
 				<td>${result.totalPaperCount}</td>
 				<td>${result.totalCount}</td>
 				<td>${result.inspectedCount}</td>

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

@@ -35,6 +35,13 @@
                 <option value="${subject.code}" <c:if test="${subject.code==query.subjectCode}">selected</c:if>>${subject.code}-${subject.name}</option>
             </c:forEach>
         </select>
+         &nbsp;
+        <label>选做科目</label>
+			<select class="input-small" name="selective">
+				<option value="" <c:if test="${null==query.selective}">selected</c:if>>不限</option>
+				<option value="1" <c:if test="${query.selective!=null &&query.selective}">selected</c:if>>是</option>
+				<option value="0" <c:if test="${query.selective!=null &&!query.selective}">selected</c:if>>否</option>
+			</select>
         &nbsp;
         <label>状态</label>
         <select class="input-small" name="inspected">

+ 2 - 0
stmms-web/src/main/webapp/sql/stmms_ft.sql

@@ -1223,6 +1223,8 @@ INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `pr
 VALUES ('exam_scan', '扫描进度', 'root_code', 'MENU', '/admin/exam/scan', 50,1,'icon-print','index.scan');
 INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
 VALUES ('exam_mark', '评卷管理', 'root_code', 'MENU', '/admin/exam/mark', 60,1,'icon-pencil','index.mark');
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `seq`,`level`)
+VALUES ('arbitrate_exam_number', '仲裁管理准考证号显示', 'exam_mark', 'BUTTON', 1,2);
 INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
 VALUES ('exam_reject_list', '打回试卷', 'root_code', 'MENU', '/admin/exam/reject/list', 70,1,'icon-bookmark','index.reject');
 INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)