Browse Source

线上bug同步修复

lideyin 5 years ago
parent
commit
7528c40541

+ 7 - 6
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/ExamAuditController.java

@@ -142,13 +142,14 @@ public class ExamAuditController extends ControllerSupport {
         }
         long examId = examIds.iterator().next();
 
-        //已经生成了评卷任务,不能重新审为不通过,但是可以审核为已通过
-        String markingTaskBuilded =
+        //原需求:已经生成了评卷任务,不能重新审为不通过,但是可以审核为已通过
+        //20191220,需求临时调整:已经生成了评卷任务,均不可重审
+        String markingTaskBuilt =
                 ExamCacheTransferHelper.getDefaultCachedExamProperty(examId, ExamProperties.MARKING_TASK_BUILDED.name()).getValue();
-        if (StringUtils.isNotBlank(markingTaskBuilded) && Constants.isTrue.equals(markingTaskBuilded)) {
-            if (!redoAuditInfo.getIsPass()) {
-                throw new StatusException("redoAudit-005", "该考试评卷任务已生成,不能重审为不通过");
-            }
+        if (StringUtils.isNotBlank(markingTaskBuilt) && Constants.isTrue.equals(markingTaskBuilt)) {
+//            if (!redoAuditInfo.getIsPass()) {
+            throw new StatusException("redoAudit-005", "该考试评卷任务已生成,不能重审为不通过");
+//            }
         }
         examAuditService.redoAudit(redoAuditInfo, user);
     }

+ 18 - 12
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordForMarkingServiceImpl.java

@@ -68,22 +68,29 @@ public class ExamRecordForMarkingServiceImpl implements ExamRecordForMarkingServ
         ExamType examType = ExamType.strToEnum(getExamResp.getExamBean().getExamType());
 
         List<ExamRecordForMarkingEntity> examRecordForMarkingList;
-        if (StringUtils.isEmpty(batchNum)){
+
+        GetExamPropertyReq getExamPropertyReq = new GetExamPropertyReq();
+        getExamPropertyReq.setExamId(examId);
+        getExamPropertyReq.setKey("MARKING_TYPE");
+        GetExamPropertyResp getExamPropertyResp = examCloudService.getExamProperty(getExamPropertyReq);
+
+        String markingType = getExamPropertyResp.getValue();
+        if (StringUtils.isEmpty(batchNum)) {
             examRecordForMarkingList =
                     examRecordForMarkingRepo.findByExamIdAndCourseIdAndExamStudentIds(examId, courseId, examStudentIds);
-        }else {
-            examRecordForMarkingList =
-                    examRecordForMarkingRepo.findByExamIdAndCourseIdAndExamStudentIdsAndBatchNum(examId, courseId, examStudentIds,batchNum);
+        } else {
+            if (markingType.equals(MarkingType.OBJECT_SCORE_MAX.name())
+                    || markingType.equals(MarkingType.LAST_SUBMIT.name())) {
+                examRecordForMarkingList =
+                        examRecordForMarkingRepo.findByExamIdAndCourseIdAndExamStudentIds(examId, courseId, examStudentIds);
+            } else {
+                examRecordForMarkingList =
+                        examRecordForMarkingRepo.findByExamIdAndCourseIdAndExamStudentIdsAndBatchNum(examId, courseId, examStudentIds, batchNum);
+            }
         }
         if (examType == ExamType.OFFLINE) {
             return examRecordForMarkingList;
         } else if (examType == ExamType.ONLINE) {
-            GetExamPropertyReq getExamPropertyReq = new GetExamPropertyReq();
-            getExamPropertyReq.setExamId(examId);
-            getExamPropertyReq.setKey("MARKING_TYPE");
-            GetExamPropertyResp getExamPropertyResp = examCloudService.getExamProperty(getExamPropertyReq);
-
-            String markingType = getExamPropertyResp.getValue();
             if (markingType.equals(MarkingType.ALL.name())) {
                 return examRecordForMarkingList;
             } else if (markingType.equals(MarkingType.OBJECT_SCORE_MAX.name())) {
@@ -153,8 +160,7 @@ public class ExamRecordForMarkingServiceImpl implements ExamRecordForMarkingServ
 
     /**
      * 客观分最高
-     *
-     * @param examRecordForMarkingList
+     * @param examRecordForMarkingAllList
      * @return
      */
     private List<ExamRecordForMarkingEntity> queryStudentPapersByObjectScoreMax(List<ExamRecordForMarkingEntity> examRecordForMarkingAllList) {