1
0
ting.yin 3 жил өмнө
parent
commit
0eec17e075

+ 3 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/dao/ExamStudentDao.java

@@ -198,4 +198,7 @@ public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent,
 
 
     public List<ExamStudent> findByExamIdAndStudentCodeAndSubjectCode(int examId, String studentCode, String subjectCode);
     public List<ExamStudent> findByExamIdAndStudentCodeAndSubjectCode(int examId, String studentCode, String subjectCode);
 
 
+    @Query("select sum(s.sheetCount) from ExamStudent s where s.examId=?1 ")
+    public long sumSheetCountByExamId(Integer examId);
+
 }
 }

+ 22 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/model/ExamStudent.java

@@ -329,6 +329,12 @@ public class ExamStudent implements Serializable {
     @Transient
     @Transient
     private ProblemType problemType;
     private ProblemType problemType;
 
 
+    @Transient
+    private String problemUserName;
+
+    @Transient
+    private String problemRestTime;
+
     public Integer getId() {
     public Integer getId() {
         return id;
         return id;
     }
     }
@@ -854,4 +860,20 @@ public class ExamStudent implements Serializable {
         this.inspector = inspector;
         this.inspector = inspector;
     }
     }
 
 
+    public String getProblemUserName() {
+        return problemUserName;
+    }
+
+    public void setProblemUserName(String problemUserName) {
+        this.problemUserName = problemUserName;
+    }
+
+    public String getProblemRestTime() {
+        return problemRestTime;
+    }
+
+    public void setProblemRestTime(String problemRestTime) {
+        this.problemRestTime = problemRestTime;
+    }
+
 }
 }

+ 2 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/ExamStudentService.java

@@ -148,4 +148,6 @@ public interface ExamStudentService {
     long countByExamIdAndSubjectCodeAndStatus(int examId, String subjectCode, SubjectiveStatus... status);
     long countByExamIdAndSubjectCodeAndStatus(int examId, String subjectCode, SubjectiveStatus... status);
 
 
     public ExamStudent randomStudent(Integer examId, String code);
     public ExamStudent randomStudent(Integer examId, String code);
+
+    public long countSheetCountByExamId(Integer examId);
 }
 }

+ 5 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/impl/ExamStudentServiceImpl.java

@@ -1065,4 +1065,9 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
         return list.get(RandomUtils.nextInt(list.size()));
         return list.get(RandomUtils.nextInt(list.size()));
 
 
     }
     }
+
+    @Override
+    public long countSheetCountByExamId(Integer examId) {
+        return studentDao.sumSheetCountByExamId(examId);
+    }
 }
 }

+ 0 - 8
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/dao/ProblemHistoryDao.java

@@ -15,14 +15,6 @@ import java.util.Set;
 public interface ProblemHistoryDao extends JpaRepository<ProblemHistory, Integer>,
 public interface ProblemHistoryDao extends JpaRepository<ProblemHistory, Integer>,
         JpaSpecificationExecutor<ProblemHistory> {
         JpaSpecificationExecutor<ProblemHistory> {
 
 
-    List<ProblemHistory> findByExamIdAndSubjectCode(Integer examId, String subjectCode, Pageable page);
-
-    List<ProblemHistory> findByExamIdAndSubjectCodeAndStatus(Integer examId, String subjectCode, HistoryStatus status,
-            Pageable page);
-
-    List<ProblemHistory> findByExamIdAndSubjectCodeAndStatusIn(Integer examId, String subjectCode,
-            Set<HistoryStatus> statusSet, Pageable page);
-
     @Modifying
     @Modifying
     @Query("delete ProblemHistory m where m.studentId=?1")
     @Query("delete ProblemHistory m where m.studentId=?1")
     void deleteByStudentId(Integer studentId);
     void deleteByStudentId(Integer studentId);

+ 12 - 0
stmms-common/src/main/java/cn/com/qmth/stmms/common/enums/HistoryStatus.java

@@ -46,4 +46,16 @@ public enum HistoryStatus {
         }
         }
         return options;
         return options;
     }
     }
+
+    public static List<HistoryStatus> getProblemStatusList() {
+        if (options == null) {
+            options = new LinkedList<>();
+            for (HistoryStatus status : HistoryStatus.values()) {
+                if (status != MARKED) {
+                    options.add(status);
+                }
+            }
+        }
+        return options;
+    }
 }
 }

+ 7 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/ExamController.java

