xiaofei vor 10 Monaten
Ursprung
Commit
552380c110

+ 2 - 3
distributed-print/install/mysql/upgrade/3.4.0.sql

@@ -372,17 +372,16 @@ UPDATE sys_privilege
 SET name='查看详情', url='View', `type`='LINK', parent_id=2002, `sequence`=1, property='AUTH', related='2026,2027,2028,2031', enable=1, default_auth=0, front_display=1
 WHERE id=2025;
 
+delete from sys_privilege where id = 2108;
 INSERT INTO sys_privilege
 (id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
 VALUES(2108, '重新计算', 'Calculate', 'LINK', 2002, 2, 'AUTH', '2109', 1, 0, 1);
 
+delete from sys_privilege where id = 2109;
 INSERT INTO sys_privilege
 (id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
 VALUES(2109, '重新计算接口', '/api/admin/course/degree/report/again/calculate', 'URL', 2108, 1, 'AUTH', NULL, 1, 1, 1);
 
-ALTER TABLE `scan_omr_task` ADD INDEX `index1` (`student_id` ASC);
-ALTER TABLE `scan_student_paper` ADD INDEX `index1` (`student_id` ASC);
-ALTER TABLE `scan_batch_paper` ADD INDEX `idx_student_id` (`student_id` ASC);
 
 -- 2024-07-18
 ALTER TABLE t_c_final_score DROP KEY t_c_final_score_unique;

+ 20 - 7
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkPaperServiceImpl.java

@@ -46,6 +46,7 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.Objects;
+import java.util.StringJoiner;
 import java.util.stream.Collectors;
 
 /**
@@ -191,6 +192,7 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
     @Override
     public Boolean finishPaper(BasicExam basicExam, List<String> paperNumbers, MarkPaperStatus status) {
         Long examId = basicExam.getId();
+        StringJoiner stringJoiner = new StringJoiner(";");
         for (String paperNumber : paperNumbers) {
             MarkPaper markPaper = this.getByExamIdAndPaperNumber(examId, paperNumber);
             if (MarkPaperStatus.FINISH.equals(status)) {
@@ -200,7 +202,8 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
                 List<MarkQuestion> markQuestionObjectiveList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, true);
                 if (CollectionUtils.isNotEmpty(markQuestionObjectiveList)) {
                     if (markQuestionObjectiveList.stream().filter(m -> StringUtils.isBlank(m.getAnswer())).count() > 0) {
-                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "客观题标答未设置,无法结束评卷");
+                        stringJoiner.add(courseInfo + "客观题标答未设置,无法结束评卷");
+                        continue;
                     }
                 }
 
@@ -209,27 +212,33 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
                 // 没有主观题,不校验考生评卷
                 if (CollectionUtils.isNotEmpty(markQuestionSubjectiveList)) {
                     if (markQuestionSubjectiveList.stream().filter(m -> m.getGroupNumber() == null).count() > 0) {
-                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "主观题未全部分组,无法结束评卷");
+                        stringJoiner.add(courseInfo + "主观题未全部分组,无法结束评卷");
+                        continue;
                     }
                     // 未缺考、未违纪且已上传图片的考生全部评完
                     if (markStudentService.countByExamIdAndPaperNumberAndMarkStatus(examId, paperNumber, SubjectiveStatus.UNMARK) > 0) {
-                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "考生未全部评完,无法结束评卷");
+                        stringJoiner.add(courseInfo + "考生未全部评完,无法结束评卷");
+                        continue;
                     }
                     // 未全部扫描,不能结束
                     if (markStudentService.countUnexistByExamIdAndPaperNumberAndPaperType(examId, paperNumber, markPaper.getPaperType()) > 0) {
-                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "有考生未扫描未核对,请在扫描客户端进行确认操作后再结束阅卷");
+                        stringJoiner.add(courseInfo + "有考生未扫描未核对,请在扫描客户端进行确认操作后再结束阅卷");
+                        continue;
                     }
                     // 识别缺考未确认完,不能结束
                     if (markStudentService.countOmrAbsentStudent(examId, paperNumber, markPaper.getPaperType(), false) > 0) {
-                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "识别缺考记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
+                        stringJoiner.add(courseInfo + "识别缺考记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
+                        continue;
                     }
                     // 人工绑定未做完,不能结束
                     if (markStudentService.getAssignedCount(examId, false, markPaper.getCourseId(), markPaper.getCoursePaperId(), MarkPaperStatus.FORMAL, null) > 0) {
-                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "人工绑定记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
+                        stringJoiner.add(courseInfo + "人工绑定记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
+                        continue;
                     }
                     // 客观题检查未做完,不能结束
                     if (scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, markPaper.getCourseId(), markPaper.getCoursePaperId(), OmrTaskStatus.WAITING.name(), null) > 0) {
-                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "客观题存在识别嫌疑需要人工确认,请在扫描客户端进行确认操作后再结束阅卷");
+                        stringJoiner.add(courseInfo + "客观题存在识别嫌疑需要人工确认,请在扫描客户端进行确认操作后再结束阅卷");
+                        continue;
                     }
                 }
 
@@ -250,6 +259,10 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
             this.update(updateWrapper);
         }
 
+        if(StringUtils.isNotBlank(stringJoiner.toString())){
+            throw ExceptionResultEnum.ERROR.exception(stringJoiner.toString());
+        }
+
         return true;
     }