Forráskód Böngészése

3.4.1 成绩检查-主观题复核确认

xiaofei 10 hónapja
szülő
commit
b0276322b5

+ 4 - 0
distributed-print-business/src/main/resources/db/log/xf.sql

@@ -11,3 +11,7 @@ update basic_print_config set output_file_type = '["PAPER","ALL_CARD","PACKAGE",
 
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('1151', '导入数据包', 'CardJsonImport', 'BUTTON', '897', '9', 'AUTH', '1152', '1', '0', '1');
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1152', '导入数据包', '/api/admin/mark/setting/card_json/import', 'URL', '897', '20', 'AUTH', '1', '1', '1');
+
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1011', '主观题检查-确认任务', '/api/admin/mark/inspected/subjective/confirmTask', 'URL', '946', '14', 'AUTH', '1', '1', '1');
+UPDATE `sys_privilege` SET `related` = '956,957,958,1011' WHERE (`id` = '1176');
+UPDATE `sys_privilege` SET `related` = '888,894,956,957,958,1011' WHERE (`id` = '1179');

+ 11 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkInspectedController.java

@@ -94,4 +94,15 @@ public class MarkInspectedController extends BaseController{
         markStudentService.saveSubjectiveInspectedTask(markResult);
         return ResultUtil.ok(true);
     }
+
+    /**
+     * 主观题检查任务确认
+     */
+    @ApiOperation(value = "主观题检查任务保存")
+    @RequestMapping(value = "/subjective/confirmTask", method = RequestMethod.POST)
+    @OperationLogDetail(operationType = OperationTypeEnum.UPDATE, detail = "确认主观题检查任务操作,考生ID:{{markResult.studentId}}")
+    public Result confirmSubjectiveInspectedTask(@RequestBody MarkHeaderResult markResult) {
+        markStudentService.confirmSubjectiveInspectedTask(markResult);
+        return ResultUtil.ok(true);
+    }
 }

+ 2 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java

@@ -232,4 +232,6 @@ public interface MarkStudentService extends IService<MarkStudent> {
     boolean calcBatchObjectiveScore(List<Long> ids);
 
     List<MarkStudent> listByBasicStudentIds(List<Long> basicExamStudentIds);
+
+    void confirmSubjectiveInspectedTask(MarkHeaderResult markResult);
 }

+ 27 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -259,7 +259,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         IPage<StudentScoreDetailDto> studentScoreDetailDtoIPage = this.baseMapper.pageStudentScore(page, examId,
                 paperNumber, college, majorName, teachClassName, className, teacher, filter, status, breach, startScore, endScore,
                 subjectiveStartScore, subjectiveEndScore, objectiveStartScore, objectiveEndScore, subScore,
-                objectiveScoreLt, studentName, studentCode,secretNumber, orderType, orderField, dpr);
+                objectiveScoreLt, studentName, studentCode, secretNumber, orderType, orderField, dpr);
         for (StudentScoreDetailDto scoreDetailDto : studentScoreDetailDtoIPage.getRecords()) {
             // 原图
             scoreDetailDto.setSheetUrls(buildSheetUrls(scoreDetailDto.getStudentId()));
@@ -1959,4 +1959,30 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         queryWrapper.lambda().in(MarkStudent::getBasicStudentId, basicExamStudentIds);
         return this.list(queryWrapper);
     }
+
+    @Override
+    public void confirmSubjectiveInspectedTask(MarkHeaderResult markResult) {
+        Long userId = ServletUtil.getRequestUserId();
+        MarkStudent markStudent = this.getById(markResult.getStudentId());
+        if (markStudent == null) {
+            throw ExceptionResultEnum.ERROR.exception("考生不存在");
+        }
+        MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(markStudent.getExamId(),
+                markStudent.getPaperNumber());
+        // 评卷是否结束
+        if (markPaper == null || MarkPaperStatus.FINISH.equals(markPaper.getStatus())) {
+            throw ExceptionResultEnum.ERROR.exception("科目已结束评卷,无法执行此操作");
+        }
+        try {
+            lockService.watch(LockType.EXAM_SUBJECT, markStudent.getExamId(), markStudent.getPaperNumber());
+            lockService.waitlock(LockType.STUDENT, markResult.getStudentId());
+            this.updateCheckInfo(markStudent.getId(), userId);
+        } catch (Exception e) {
+            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
+        } finally {
+            lockService.unlock(LockType.STUDENT, markResult.getStudentId());
+            lockService.unwatch(LockType.EXAM_SUBJECT, markStudent.getExamId(), markStudent.getPaperNumber());
+            markService.releaseByStudent(markStudent);
+        }
+    }
 }