@@ -178,6 +178,7 @@ public class ExamController extends BaseExamController {
         // long markerCount = markerService.countByExam(exam.getId());
         // long markerCount = markerService.countByExam(exam.getId());
         long scanCount = examStudentService.countByExamIdAndUpload(examId, true);
         long scanCount = examStudentService.countByExamIdAndUpload(examId, true);
         long markedCount = examStudentService.countByExamIdAndSubjectiveScoreListIsNotNull(examId);
         long markedCount = examStudentService.countByExamIdAndSubjectiveScoreListIsNotNull(examId);
+        long sheetCount = examStudentService.countSheetCountByExamId(examId);
 
 
         List<ExamInfoVO> voList = new ArrayList<ExamInfoVO>();
         List<ExamInfoVO> voList = new ArrayList<ExamInfoVO>();
 
 
@@ -201,6 +202,11 @@ public class ExamController extends BaseExamController {
         scan.setAttr("已扫描 " + scanCount + " 个考生");
         scan.setAttr("已扫描 " + scanCount + " 个考生");
         scan.setUrl("/admin/exam/scan");
         scan.setUrl("/admin/exam/scan");
 
 
+        ExamInfoVO sheet = new ExamInfoVO();
+        sheet.setName("扫描张数");
+        sheet.setAttr("已扫描 " + sheetCount + " 张");
+        sheet.setUrl("/admin/exam/scan");
+
         ExamInfoVO mark = new ExamInfoVO();
         ExamInfoVO mark = new ExamInfoVO();
         mark.setName("评卷进度");
         mark.setName("评卷进度");
         mark.setAttr("已评完 " + markedCount + " 个考生");
         mark.setAttr("已评完 " + markedCount + " 个考生");
@@ -209,6 +215,7 @@ public class ExamController extends BaseExamController {
         voList.add(student);
         voList.add(student);
         voList.add(subject);
         voList.add(subject);
         voList.add(scan);
         voList.add(scan);
+        voList.add(sheet);
         voList.add(mark);
         voList.add(mark);
         model.addAttribute("exam", exam);
         model.addAttribute("exam", exam);
         model.addAttribute("list", voList);
         model.addAttribute("list", voList);

+ 13 - 3
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/ProblemHistoryController.java

@@ -36,6 +36,7 @@ import cn.com.qmth.stmms.biz.mark.service.MarkLibraryService;
 import cn.com.qmth.stmms.biz.mark.service.MarkService;
 import cn.com.qmth.stmms.biz.mark.service.MarkService;
 import cn.com.qmth.stmms.biz.mark.service.ProblemHistoryService;
 import cn.com.qmth.stmms.biz.mark.service.ProblemHistoryService;
 import cn.com.qmth.stmms.biz.mark.service.ProblemTypeService;
 import cn.com.qmth.stmms.biz.mark.service.ProblemTypeService;
+import cn.com.qmth.stmms.biz.user.model.User;
 import cn.com.qmth.stmms.biz.user.service.UserService;
 import cn.com.qmth.stmms.biz.user.service.UserService;
 import cn.com.qmth.stmms.common.annotation.Logging;
 import cn.com.qmth.stmms.common.annotation.Logging;
 import cn.com.qmth.stmms.common.annotation.RoleRequire;
 import cn.com.qmth.stmms.common.annotation.RoleRequire;
@@ -102,8 +103,10 @@ public class ProblemHistoryController extends BaseExamController {
             String subjectCodeIn = StringUtils.join(wu.getSubjectCodeSet(), ",");
             String subjectCodeIn = StringUtils.join(wu.getSubjectCodeSet(), ",");
             query.setSubjectCodeIn(subjectCodeIn);
             query.setSubjectCodeIn(subjectCodeIn);
         }
         }
+        if (query.getStatus() == null) {
+            query.setStatus(HistoryStatus.WAITING);
+        }
         query.setExamId(examId);
         query.setExamId(examId);
-        query.setStatus(HistoryStatus.WAITING);
         query.orderByExamNumber();
         query.orderByExamNumber();
         query = historyService.findByQuery(query);
         query = historyService.findByQuery(query);
 
 
@@ -112,14 +115,21 @@ public class ProblemHistoryController extends BaseExamController {
             ExamStudent student = studentService.findById(history.getStudentId());
             ExamStudent student = studentService.findById(history.getStudentId());
             student.setNumber(history.getGroupNumber());
             student.setNumber(history.getGroupNumber());
             student.setProblemType(problemMap.get(history.getProblemId()));
             student.setProblemType(problemMap.get(history.getProblemId()));
-            student.setMarkTime(DateUtils.formatDateTime(history.getCreateTime()));
             student.setLibraryId(history.getLibraryId());
             student.setLibraryId(history.getLibraryId());
             if (history.getMarkerId() != null) {
             if (history.getMarkerId() != null) {
-                student.setMarkLogin(userService.findByMarkerId(history.getMarkerId()).getLoginName());
+                User user = userService.findByMarkerId(history.getMarkerId());
+                student.setMarkLogin(user.getLoginName() + " " + user.getName());
+                student.setMarkTime(DateUtils.formatDateTime(history.getCreateTime()));
+            }
+            if (history.getUserId() != null) {
+                User user = userService.findById(history.getUserId());
+                student.setProblemUserName(user.getLoginName() + " " + user.getName());
+                student.setProblemRestTime(DateUtils.formatDateTime(history.getUpdateTime()));
             }
             }
             list.add(student);
             list.add(student);
         }
         }
         model.addAttribute("resultList", list);
         model.addAttribute("resultList", list);
+        model.addAttribute("statusList", HistoryStatus.getProblemStatusList());
         model.addAttribute("query", query);
         model.addAttribute("query", query);
         model.addAttribute("subjectList", getProblemSubject(examId, wu));
         model.addAttribute("subjectList", getProblemSubject(examId, wu));
         model.addAttribute("problemList", problemTypes);
         model.addAttribute("problemList", problemTypes);

+ 29 - 1
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/problemHistory.jsp

@@ -37,11 +37,24 @@
             </c:forEach>
             </c:forEach>
         </select>
         </select>
         &nbsp;
         &nbsp;
+        <label>状态</label>
+        <select class="input-medium" name="status">
+            <c:forEach items="${statusList}" var="status">
+                <option value="${status.value}" <c:if test="${status.value==query.status.value}">selected</c:if>>
+                	<c:if test="${status=='BACK'}">已处理</c:if>
+                	<c:if test="${status!='BACK'}">${status.name}</c:if>
+                </option>
+            </c:forEach>
+        </select>
+        &nbsp;<br/>
         <label>考生编号</label>
         <label>考生编号</label>
         <input type="text" name="secretNumber" id="secretNumber" value="${query.secretNumber}" class="input-medium"/>
         <input type="text" name="secretNumber" id="secretNumber" value="${query.secretNumber}" class="input-medium"/>
         &nbsp;
         &nbsp;
         <input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
         <input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
+        
+        <c:if test="${query.status=='WAITING'}">
         <input id="btnRest" class="btn" type="button" value="批量重置" onclick="goRest()"/>
         <input id="btnRest" class="btn" type="button" value="批量重置" onclick="goRest()"/>
+        </c:if>
     </div>
     </div>
 </form>
 </form>
 <tags:message content="${message}"/>
 <tags:message content="${message}"/>
@@ -52,12 +65,15 @@
     	<th><input type="checkbox" id="checkAll"></th>
     	<th><input type="checkbox" id="checkAll"></th>
         <th>科目</th>
         <th>科目</th>
         <th>分组序号</th>
         <th>分组序号</th>
+        <th>状态</th>
         <th>准考证号</th>
         <th>准考证号</th>
         <th>考生编号</th>
         <th>考生编号</th>
         <th>姓名</th>
         <th>姓名</th>
         <th>评卷员</th>
         <th>评卷员</th>
         <th>提交时间</th>
         <th>提交时间</th>
         <th>问题类型</th>
         <th>问题类型</th>
+        <th>处理人</th>
+        <th>处理时间</th>
         <th>操作</th>
         <th>操作</th>
     </tr>
     </tr>
     </thead>
     </thead>
@@ -67,6 +83,14 @@
         	<td><input type="checkbox" class="libraryIds" name="libraryIds" value="${result.libraryId}"></td>
         	<td><input type="checkbox" class="libraryIds" name="libraryIds" value="${result.libraryId}"></td>
             <td>${result.subjectCode}-${result.subjectName}</td>
             <td>${result.subjectCode}-${result.subjectName}</td>
             <td>${result.number}</td>
             <td>${result.number}</td>
+            <td>
+            		<c:if test="${query.status=='WAITING'}">
+                        待处理
+                    </c:if>
+                    <c:if test="${query.status=='BACK'}">
+                        已处理
+                    </c:if>
+            </td>
             <td>
             <td>
             	<c:if test="${web_user.subjectHeader==true && forbiddenInfo==true}">
             	<c:if test="${web_user.subjectHeader==true && forbiddenInfo==true}">
 	            ***
 	            ***
@@ -87,11 +111,15 @@
             <td>${result.markLogin}</td>
             <td>${result.markLogin}</td>
             <td>${result.markTime}</td>
             <td>${result.markTime}</td>
             <td>${result.problemType.name}</td>
             <td>${result.problemType.name}</td>
+            <td>${result.problemUserName}</td>
+            <td>${result.problemRestTime}</td>
             <td>
             <td>
                 <%--  <a class="json-link" href="${ctx}/admin/exam/library/getJson?studentId=${result.id}&groupNumber=${result.number}" target="_blank">原图</a>--%>
                 <%--  <a class="json-link" href="${ctx}/admin/exam/library/getJson?studentId=${result.id}&groupNumber=${result.number}" target="_blank">原图</a>--%>
                	<a href="${ctx}/web/admin/exam/track/library?libraryId=${result.libraryId}&subjectCode=${result.subjectCode}" target="_blank">试卷详情</a>
                	<a href="${ctx}/web/admin/exam/track/library?libraryId=${result.libraryId}&subjectCode=${result.subjectCode}" target="_blank">试卷详情</a>
                 &nbsp;
                 &nbsp;
-                <a href="##" data-id="${result.libraryId}" class="back-link">重置</a>
+                <c:if test="${result.problemUserName==null}">
+	                <a href="##" data-id="${result.libraryId}" class="back-link">重置</a>
+                </c:if>
             </td>
             </td>
         </tr>
         </tr>
     </c:forEach>
     </c:forEach>