Browse Source

3.4.4 update-20250305,联调bug修复1

xiaofei 3 months ago
parent
commit
e91c0ea11f

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkProblemController.java

@@ -46,13 +46,13 @@ public class MarkProblemController {
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     public Result list(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
     public Result list(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
                        @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
                        @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
-                       @ApiParam(value = "分组号") @RequestParam(required = false) Integer groupNumber,
+                       @ApiParam(value = "题目ID") @RequestParam(required = false) Long questionId,
                        @ApiParam(value = "问题类型") @RequestParam(required = false) String problemType,
                        @ApiParam(value = "问题类型") @RequestParam(required = false) String problemType,
                        @ApiParam(value = "状态") @RequestParam(required = false) String status,
                        @ApiParam(value = "状态") @RequestParam(required = false) String status,
                        @ApiParam(value = "密号") @RequestParam(required = false) String secretNumber,
                        @ApiParam(value = "密号") @RequestParam(required = false) String secretNumber,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
                        @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<MarkProblemDto> markProblemDtoIPage = markProblemHistoryService.pageProblem(examId, paperNumber, groupNumber, problemType, status, secretNumber, pageNumber, pageSize);
+        IPage<MarkProblemDto> markProblemDtoIPage = markProblemHistoryService.pageProblem(examId, paperNumber, questionId, problemType, status, secretNumber, pageNumber, pageSize);
         return ResultUtil.ok(markProblemDtoIPage);
         return ResultUtil.ok(markProblemDtoIPage);
     }
     }
 
 

+ 0 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/SpecialTagDTO.java

@@ -69,7 +69,6 @@ public class SpecialTagDTO implements Serializable {
         MarkHeaderTag markSpecialTag = new MarkHeaderTag();
         MarkHeaderTag markSpecialTag = new MarkHeaderTag();
         markSpecialTag.setId(SystemConstant.getDbUuid());
         markSpecialTag.setId(SystemConstant.getDbUuid());
         markSpecialTag.setStudentId(arbitrateHistory.getStudentId());
         markSpecialTag.setStudentId(arbitrateHistory.getStudentId());
-//        markSpecialTag.setGroupNumber(arbitrateHistory.getGroupNumber());
         markSpecialTag.setUserId(arbitrateHistory.getUpdateUserId());
         markSpecialTag.setUserId(arbitrateHistory.getUpdateUserId());
         markSpecialTag.setTagName(tagName);
         markSpecialTag.setTagName(tagName);
         markSpecialTag.setTagType(tagType);
         markSpecialTag.setTagType(tagType);
@@ -85,7 +84,6 @@ public class SpecialTagDTO implements Serializable {
         MarkHeaderTag markSpecialTag = new MarkHeaderTag();
         MarkHeaderTag markSpecialTag = new MarkHeaderTag();
         markSpecialTag.setId(SystemConstant.getDbUuid());
         markSpecialTag.setId(SystemConstant.getDbUuid());
         markSpecialTag.setStudentId(markResult.getStudentId());
         markSpecialTag.setStudentId(markResult.getStudentId());
-//        markSpecialTag.setGroupNumber(markResult.getGroupNumber());
         markSpecialTag.setUserId(userId);
         markSpecialTag.setUserId(userId);
         markSpecialTag.setTagName(tagName);
         markSpecialTag.setTagName(tagName);
         markSpecialTag.setTagType(tagType);
         markSpecialTag.setTagType(tagType);

+ 10 - 10
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/manage/MarkProblemDto.java

@@ -34,8 +34,8 @@ public class MarkProblemDto {
     private Long updateTime;
     private Long updateTime;
     private MarkProblemStatus status;
     private MarkProblemStatus status;
     private String statusName;
     private String statusName;
-    private Integer groupNumber;
-    private String groupQuestions;
+    private Long questionId;
+    private String questionNumber;
     private List<String> sheetUrls;
     private List<String> sheetUrls;
 
 
     public Long getId() {
     public Long getId() {
@@ -190,20 +190,20 @@ public class MarkProblemDto {
         this.statusName = statusName;
         this.statusName = statusName;
     }
     }
 
 
-    public Integer getGroupNumber() {
-        return groupNumber;
+    public Long getQuestionId() {
+        return questionId;
     }
     }
 
 
-    public void setGroupNumber(Integer groupNumber) {
-        this.groupNumber = groupNumber;
+    public void setQuestionId(Long questionId) {
+        this.questionId = questionId;
     }
     }
 
 
-    public String getGroupQuestions() {
-        return groupQuestions;
+    public String getQuestionNumber() {
+        return questionNumber;
     }
     }
 
 
-    public void setGroupQuestions(String groupQuestions) {
-        this.groupQuestions = groupQuestions;
+    public void setQuestionNumber(String questionNumber) {
+        this.questionNumber = questionNumber;
     }
     }
 
 
     public List<String> getSheetUrls() {
     public List<String> getSheetUrls() {

+ 1 - 5
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/manage/TaskQuestion.java

@@ -2,16 +2,12 @@ package com.qmth.teachcloud.mark.dto.mark.manage;
 
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.common.bean.marking.MarkConfigItem;
-import com.qmth.teachcloud.common.enums.mark.MarkProblemStatus;
 import com.qmth.teachcloud.common.enums.mark.MarkProblemType;
 import com.qmth.teachcloud.common.enums.mark.MarkProblemType;
 import com.qmth.teachcloud.mark.dto.mark.SpecialTagDTO;
 import com.qmth.teachcloud.mark.dto.mark.SpecialTagDTO;
-import com.qmth.teachcloud.mark.entity.MarkHeaderTrack;
 import com.qmth.teachcloud.mark.enums.MarkTaskStatus;
 import com.qmth.teachcloud.mark.enums.MarkTaskStatus;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
-import java.util.List;
 
 
 public class TaskQuestion implements Serializable {
 public class TaskQuestion implements Serializable {
 
 
@@ -350,7 +346,7 @@ public class TaskQuestion implements Serializable {
         isProblem = problem;
         isProblem = problem;
     }
     }
 
 
-    public MarkProblemType isProblemType() {
+    public MarkProblemType getProblemType() {
         return problemType;
         return problemType;
     }
     }
 
 

+ 0 - 50
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/mark/MarkGroupDto.java

@@ -1,50 +0,0 @@
-package com.qmth.teachcloud.mark.dto.mark.mark;
-
-public class MarkGroupDto {
-	private Integer groupNumber;
-	private String groupQuestions;
-	private String title;
-	private int markedCount;
-	private int totalCount;
-
-	public Integer getGroupNumber() {
-		return groupNumber;
-	}
-
-	public void setGroupNumber(Integer groupNumber) {
-		this.groupNumber = groupNumber;
-	}
-
-	public String getGroupQuestions() {
-		return groupQuestions;
-	}
-
-	public void setGroupQuestions(String groupQuestions) {
-		this.groupQuestions = groupQuestions;
-	}
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public int getMarkedCount() {
-		return markedCount;
-	}
-
-	public void setMarkedCount(int markedCount) {
-		this.markedCount = markedCount;
-	}
-
-	public int getTotalCount() {
-		return totalCount;
-	}
-
-	public void setTotalCount(int totalCount) {
-		this.totalCount = totalCount;
-	}
-
-}

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkProblemHistoryMapper.java

@@ -17,5 +17,5 @@ import org.apache.ibatis.annotations.Param;
  */
  */
 public interface MarkProblemHistoryMapper extends BaseMapper<MarkProblemHistory> {
 public interface MarkProblemHistoryMapper extends BaseMapper<MarkProblemHistory> {
 
 
-    IPage<MarkProblemDto> pageProblem(@Param("page") Page<MarkProblemDto> page, @Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("groupNumber") Integer groupNumber, @Param("problemType") String problemType, @Param("status") String status, @Param("secretNumber") String secretNumber);
+    IPage<MarkProblemDto> pageProblem(@Param("page") Page<MarkProblemDto> page, @Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("questionId") Long questionId, @Param("problemType") String problemType, @Param("status") String status, @Param("secretNumber") String secretNumber);
 }
 }

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

@@ -18,7 +18,7 @@ import java.util.List;
  */
  */
 public interface MarkProblemHistoryService extends IService<MarkProblemHistory> {
 public interface MarkProblemHistoryService extends IService<MarkProblemHistory> {
 
 
-    IPage<MarkProblemDto> pageProblem(Long examId, String paperNumber, Integer groupNumber, String problemType, String status, String secretNumber, Integer pageNumber, Integer pageSize);
+    IPage<MarkProblemDto> pageProblem(Long examId, String paperNumber, Long questionId, String problemType, String status, String secretNumber, Integer pageNumber, Integer pageSize);
 
 
     void resetProblem(List<Long> ids);
     void resetProblem(List<Long> ids);
 
 

+ 5 - 4
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkProblemHistoryServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.mark.MarkProblemStatus;
 import com.qmth.teachcloud.common.enums.mark.MarkProblemStatus;
 import com.qmth.teachcloud.common.service.SysUserService;
 import com.qmth.teachcloud.common.service.SysUserService;
@@ -53,10 +54,10 @@ public class MarkProblemHistoryServiceImpl extends ServiceImpl<MarkProblemHistor
     private LockService lockService;
     private LockService lockService;
 
 
     @Override
     @Override
-    public IPage<MarkProblemDto> pageProblem(Long examId, String paperNumber, Integer groupNumber, String problemType,
+    public IPage<MarkProblemDto> pageProblem(Long examId, String paperNumber, Long questionId, String problemType,
                                              String status, String secretNumber, Integer pageNumber, Integer pageSize) {
                                              String status, String secretNumber, Integer pageNumber, Integer pageSize) {
         Page<MarkProblemDto> page = new Page<>(pageNumber, pageSize);
         Page<MarkProblemDto> page = new Page<>(pageNumber, pageSize);
-        IPage<MarkProblemDto> markProblemDtoIPage = this.baseMapper.pageProblem(page, examId, paperNumber, groupNumber,
+        IPage<MarkProblemDto> markProblemDtoIPage = this.baseMapper.pageProblem(page, examId, paperNumber, questionId,
                 problemType, status, secretNumber);
                 problemType, status, secretNumber);
         for (MarkProblemDto problemDto : markProblemDtoIPage.getRecords()) {
         for (MarkProblemDto problemDto : markProblemDtoIPage.getRecords()) {
             MarkStudentVo markStudent = markStudentService.getMarkStudentVoByStudentId(problemDto.getStudentId());
             MarkStudentVo markStudent = markStudentService.getMarkStudentVoByStudentId(problemDto.getStudentId());
@@ -65,8 +66,8 @@ public class MarkProblemHistoryServiceImpl extends ServiceImpl<MarkProblemHistor
             problemDto.setSheetUrls(teachcloudCommonService.filePreview(markStudent.getSheetPathList(), SystemConstant.MARK_JPG_EXPIRE_MINUTE));
             problemDto.setSheetUrls(teachcloudCommonService.filePreview(markStudent.getSheetPathList(), SystemConstant.MARK_JPG_EXPIRE_MINUTE));
             problemDto.setProblemTypeName(problemDto.getType().getDesc());
             problemDto.setProblemTypeName(problemDto.getType().getDesc());
             problemDto.setStatusName(problemDto.getStatus().getName());
             problemDto.setStatusName(problemDto.getStatus().getName());
-            problemDto.setGroupQuestions(markQuestionService
-                    .assembleGroupQuestionsByExamIdAndPaperNumberAndNumber(examId, paperNumber, problemDto.getGroupNumber()));
+            MarkQuestion markQuestion = markQuestionService.getById(problemDto.getQuestionId());
+            problemDto.setQuestionNumber(markQuestion.getQuestionNumber());
             if (problemDto.getUserId() != null) {
             if (problemDto.getUserId() != null) {
                 SysUser sysUser = sysUserService.getById(problemDto.getUserId());
                 SysUser sysUser = sysUserService.getById(problemDto.getUserId());
                 if (sysUser != null) {
                 if (sysUser != null) {

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

@@ -196,7 +196,7 @@ public class MarkServiceImpl implements MarkService {
         //查询已评和已仲裁的任务数
         //查询已评和已仲裁的任务数
         int count = markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndStatusIn(examId, paperNumber,
         int count = markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndStatusIn(examId, paperNumber,
                 questionId, markTaskStatuses);
                 questionId, markTaskStatuses);
-        //更新当前的已评数量
+        //更新当前小题的已评数量
         markQuestionService.updateMarkedCount(questionId, count);
         markQuestionService.updateMarkedCount(questionId, count);
     }
     }
 
 
@@ -359,9 +359,9 @@ public class MarkServiceImpl implements MarkService {
      * @param result
      * @param result
      */
      */
     private void checkStudentGroup(Long studentId, MarkQuestion markQuestion, MarkResultQuestion result) {
     private void checkStudentGroup(Long studentId, MarkQuestion markQuestion, MarkResultQuestion result) {
-        if (calculateGroup(markQuestion, studentId)) {
+        if (calculateQuestionId(markQuestion, studentId)) {
             //更新考生分组分数
             //更新考生分组分数
-            updateStudentGroupScore(studentId, markQuestion, result);
+            updateStudentQuestionScore(studentId, markQuestion, result);
             //未分组的题目
             //未分组的题目
             long unGroupQuestionCount = markQuestionService.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(
             long unGroupQuestionCount = markQuestionService.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(
                     markQuestion.getExamId(), markQuestion.getPaperNumber(), false);
                     markQuestion.getExamId(), markQuestion.getPaperNumber(), false);
@@ -546,7 +546,7 @@ public class MarkServiceImpl implements MarkService {
         markQuestionService.updateTaskCount(questionId, count);
         markQuestionService.updateTaskCount(questionId, count);
     }
     }
 
 
-    private boolean calculateGroup(MarkQuestion markQuestion, Long studentId) {
+    private boolean calculateQuestionId(MarkQuestion markQuestion, Long studentId) {
         // 未设置算分策略的情况下,默认取平均分
         // 未设置算分策略的情况下,默认取平均分
         List<MarkTask> list = markTaskService.listByExamIdAndPaperNumberAndQuestionIdAndStudentId(markQuestion.getExamId(),
         List<MarkTask> list = markTaskService.listByExamIdAndPaperNumberAndQuestionIdAndStudentId(markQuestion.getExamId(),
                 markQuestion.getPaperNumber(), markQuestion.getId(), studentId);
                 markQuestion.getPaperNumber(), markQuestion.getId(), studentId);
@@ -562,7 +562,7 @@ public class MarkServiceImpl implements MarkService {
         return true;
         return true;
     }
     }
 
 
-    private void updateStudentGroupScore(Long studentId, MarkQuestion markQuestion, MarkResultQuestion result) {
+    private void updateStudentQuestionScore(Long studentId, MarkQuestion markQuestion, MarkResultQuestion result) {
         MarkSubjectiveScore ss = markSubjectiveScoreService.getByStudentIdAndQuestionId(studentId, markQuestion.getId());
         MarkSubjectiveScore ss = markSubjectiveScoreService.getByStudentIdAndQuestionId(studentId, markQuestion.getId());
         if (ss == null) {
         if (ss == null) {
             ss = new MarkSubjectiveScore();
             ss = new MarkSubjectiveScore();

+ 3 - 3
teachcloud-mark/src/main/resources/mapper/MarkProblemHistoryMapper.xml

@@ -26,7 +26,7 @@
             id,
             id,
             task_id taskId,
             task_id taskId,
             student_id studentId,
             student_id studentId,
-            group_number groupNumber,
+            question_id questionId,
             secret_number secretNumber,
             secret_number secretNumber,
             type,
             type,
             status,
             status,
@@ -40,8 +40,8 @@
         where
         where
             exam_id = #{examId}
             exam_id = #{examId}
             AND paper_number = #{paperNumber}
             AND paper_number = #{paperNumber}
-            <if test="groupNumber != null">
-                AND group_number = #{groupNumber}
+            <if test="questionId != null">
+                AND question_id = #{questionId}
             </if>
             </if>
             <if test="problemType != null and problemType != ''">
             <if test="problemType != null and problemType != ''">
                 AND type = #{problemType}
                 AND type = #{problemType}

+ 18 - 5
teachcloud-mark/src/main/resources/mapper/MarkTaskMapper.xml

@@ -389,10 +389,7 @@
             mark_task mt
             mark_task mt
         <where>
         <where>
             mt.student_id = #{studentId}
             mt.student_id = #{studentId}
-            <if test="questionId != null">
-                and mt.question_id = #{questionId}
-            </if>
-          AND EXISTS( SELECT
+            AND EXISTS( SELECT
                           1
                           1
                       FROM
                       FROM
                           mark_user_question muq
                           mark_user_question muq
@@ -400,7 +397,23 @@
                           mt.exam_id = muq.exam_id
                           mt.exam_id = muq.exam_id
                         AND mt.paper_Number = muq.paper_number
                         AND mt.paper_Number = muq.paper_number
                         AND mt.question_id = muq.question_id
                         AND mt.question_id = muq.question_id
-                        AND muq.user_id = #{userId})
+                        AND muq.user_id = #{userId}
+                        <if test="questionId != null">
+                            and muq.question_id = #{questionId}
+                        </if>
+                        )
+            AND NOT EXISTS (
+                SELECT 1 FROM
+                    mark_task t
+                WHERE
+                t.student_id = mt.student_id
+                AND t.exam_id = mt.exam_id
+                AND t.paper_number = mt.paper_number
+                AND t.question_id = mt.question_id
+                AND t.user_id = #{userId}
+                AND t.marker_score IS NOT NULL
+            )
+            order by mt.main_number, mt.sub_number
         </where>
         </where>
     </select>
     </select>
 </mapper>
 </mapper>