Selaa lähdekoodia

3.4.4 update-20250328,bug修改

xiaofei 2 kuukautta sitten
vanhempi
commit
cb237e6818

+ 3 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamCardMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.distributed.print.business.entity.ExamCard;
+import com.qmth.distributed.print.business.entity.ExamCardModelFour;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import org.apache.ibatis.annotations.Param;
 
@@ -26,4 +27,6 @@ public interface ExamCardMapper extends BaseMapper<ExamCard> {
     IPage<ExamCard> listPage(@Param("page") Page<ExamCard> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("cardType") String cardType, @Param("title") String title, @Param("createMethod") String createMethod, @Param("enable") Boolean enable, @Param("createStartTime") Long createStartTime, @Param("createEndTime") Long createEndTime, @Param("dpr") DataPermissionRule dpr);
 
     List<ExamCard> listCustomByExamStage(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("type") String type);
+
+    ExamCardModelFour getExamCardModelFourByExamIdAndCourseId(@Param("examId") Long examId, @Param("courseId") Long courseId);
 }

+ 1 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamCardServiceImpl.java

@@ -95,8 +95,6 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
     private BasicExamService basicExamService;
     @Resource
     private MarkPaperService markPaperService;
-    @Resource
-    ExamCardModelFourService examCardModelFourService;
 
     @Transactional
     @Override
@@ -519,7 +517,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
             if (ExamModelEnum.MODEL4.equals(basicExam.getExamModel())) {
                 MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
                 if (markPaper != null) {
-                    ExamCardModelFour examCardModelFour = examCardModelFourService.getByExamIdAndCourseId(examId, markPaper.getCourseId());
+                    ExamCardModelFour examCardModelFour = this.baseMapper.getExamCardModelFourByExamIdAndCourseId(examId, markPaper.getCourseId());
                     if (examCardModelFour != null) {
                         List<ConvertJpgStorage> convertJpgStorageList = JSONObject.parseArray(examCardModelFour.getJpgAttachment(), ConvertJpgStorage.class);
                         cardJpgResultList.addAll(convertJpgStorageList.stream().flatMap(e -> {

+ 4 - 0
distributed-print-business/src/main/resources/mapper/ExamCardMapper.xml

@@ -131,4 +131,8 @@
                             and FIND_IN_SET(a.id, REPLACE(REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),' "','"'),'"','')))
         order by a.create_time desc
     </select>
+    <select id="getExamCardModelFourByExamIdAndCourseId"
+            resultType="com.qmth.distributed.print.business.entity.ExamCardModelFour">
+        select * from exam_card_model_four where exam_id = #{examId} and course_id = #{courseId}
+    </select>
 </mapper>

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkSyncService.java

@@ -18,5 +18,5 @@ public interface MarkSyncService {
 
     void calcObjectiveScore(MarkPaper markPaper);
 
-    void deleteMarkTask(MarkQuestion markQuestion);
+    void deleteMarkedByQuestion(MarkQuestion markQuestion);
 }

+ 7 - 4
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java

@@ -87,6 +87,8 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
     @Resource
     private MarkService markService;
     @Resource
+    private MarkSyncService markSyncService;
+    @Resource
     private FileStoreUtil fileStoreUtil;
     @Resource
     private LockService lockService;
@@ -756,8 +758,9 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
         Double doubleRate = doubleMarkParam.getDoubleRate() != null ? doubleMarkParam.getDoubleRate() : 0;
 
         MarkQuestion markQuestion = this.getById(questionId);
+        Double oldDoubleRate = markQuestion.getDoubleRate() != null ? markQuestion.getDoubleRate() : 0;
         List<MarkTaskStatus> markTaskStatuses = Arrays.asList(MarkTaskStatus.MARKED, MarkTaskStatus.WAIT_ARBITRATE, MarkTaskStatus.PROBLEM, MarkTaskStatus.REJECTED, MarkTaskStatus.ARBITRATED);
-        if (markQuestion.getDoubleRate() == 100 && doubleRate == 0 && markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndStatusIn(examId, paperNumber, questionId, markTaskStatuses) > 0) {
+        if (oldDoubleRate > 0 && doubleRate == 0 && markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndStatusIn(examId, paperNumber, questionId, markTaskStatuses) > 0) {
             throw ExceptionResultEnum.ERROR.exception("该题已开始评卷,不允许双评改单评");
         }
 
@@ -768,15 +771,15 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                 .eq(MarkQuestion::getId, doubleMarkParam.getQuestionId());
         this.update(updateWrapper);
 
-        // 单、评切换、双评比例修改,删除任务
-        if (!markQuestion.getDoubleRate().equals(doubleRate)) {
+        // 单、评切换、双评比例修改,删除任务
+        if (!oldDoubleRate.equals(doubleRate)) {
             this.updateMarkedCount(questionId, 0);
             this.updateTaskCount(questionId, 0);
             if (lockService.trylock(LockType.QUESTION_UPDATE, questionId)) {
-                markSubjectiveScoreService.deleteByExamIdAndPaperNumberAndQuestionId(examId, paperNumber, markQuestion.getId());
                 MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
                 // 考生主观题重新统分
                 markService.checkStudentSubjectiveScore(examId, markPaper.getCoursePaperId());
+                markSyncService.deleteMarkedByQuestion(markQuestion);
             }
         }
 

+ 0 - 16
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java

@@ -1419,22 +1419,6 @@ public class MarkServiceImpl implements MarkService {
         for (MarkUserQuestion markUserQuestion : markUserQuestions) {
             releaseByMarkUserGroup(markUserQuestion);
         }
-
-        // 未分组的题目
-//        long unGroupQuestionCount = markQuestionService.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(
-//                markGroup.getExamId(), markGroup.getPaperNumber(), false);
-//        // 考生整体状态与总分更新
-//        long groupCount = markGroupService.countByExamIdAndPaperNumber(markGroup.getExamId(),
-//                markGroup.getPaperNumber());
-//        if (groupCount == 0 || unGroupQuestionCount > 0) {
-//            markStudentService.updateSubjectiveStatusAndScore(markGroup.getExamId(), markGroup.getPaperNumber(),
-//                    SubjectiveStatus.UNMARK, null, null);
-//        } else {
-//            List<Long> studentList = markStudentService.findIdByExamIdAndPaperNumber(markGroup.getExamId(), markGroup.getPaperNumber());
-//            for (Long studentId : studentList) {
-//                checkStudentSubjective(studentId, groupCount, unGroupQuestionCount);
-//            }
-//        }
     }
 
     @Override

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

@@ -81,7 +81,7 @@ public class MarkSyncServiceImpl implements MarkSyncService {
 
     @Async
     @Override
-    public void deleteMarkTask(MarkQuestion markQuestion) {
+    public void deleteMarkedByQuestion(MarkQuestion markQuestion) {
         if (markQuestion == null) {
             return;
         }

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

@@ -221,7 +221,7 @@ public class TaskServiceImpl implements TaskService {
     }
 
     private Double calcTotalScore(List<TaskQuestion> questionList) {
-        return questionList.stream().filter(m -> m.getMarkerScore() != null).mapToDouble(m -> m.getMarkerScore()).sum();
+        return questionList.stream().filter(m -> m.getMarkerScore() != null && MarkTaskStatus.MARKED.equals(m.getStatus())).mapToDouble(m -> m.getMarkerScore()).sum();
     }
 
     private List<MarkConfigItem> buildPic(List<MarkTask> markTaskList) {