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

Merge remote-tracking branch 'origin/dev_v3.3.0' into dev_v3.3.0

xiaofei 1 éve
szülő
commit
c1297fd9ea

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

@@ -2,6 +2,7 @@ package com.qmth.teachcloud.mark.dto.mark;
 
 import java.io.Serializable;
 
+import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.mark.entity.MarkArbitrateHistory;
 import com.qmth.teachcloud.mark.entity.MarkHeaderTag;
 import com.qmth.teachcloud.mark.entity.MarkSpecialTag;
@@ -12,6 +13,8 @@ public class SpecialTagDTO implements Serializable {
     private static final long serialVersionUID = -5424015292124065736L;
 
     private String tagName;
+    
+    private String tagType;
 
     private Double positionX;
 
@@ -28,6 +31,7 @@ public class SpecialTagDTO implements Serializable {
     }
 
     public SpecialTagDTO(MarkSpecialTag markSpecialTag) {
+    	this.tagType = markSpecialTag.getTagType();
         this.tagName = markSpecialTag.getTagName();
         this.positionX = markSpecialTag.getPositionX();
         this.positionY = markSpecialTag.getPositionY();
@@ -37,6 +41,7 @@ public class SpecialTagDTO implements Serializable {
     }
 
     public SpecialTagDTO(MarkHeaderTag tag) {
+    	this.tagType = tag.getTagType();
         this.tagName = tag.getTagName();
         this.positionX = tag.getPositionX();
         this.positionY = tag.getPositionY();
@@ -47,6 +52,7 @@ public class SpecialTagDTO implements Serializable {
 
     public MarkSpecialTag transform(MarkTask markTask) {
         MarkSpecialTag markSpecialTag = new MarkSpecialTag();
+        markSpecialTag.setId(SystemConstant.getDbUuid());
         markSpecialTag.setTaskId(markTask.getId());
         markSpecialTag.setTagName(tagName);
         markSpecialTag.setPositionX(positionX);
@@ -54,15 +60,18 @@ public class SpecialTagDTO implements Serializable {
         markSpecialTag.setOffsetIndex(offsetIndex);
         markSpecialTag.setOffsetX(offsetX);
         markSpecialTag.setOffsetY(offsetY);
+        markSpecialTag.setTagType(tagType);
         return markSpecialTag;
     }
 
     public MarkHeaderTag transform(MarkArbitrateHistory arbitrateHistory) {
         MarkHeaderTag markSpecialTag = new MarkHeaderTag();
+        markSpecialTag.setId(SystemConstant.getDbUuid());
         markSpecialTag.setStudentId(arbitrateHistory.getStudentId());
         markSpecialTag.setGroupNumber(arbitrateHistory.getGroupNumber());
         markSpecialTag.setUserId(arbitrateHistory.getUpdateUserId());
         markSpecialTag.setTagName(tagName);
+        markSpecialTag.setTagType(tagType);
         markSpecialTag.setPositionX(positionX);
         markSpecialTag.setPositionY(positionY);
         markSpecialTag.setOffsetIndex(offsetIndex);
@@ -118,4 +127,13 @@ public class SpecialTagDTO implements Serializable {
     public void setOffsetY(Integer offsetY) {
         this.offsetY = offsetY;
     }
+
+	public String getTagType() {
+		return tagType;
+	}
+
+	public void setTagType(String tagType) {
+		this.tagType = tagType;
+	}
+    
 }

+ 5 - 16
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkGroupStudent.java

@@ -1,13 +1,13 @@
 package com.qmth.teachcloud.mark.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableId;
 import java.io.Serializable;
 
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -26,14 +26,11 @@ public class MarkGroupStudent implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @JsonSerialize(using = ToStringSerializer.class)
-    @ApiModelProperty(value = "ID")
-    @TableId(value = "id", type = IdType.INPUT)
-    private Long id;
-
-    @JsonSerialize(using = ToStringSerializer.class)
+    @MppMultiId(value = "student_id")
     @ApiModelProperty(value = "考生ID")
     private Long studentId;
 
+    @MppMultiId(value = "student_id")
     @ApiModelProperty(value = "分组ID")
     private Integer groupNumber;
 
@@ -47,14 +44,6 @@ public class MarkGroupStudent implements Serializable {
     @ApiModelProperty(value = "状态")
     private SubjectiveStatus status;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
     public Long getStudentId() {
         return studentId;
     }

+ 13 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkHeaderTag.java

@@ -22,7 +22,7 @@ public class MarkHeaderTag implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @ApiModelProperty(value = "主键")
-    @TableId(value = "id", type = IdType.AUTO)
+    @TableId(value = "id", type = IdType.INPUT)
     private Long id;
 
     @ApiModelProperty(value = "考试ID")
@@ -42,6 +42,9 @@ public class MarkHeaderTag implements Serializable {
 
     @ApiModelProperty(value = "标记内容")
     private String tagName;
+    
+    @ApiModelProperty(value = "标记类型")
+    private String tagType;
 
     @ApiModelProperty(value = "X轴位置")
     private Double positionX;
@@ -146,7 +149,15 @@ public class MarkHeaderTag implements Serializable {
         this.offsetY = offsetY;
     }
 
-    @Override
+    public String getTagType() {
+		return tagType;
+	}
+
+	public void setTagType(String tagType) {
+		this.tagType = tagType;
+	}
+
+	@Override
     public String toString() {
         return "MarkHeaderTag{" +
             "id=" + id +

+ 13 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkSpecialTag.java

@@ -22,7 +22,7 @@ public class MarkSpecialTag implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @ApiModelProperty(value = "主键")
-    @TableId(value = "id", type = IdType.AUTO)
+    @TableId(value = "id", type = IdType.INPUT)
     private Long id;
 
     @ApiModelProperty(value = "评卷任务ID")
@@ -30,6 +30,9 @@ public class MarkSpecialTag implements Serializable {
 
     @ApiModelProperty(value = "标记内容")
     private String tagName;
+    
+    @ApiModelProperty(value = "标记类型")
+    private String tagType;
 
     @ApiModelProperty(value = "X轴位置")
     private Double positionX;
@@ -103,7 +106,15 @@ public class MarkSpecialTag implements Serializable {
         this.offsetY = offsetY;
     }
 
-    @Override
+    public String getTagType() {
+		return tagType;
+	}
+
+	public void setTagType(String tagType) {
+		this.tagType = tagType;
+	}
+
+	@Override
     public String toString() {
         return "MarkSpecialTag{" +
             "id=" + id +

+ 2 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkSubjectiveScore.java

@@ -1,12 +1,12 @@
 package com.qmth.teachcloud.mark.entity;
 
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableId;
 import java.io.Serializable;
 
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 

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

@@ -2,7 +2,6 @@ package com.qmth.teachcloud.mark.mapper;
 
 import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
 import com.qmth.teachcloud.mark.entity.MarkGroup;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * <p>

+ 2 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkGroupStudentMapper.java

@@ -1,7 +1,7 @@
 package com.qmth.teachcloud.mark.mapper;
 
+import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
 import com.qmth.teachcloud.mark.entity.MarkGroupStudent;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * <p>
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @author xf
  * @since 2023-09-22
  */
-public interface MarkGroupStudentMapper extends BaseMapper<MarkGroupStudent> {
+public interface MarkGroupStudentMapper extends MppBaseMapper<MarkGroupStudent> {
 
 }

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

@@ -1,8 +1,8 @@
 package com.qmth.teachcloud.mark.service;
 
+import com.github.jeffreyning.mybatisplus.service.IMppService;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
 import com.qmth.teachcloud.mark.entity.MarkGroupStudent;
-import com.baomidou.mybatisplus.extension.service.IService;
 
 /**
  * <p>
@@ -12,7 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @author xf
  * @since 2023-09-22
  */
-public interface MarkGroupStudentService extends IService<MarkGroupStudent> {
+public interface MarkGroupStudentService extends IMppService<MarkGroupStudent> {
 
     long countByStudentIdAndStatus(Long studentId, SubjectiveStatus marked);
 

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

@@ -1,12 +1,12 @@
 package com.qmth.teachcloud.mark.service;
 
-import com.qmth.teachcloud.mark.bean.archivescore.QuestionVo;
-import com.qmth.teachcloud.mark.entity.MarkSubjectiveScore;
-import com.baomidou.mybatisplus.extension.service.IService;
-
 import java.util.List;
 import java.util.Set;
 
+import com.github.jeffreyning.mybatisplus.service.IMppService;
+import com.qmth.teachcloud.mark.bean.archivescore.QuestionVo;
+import com.qmth.teachcloud.mark.entity.MarkSubjectiveScore;
+
 /**
  * <p>
  * 主观题得分明细表 服务类
@@ -15,7 +15,7 @@ import java.util.Set;
  * @author xf
  * @since 2023-09-22
  */
-public interface MarkSubjectiveScoreService extends IService<MarkSubjectiveScore> {
+public interface MarkSubjectiveScoreService extends IMppService<MarkSubjectiveScore> {
 
     List<MarkSubjectiveScore> listByStudentIdAndGroupNumber(Long studentId, Integer groupNumber);
 

+ 30 - 15
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkGroupServiceImpl.java

@@ -1,38 +1,53 @@
 package com.qmth.teachcloud.mark.service.impl;
 
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
 import com.qmth.teachcloud.common.bean.dto.mark.MarkUser;
 import com.qmth.teachcloud.common.bean.dto.mark.PictureConfig;
 import com.qmth.teachcloud.common.bean.params.mark.setting.GroupPictureConfigParams;
 import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.mark.dto.mark.manage.*;
+import com.qmth.teachcloud.mark.dto.mark.manage.MarkGroupClassProgressDto;
+import com.qmth.teachcloud.mark.dto.mark.manage.MarkGroupProgressDto;
+import com.qmth.teachcloud.mark.dto.mark.manage.MarkGroupQuestionsDto;
+import com.qmth.teachcloud.mark.dto.mark.manage.MarkGroupSummaryProgressDto;
+import com.qmth.teachcloud.mark.dto.mark.manage.MarkGroupTotalProgressDto;
 import com.qmth.teachcloud.mark.dto.mark.setting.MarkGroupDto;
 import com.qmth.teachcloud.mark.dto.mark.setting.MarkGroupSingleDto;
 import com.qmth.teachcloud.mark.dto.mark.setting.MarkGroupTaskDto;
-import com.qmth.teachcloud.mark.entity.*;
+import com.qmth.teachcloud.mark.entity.MarkGroup;
+import com.qmth.teachcloud.mark.entity.MarkPaper;
+import com.qmth.teachcloud.mark.entity.MarkTask;
+import com.qmth.teachcloud.mark.entity.MarkUserGroup;
 import com.qmth.teachcloud.mark.enums.LockType;
 import com.qmth.teachcloud.mark.enums.ScorePolicy;
 import com.qmth.teachcloud.mark.lock.LockService;
 import com.qmth.teachcloud.mark.mapper.MarkGroupMapper;
-import com.qmth.teachcloud.mark.service.*;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.stream.Collectors;
+import com.qmth.teachcloud.mark.service.MarkGroupService;
+import com.qmth.teachcloud.mark.service.MarkPaperService;
+import com.qmth.teachcloud.mark.service.MarkQuestionService;
+import com.qmth.teachcloud.mark.service.MarkService;
+import com.qmth.teachcloud.mark.service.MarkSyncService;
+import com.qmth.teachcloud.mark.service.MarkTaskService;
+import com.qmth.teachcloud.mark.service.MarkUserClassService;
+import com.qmth.teachcloud.mark.service.MarkUserGroupService;
 
 /**
  * <p>

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

@@ -1,13 +1,14 @@
 package com.qmth.teachcloud.mark.service.impl;
 
+import org.springframework.stereotype.Service;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
 import com.qmth.teachcloud.mark.entity.MarkGroupStudent;
 import com.qmth.teachcloud.mark.mapper.MarkGroupStudentMapper;
 import com.qmth.teachcloud.mark.service.MarkGroupStudentService;
-import org.springframework.stereotype.Service;
 
 /**
  * <p>
@@ -18,7 +19,7 @@ import org.springframework.stereotype.Service;
  * @since 2023-09-22
  */
 @Service
-public class MarkGroupStudentServiceImpl extends ServiceImpl<MarkGroupStudentMapper, MarkGroupStudent> implements MarkGroupStudentService {
+public class MarkGroupStudentServiceImpl extends MppServiceImpl<MarkGroupStudentMapper, MarkGroupStudent> implements MarkGroupStudentService {
 
     @Override
     public long countByStudentIdAndStatus(Long studentId, SubjectiveStatus marked) {

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

@@ -234,17 +234,13 @@ public class MarkServiceImpl implements MarkService {
 
 	private void updateStudentGroupStatus(Long studentId, Long examId, String paperNumber, Integer groupNumber,
 			SubjectiveStatus status) {
-		MarkGroupStudent gs = markGroupStudentService.getByStudentIdAndGroupNumber(studentId, groupNumber);
-		if(gs ==null) {
-			gs = new MarkGroupStudent();
-			gs.setId(SystemConstant.getDbUuid());
-			gs.setStudentId(studentId);
-			gs.setExamId(examId);
-			gs.setPaperNumber(paperNumber);
-			gs.setGroupNumber(groupNumber);
-		}
+		MarkGroupStudent gs = new MarkGroupStudent();
+		gs.setStudentId(studentId);
+		gs.setExamId(examId);
+		gs.setPaperNumber(paperNumber);
+		gs.setGroupNumber(groupNumber);
 		gs.setStatus(status);
-		markGroupStudentService.saveOrUpdate(gs);
+		markGroupStudentService.saveOrUpdateByMultiId(gs);
 	}
 
 	@Override
@@ -681,7 +677,7 @@ public class MarkServiceImpl implements MarkService {
 //            } else {
 //                ss.setUnansweredCount(markTaskService.countByStudentIdAndQuestionNumberAndUnanswered(studentId, question.getQuestionNumber(), true));
 //            }
-			markSubjectiveScoreService.saveOrUpdate(ss);
+			markSubjectiveScoreService.saveOrUpdateByMultiId(ss);
 		}
 	}
 
@@ -1069,8 +1065,10 @@ public class MarkServiceImpl implements MarkService {
 		if (history == null) {
 			history = new MarkProblemHistory();
 		}
+		history.setId(SystemConstant.getDbUuid());
 		history.setExamId(task.getExamId());
 		history.setSecretNumber(task.getSecretNumber());
+		history.setStudentCode(task.getStudentCode());
 		history.setStudentId(task.getStudentId());
 		history.setTaskId(task.getId());
 		history.setPaperNumber(task.getPaperNumber());
@@ -1079,6 +1077,7 @@ public class MarkServiceImpl implements MarkService {
 		if (MarkProblemType.OTHER.equals(result.getProblemType())) {
 			history.setRemark(result.getProblemRemark());
 		}
+		history.setCreateTime(System.currentTimeMillis());
 		history.setStatus(MarkProblemStatus.WAITING);
 		history.setUserId(userId);
 		markProblemHistoryService.save(history);

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

@@ -216,6 +216,7 @@ public class TaskServiceImpl implements TaskService {
 		task.setStudentId(t.getStudentId());
 		task.setStudentCode(t.getStudentCode());
 		task.setQuestionList(buildMarkStep(t));
+		task.setSpecialTagList(getMarkSpecialTagList(t));
 		MarkStudent student = markStudentService.getById(t.getStudentId());
 		task.setSheetUrls(teachcloudCommonService.filePreview(student.getSheetPathList()));
 		MarkGroup group = markGroupService.getByExamIdAndPaperNumberAndGroupNumber(t.getExamId(), t.getPaperNumber(),
@@ -277,6 +278,19 @@ public class TaskServiceImpl implements TaskService {
 		}
 		return specialTags;
 	}
+	
+    public SpecialTagDTO[] getMarkSpecialTagList(MarkTask library) {
+        SpecialTagDTO[] specialTags = null;
+        List<MarkSpecialTag> list = markSpecialTagService.findByTaskId(library.getId());
+        if (!list.isEmpty()) {
+            specialTags = new SpecialTagDTO[list.size()];
+            for (int i = 0; i < list.size(); i++) {
+                SpecialTagDTO specialTagDTO = new SpecialTagDTO(list.get(i));
+                specialTags[i] = specialTagDTO;
+            }
+        }
+        return specialTags;
+    }
 
 	private SpecialTagDTO[] getMarkSpecialTagList(MarkStudent student) {
 		List<SpecialTagDTO> list = new LinkedList<>();

+ 1 - 0
teachcloud-mark/src/main/resources/mapper/MarkTaskMapper.xml

@@ -128,6 +128,7 @@
 		and mt.paper_number = #{paperNumber}
 		and mt.group_number = #{groupNumber}
 		and mt.user_id = #{userId}
+		and mt.status = 'MARKED'
             <if test="secretNumber != null and secretNumber != '' ">
                 and mt.secret_number = #{secretNumber}
 			</if>