浏览代码

3.4.4 update-20250320,bug修改

xiaofei 3 月之前
父节点
当前提交
87b2e1661f

+ 2 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamCardModelFour.java

@@ -1,5 +1,6 @@
 package com.qmth.distributed.print.business.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@@ -51,6 +52,7 @@ public class ExamCardModelFour extends BaseEntity implements Serializable {
     private String content;
 
     @ApiModelProperty(value = "暂存内容(提交后置空)")
+    @TableField(value = "stage_content", updateStrategy = FieldStrategy.IGNORED)
     private String stageContent;
 
     @ApiModelProperty(value = "html格式内容")

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java

@@ -104,5 +104,5 @@ public interface ConditionMapper {
     List<String> listPaperNumberForExamDetail(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("courseId") Long courseId,
                                               @Param("dpr") DataPermissionRule dpr);
 
-    List<BasicCourse> listCourseForMarkPaper(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("dpr") DataPermissionRule dpr);
+    List<BasicCourse> listCourseForMarkPaper(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("dpr") DataPermissionRule dpr);
 }

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

@@ -158,7 +158,7 @@ public class ConditionServiceImpl implements ConditionService {
             return conditionMapper.listCourseForScanCount(examId, openCollegeId, dpr);
             //答题卡管理
         } else if ("1199".equals(privilegeIdString)) {
-            return conditionMapper.listCourseForMarkPaper(semesterId, examId, dpr);
+            return conditionMapper.listCourseForMarkPaper(schoolId, examId, dpr);
         } else {
             return conditionMapper.listCourse(semesterId, examId, enable, printPlanIds, dpr);
         }

+ 22 - 18
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamCardServiceImpl.java

@@ -304,7 +304,9 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
             // 上传题卡,状态为提交
             examCard.setStatus(CardCreateMethodEnum.UPLOAD.equals(params.getCreateMethod()) ? ExamCardStatusEnum.SUBMIT : params.getStatus());
             examCard.setRemark(params.getRemark());
-            examCard.setPageSize(CardCreateMethodEnum.UPLOAD.equals(params.getCreateMethod()) ? PageSizeEnum.A3.name() : params.getPageSize());
+            if (params.getPageSize() != null) {
+                examCard.setPageSize(CardCreateMethodEnum.UPLOAD.equals(params.getCreateMethod()) ? PageSizeEnum.A3.name() : params.getPageSize());
+            }
 
             // 方式为上传
 
@@ -326,26 +328,28 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
             else if (CardCreateMethodEnum.STANDARD.equals(params.getCreateMethod())
                     || CardCreateMethodEnum.FREE.equals(params.getCreateMethod())) {
                 try {
-                    // content文件
-                    String contentMd5 = DigestUtils.md5Hex(params.getContentFile().getBytes());
-                    if (!Objects.equals(contentMd5, params.getContentMd5())) {
-                        throw ExceptionResultEnum.MD5_EQUALS_FALSE.exception();
-                    }
-                    String content = SystemConstant.readContent(params.getContentFile().getInputStream());
-
-                    if (ExamCardStatusEnum.SUBMIT.equals(params.getStatus())) {
-                        examCard.setContent(content);
-                        examCard.setStageContent(null);
-
+                    if (params.getContentFile() != null) {
                         // content文件
-                        String htmlMd5 = DigestUtils.md5Hex(params.getHtmlContentFile().getBytes());
-                        if (!Objects.equals(htmlMd5, params.getHtmlContentMd5())) {
+                        String contentMd5 = DigestUtils.md5Hex(params.getContentFile().getBytes());
+                        if (!Objects.equals(contentMd5, params.getContentMd5())) {
                             throw ExceptionResultEnum.MD5_EQUALS_FALSE.exception();
                         }
-                        String htmlContent = SystemConstant.readContent(params.getHtmlContentFile().getInputStream());
-                        examCard.setHtmlContent(htmlContent);
-                    } else {
-                        examCard.setStageContent(content);
+                        String content = SystemConstant.readContent(params.getContentFile().getInputStream());
+
+                        if (ExamCardStatusEnum.SUBMIT.equals(params.getStatus())) {
+                            examCard.setContent(content);
+                            examCard.setStageContent(null);
+
+                            // content文件
+                            String htmlMd5 = DigestUtils.md5Hex(params.getHtmlContentFile().getBytes());
+                            if (!Objects.equals(htmlMd5, params.getHtmlContentMd5())) {
+                                throw ExceptionResultEnum.MD5_EQUALS_FALSE.exception();
+                            }
+                            String htmlContent = SystemConstant.readContent(params.getHtmlContentFile().getInputStream());
+                            examCard.setHtmlContent(htmlContent);
+                        } else {
+                            examCard.setStageContent(content);
+                        }
                     }
                 } catch (IOException e) {
                     throw ExceptionResultEnum.ERROR.exception("题卡内容文件解析失败");

+ 1 - 0
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -1190,6 +1190,7 @@
         from
             basic_course bc
         <where>
+            bc.school_id = #{schoolId}
             <if test="dpr != null">
                 <if test="dpr.requestUserId != null">
                     AND bc.create_id = #{dpr.requestUserId}

+ 4 - 0
distributed-print/pom.xml

@@ -44,6 +44,10 @@
             <groupId>com.qmth.teachcloud.data</groupId>
             <artifactId>teachcloud-data</artifactId>
         </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.qmth.boot</groupId>-->
+<!--            <artifactId>data-upgrade</artifactId>-->
+<!--        </dependency>-->
         <dependency>
             <groupId>com.qmth.teachcloud.common.api</groupId>
             <artifactId>teachcloud-common-api</artifactId>

+ 31 - 12
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/manage/MarkerInfoDto.java

@@ -5,6 +5,7 @@ import com.qmth.teachcloud.common.annotation.ExcelProperty;
 public class MarkerInfoDto {
 
     private Long examId;
+    private Long questionId;
 
     @ExcelProperty(name = "课程名称", width = 20, index = 1)
     private String courseCode;
@@ -15,25 +16,27 @@ public class MarkerInfoDto {
     @ExcelProperty(name = "试卷编号", width = 20, index = 3)
     private String paperNumber;
 
-    @ExcelProperty(name = "题目ID", width = 20, index = 4)
-    private Long questionId;
+    @ExcelProperty(name = "大题号", width = 20, index = 4)
+    private Integer mainNumber;
+    @ExcelProperty(name = "小题号", width = 20, index = 5)
+    private Integer subNumber;
 
-    @ExcelProperty(name = "大题名称", width = 20, index = 5)
+    @ExcelProperty(name = "大题名称", width = 20, index = 6)
     private String questionName;
 
-    @ExcelProperty(name = "分组总分", width = 20, index = 6)
+    @ExcelProperty(name = "分组总分", width = 20, index = 7)
     private Double totalScore;
 
-    @ExcelProperty(name = "登录名", width = 20, index = 7)
+    @ExcelProperty(name = "登录名", width = 20, index = 8)
     private String loginName;
 
-    @ExcelProperty(name = "工号", width = 20, index = 8)
+    @ExcelProperty(name = "工号", width = 20, index = 9)
     private String empno;
 
-    @ExcelProperty(name = "姓名", width = 20, index = 9)
+    @ExcelProperty(name = "姓名", width = 20, index = 10)
     private String realName;
 
-    @ExcelProperty(name = "评卷数量", width = 20, index = 10)
+    @ExcelProperty(name = "评卷数量", width = 20, index = 11)
     private long markedCount;
 
 
@@ -45,6 +48,14 @@ public class MarkerInfoDto {
         this.examId = examId;
     }
 
+    public Long getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(Long questionId) {
+        this.questionId = questionId;
+    }
+
     public String getCourseCode() {
         return courseCode;
     }
@@ -69,12 +80,20 @@ public class MarkerInfoDto {
         this.paperNumber = paperNumber;
     }
 
-    public Long getQuestionId() {
-        return questionId;
+    public Integer getMainNumber() {
+        return mainNumber;
     }
 
-    public void setQuestionId(Long questionId) {
-        this.questionId = questionId;
+    public void setMainNumber(Integer mainNumber) {
+        this.mainNumber = mainNumber;
+    }
+
+    public Integer getSubNumber() {
+        return subNumber;
+    }
+
+    public void setSubNumber(Integer subNumber) {
+        this.subNumber = subNumber;
     }
 
     public String getQuestionName() {

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

@@ -693,7 +693,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                 for (MarkUser markUser : markUserList) {
                     MarkUserQuestion markUserQuestion = markUserQuestionService.getByExamIdAndPaperNumberAndQuestionIdAndUserId(examId, paperNumber, questionId, markUser.getUserId());
                     if (markUserQuestion != null) {
-                        int markerCount = markService.applyCurrentCount(markQuestion, markUserQuestion.getId());
+                        int markerCount = markService.applyCurrentCount(markQuestion, markUserQuestion.getUserId());
                         count += markerCount;
                     }
                 }

+ 4 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java

@@ -152,11 +152,11 @@ public class MarkServiceImpl implements MarkService {
     }
 
     @Override
-    public int applyCurrentCount(MarkQuestion markQuestion, Long markUserGroupId) {
+    public int applyCurrentCount(MarkQuestion markQuestion, Long userId) {
         int count = 0;
         TaskLock taskLock = getTaskLock(markQuestion);
         if (taskLock != null) {
-            count = taskLock.count(markUserGroupId);
+            count = taskLock.count(markQuestion.getId(), userId);
         }
         return count;
     }
@@ -1226,7 +1226,8 @@ public class MarkServiceImpl implements MarkService {
         if (markTaskService.resetById(markTask.getId(), null, reason, userId, now, MarkTaskStatus.REJECTED)) {
             markUserQuestionService.updateRejectCountByExamIdAndPaperNumberAndQuestionIdAndUserId(markTask.getExamId(), markTask.getPaperNumber(), markTask.getQuestionId(), markTask.getUserId());
             markRejectHistoryService.save(history);
-            markSubjectiveScoreService.updateRejected(markTask.getStudentId(), markTask.getQuestionId(), true);
+//            markSubjectiveScoreService.updateRejected(markTask.getStudentId(), markTask.getQuestionId(), true);
+            markSubjectiveScoreService.deleteByStudentIdAndQuestionId(markTask.getStudentId(), markTask.getQuestionId());
             resetStudentStatus(markTask.getStudentId());
             updateMarkedCount(markTask.getExamId(), markTask.getPaperNumber(), markTask.getQuestionId());
             return true;

+ 7 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkTaskServiceImpl.java

@@ -90,9 +90,13 @@ public class MarkTaskServiceImpl extends ServiceImpl<MarkTaskMapper, MarkTask> i
     public void exportMarker(Long examId, Long courseId, String paperNumber, HttpServletResponse response) {
         List<MarkerInfoDto> markerInfoDtoList = this.baseMapper.listUserMarkedCount(examId, courseId, paperNumber);
         for (MarkerInfoDto markerInfoDto : markerInfoDtoList) {
-            MarkQuestion markQuestion = markQuestionService.getById(markerInfoDto.getQuestionId());
-            markerInfoDto.setQuestionName(markQuestion.getMainTitle());
-            markerInfoDto.setTotalScore(markQuestion.getTotalScore());
+            if (markerInfoDto.getQuestionId() != null) {
+                MarkQuestion markQuestion = markQuestionService.getById(markerInfoDto.getQuestionId());
+                markerInfoDto.setQuestionName(markQuestion.getMainTitle());
+                markerInfoDto.setMainNumber(markQuestion.getMainNumber());
+                markerInfoDto.setSubNumber(markQuestion.getSubNumber());
+                markerInfoDto.setTotalScore(markQuestion.getTotalScore());
+            }
         }
         try {
             ExcelUtil.excelExport("评卷员工作量", MarkerInfoDto.class, markerInfoDtoList, response);

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

@@ -136,7 +136,7 @@ public class MarkUserQuestionServiceImpl extends ServiceImpl<MarkUserQuestionMap
             List<MarkTask> markTaskList = markTaskService.listByExamIdAndPaperNumberAndQuestionIdAndUserIdAndClassName(examId, paperNumber, record.getQuestionId(), record.getUserId(), null);
             record.setResetting(lockService.isLocked(LockType.MARKER_RESET, record.getMarkUserQuestionId()));
             record.setMarkedCount(markTaskService.markedCount(markTaskList));
-            record.setCurrentCount(markService.applyCurrentCount(markQuestion, record.getMarkUserQuestionId()));
+            record.setCurrentCount(markService.applyCurrentCount(markQuestion, record.getUserId()));
         }
         return markUserGroupProgressDtoIPage;
     }

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

@@ -176,9 +176,14 @@ public class TaskServiceImpl implements TaskService {
         task.setObjectiveScore(markPaper.getShowObjectScore() ? student.getObjectiveScore() : null);
         // 题目数据
         task.setQuestionList(buildQuestionList(userId, markTaskList));
+        task.setMarkerScore(calcTotalScore(task.getQuestionList()));
         return task;
     }
 
+    private Double calcTotalScore(List<TaskQuestion> questionList) {
+        return questionList.stream().filter(m->m.getMarkerScore() != null).mapToDouble(m->m.getMarkerScore()).sum();
+    }
+
     private List<MarkConfigItem> buildPic(List<MarkTask> markTaskList) {
         List<MarkConfigItem> markConfigItems = new ArrayList<>();
         Integer mainNumber = null;

+ 12 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/utils/TaskLock.java

@@ -174,6 +174,18 @@ public class TaskLock {
         return count;
     }
 
+    public int count(Long questionId, Long userId) {
+        int count = 0;
+        LockNode node = head.next;
+        while (node != null) {
+            if (node.isOwner(userId) && node.containsQuestionId(questionId)) {
+                count++;
+            }
+            node = node.next;
+        }
+        return count;
+    }
+
     public List<Map<String, Object>> list() {
         List<Map<String, Object>> list = new LinkedList<>();
         LockNode node = head.next;

+ 2 - 2
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -1080,10 +1080,10 @@
 
     <select id="findNeedScoreCalculateStudent" resultType="com.qmth.teachcloud.mark.entity.MarkStudent">
         SELECT
-            ms.id, ms.exam_id, ms.paper_number, ms.version
+            ms.id, ms.exam_id, ms.paper_number, ms.version, ms.student_code
         FROM
             (SELECT
-                 id, exam_id, paper_number, version
+                 id, exam_id, paper_number, student_code, version
              FROM
                  mark_student
              WHERE