浏览代码

修复仲裁处理及查询问题;更新导入主观题逻辑为仅增加;

ting.yin 6 年之前
父节点
当前提交
8093d436cc

+ 1 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkServiceImpl.java

@@ -637,7 +637,7 @@ public class MarkServiceImpl implements MarkService {
     @Transactional
     public void processArbitrate(ArbitrateHistory history) {
         lockService.waitUnlockGroup(history.getExamId(), history.getSubjectCode(), history.getGroupNumber());
-        arbitrateDao.save(history);
+        arbitrateDao.saveAndFlush(history);
         libraryDao.updateHeaderResult(history.getStudentId(), history.getGroupNumber(), history.getUserId(),
                 history.getTotalScore(), history.getScoreList(), history.getUpdateTime(), LibraryStatus.ARBITRATED);
         updateLibraryCount(history.getExamId(), history.getSubjectCode(), history.getGroupNumber());

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

@@ -1,5 +1,8 @@
 package cn.com.qmth.stmms.common.enums;
 
+import java.util.LinkedList;
+import java.util.List;
+
 public enum HistoryStatus {
 
     WAITING("待处理", 0), MARKED("已给分", 1), BACK("已打回", 2);
@@ -7,6 +10,8 @@ public enum HistoryStatus {
     private String name;
 
     private int value;
+    
+    private static List<HistoryStatus> options;
 
     private HistoryStatus(String name, int value) {
         this.name = name;
@@ -29,4 +34,16 @@ public enum HistoryStatus {
         }
         return null;
     }
+    
+    public static List<HistoryStatus> getOptionList() {
+        if (options == null) {
+            options = new LinkedList<>();
+            for (HistoryStatus status : HistoryStatus.values()) {
+                if (status != BACK) {
+                    options.add(status);
+                }
+            }
+        }
+        return options;
+    }
 }

+ 1 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/ArbitrateController.java

@@ -105,7 +105,7 @@ public class ArbitrateController extends BaseExamController {
         model.addAttribute("query", query);
         model.addAttribute("subjectList", subjectList);
         model.addAttribute("groupList", groupList);
-        model.addAttribute("statusList", HistoryStatus.values());
+        model.addAttribute("statusList", HistoryStatus.getOptionList());
         return "modules/exam/arbitrateList";
     }
 

+ 3 - 11
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/PaperController.java

@@ -185,21 +185,13 @@ public class PaperController extends BaseExamController {
                                 questionService.save(question);
                             }
                         } else {
-                        	questionService.deleteByExamAndSubjectAndObjective(examId,dto.getSubjectCode(), false);
                             for (MarkGroup group : dto.getGroups().values()) {
-                            	for (ExamQuestion question : group.getQuestionList()) {
-                            		questionService.save(question);
-                            	}
                             	MarkGroup old = groupService.findOne(examId, group.getSubjectCode(), group.getNumber()) ;
                                 if (old==null) {
+                                	for (ExamQuestion question : group.getQuestionList()) {
+                                		questionService.save(question);
+                                	}
                                     groupService.save(group);
-                                }else{
-                                	old.setScorePolicy(group.getScorePolicy());
-                                	old.setArbitrateThreshold(group.getArbitrateThreshold());
-                                	old.setDoubleRate(group.getDoubleRate());
-                                	old.setMarkMode(group.getMarkMode());
-                                	old.setTrialCount(group.getTrialCount());
-                                	groupService.save(old);
                                 }
                             }
                         }

+ 14 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/common/controller/BaseController.java

@@ -18,6 +18,7 @@ import cn.com.qmth.stmms.biz.user.service.UserService;
 import cn.com.qmth.stmms.biz.utils.ScoreCalculateUtil;
 import cn.com.qmth.stmms.biz.utils.ScoreInfo;
 import cn.com.qmth.stmms.common.enums.ExamSubjectStatus;
+import cn.com.qmth.stmms.common.enums.HistoryStatus;
 import cn.com.qmth.stmms.common.enums.LibraryStatus;
 import cn.com.qmth.stmms.common.enums.MarkMode;
 import cn.com.qmth.stmms.common.enums.MarkStatus;
@@ -134,6 +135,19 @@ public class BaseController {
                 }
             }
         });
+        
+        // HistoryStatus 类型转换
+        binder.registerCustomEditor(HistoryStatus.class, new PropertyEditorSupport() {
+
+            @Override
+            public void setAsText(String text) {
+                try {
+                    setValue(HistoryStatus.findByValue(Integer.valueOf(text)));
+                } catch (Exception e) {
+                    setValue(null);
+                }
+            }
+        });
 
         binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor(true));
     }

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

@@ -36,7 +36,7 @@
             <select class="input-small" id="status-select" name="status">
                 <option value="">不限</option>
                 <c:forEach items="${statusList}" var="item">
-                <option value="${item.value}" <c:if test="${query.status!=null && item.value==query.status.value}">selected</c:if>>${item.name}</option>
+	            <option value="${item.value}" <c:if test="${query.status!=null && item.value==query.status.value}">selected</c:if>>${item.name}</option>
                 </c:forEach>
             </select>
             <label>准考证号</label>

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

@@ -35,7 +35,7 @@
             <label>准考证号</label>
             <input type="text" name="examNumber" value="${query.examNumber}" maxlength="20" class="input-small"/>
 			<label>考生编号</label>
-            <input type="text" name="studentId" value="${query.studentId}" maxlength="20" class="input-small"/>
+            <input type="number" name="studentId" value="${query.studentId}" maxlength="10" class="input-small"/>
             &nbsp;
 			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
 		</div>