xiaofei hai 1 ano
pai
achega
89e8d47c40
Modificáronse 36 ficheiros con 196 adicións e 722 borrados
  1. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/analyze/GradePaperStructDatasource.java
  2. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/analyze/GradePaperStructResult.java
  3. 0 371
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamPaperStructure.java
  4. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/GradePaperStruct.java
  5. 0 14
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamPaperStructureMapper.java
  6. 0 23
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPaperStructureService.java
  7. 17 13
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/GradePaperStructService.java
  8. 0 18
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java
  9. 30 166
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradePaperStructServiceImpl.java
  10. 0 4
      distributed-print-business/src/main/resources/mapper/ExamPaperStructureMapper.xml
  11. 16 7
      distributed-print/src/main/java/com/qmth/distributed/print/api/GradePaperStructController.java
  12. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkQuestionController.java
  13. 13 3
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/MarkQuestion.java
  14. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ObjectivePolicy.java
  15. 36 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ObjectiveType.java
  16. 32 21
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/QuestionType.java
  17. 0 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/score/StudentObjectiveAnswerDto.java
  18. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/setting/MarkGroupDto.java
  19. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/setting/MarkQuestionDto.java
  20. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkGroup.java
  21. 0 47
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/enums/QuestionType.java
  22. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkQuestionMapper.java
  23. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/params/MarkObjectiveQuestionParams.java
  24. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/params/MarkQuestionParams.java
  25. 3 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkQuestionService.java
  26. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkGroupServiceImpl.java
  27. 14 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java
  28. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java
  29. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  30. 2 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java
  31. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/TaskServiceImpl.java
  32. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/utils/CardParseUtils.java
  33. 2 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/utils/ScoreCalculateUtil.java
  34. 1 1
      teachcloud-mark/src/main/resources/mapper/MarkQuestionMapper.xml
  35. 4 4
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/printOpen/PaperStructure.java
  36. 1 1
      teachcloud-task/src/main/java/com/qmth/teachcloud/task/service/impl/PrintFinishServiceImpl.java

+ 4 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/analyze/GradePaperStructDatasource.java

@@ -1,6 +1,6 @@
 package com.qmth.distributed.print.business.bean.params.analyze;
 
-import com.qmth.teachcloud.common.enums.QuestionType;
+import com.qmth.teachcloud.common.enums.ObjectiveType;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
@@ -22,7 +22,7 @@ public class GradePaperStructDatasource {
     private String bigTopicName;
 
     @ApiModelProperty(value = "题号类型(客观题、主观题)")
-    private QuestionType numberType;
+    private ObjectiveType numberType;
 
     @ApiModelProperty(value = "满分")
     private BigDecimal fullScore;
@@ -60,11 +60,11 @@ public class GradePaperStructDatasource {
         this.bigTopicName = bigTopicName;
     }
 
-    public QuestionType getNumberType() {
+    public ObjectiveType getNumberType() {
         return numberType;
     }
 
-    public void setNumberType(QuestionType numberType) {
+    public void setNumberType(ObjectiveType numberType) {
         this.numberType = numberType;
     }
 

+ 4 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/analyze/GradePaperStructResult.java

@@ -1,6 +1,6 @@
 package com.qmth.distributed.print.business.bean.result.analyze;
 
-import com.qmth.teachcloud.common.enums.QuestionType;
+import com.qmth.teachcloud.common.enums.ObjectiveType;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
@@ -25,7 +25,7 @@ public class GradePaperStructResult {
     private String paperType;
 
     @ApiModelProperty(value = "题号类型(主观题,客观题)")
-    private QuestionType numberType;
+    private ObjectiveType numberType;
 
     @ApiModelProperty(value = "大题名称")
     private String bigTopicName;
@@ -80,11 +80,11 @@ public class GradePaperStructResult {
         this.paperType = paperType;
     }
 
-    public QuestionType getNumberType() {
+    public ObjectiveType getNumberType() {
         return numberType;
     }
 
-    public void setNumberType(QuestionType numberType) {
+    public void setNumberType(ObjectiveType numberType) {
         this.numberType = numberType;
     }
 

+ 0 - 371
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamPaperStructure.java

@@ -1,371 +0,0 @@
-package com.qmth.distributed.print.business.entity;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.common.base.BaseEntity;
-import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang3.StringUtils;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 考试试卷结构表
- * </p>
- *
- * @author xf
- */
-@TableName("exam_paper_structure")
-public class ExamPaperStructure extends BaseEntity implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "学校id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableField("school_id")
-    private Long schoolId;
-
-    @ApiModelProperty(value = "学期ID")
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableField(value = "semester_id")
-    private Long semesterId;
-
-    /**
-     * 学期名称
-     */
-    @TableField("semester_name")
-    private String semesterName;
-
-    @ApiModelProperty(value = "考试id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableField("exam_id")
-    private Long examId;
-
-    @ApiModelProperty(value = "云阅卷考试ID")
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableField(value = "third_relate_id")
-    private Long thirdRelateId;
-
-    /**
-     * 云阅卷考试名称
-     */
-    @TableField("third_relate_name")
-    private String thirdRelateName;
-
-    /**
-     * 试卷编号
-     */
-    @TableField("paper_number")
-    private String paperNumber;
-
-    /**
-     * 课程代码
-     */
-    @TableField("course_code")
-    private String courseCode;
-    /**
-     * 课程名称
-     */
-    @TableField("course_name")
-    private String courseName;
-    /**
-     * 课程创建的任务序号(和exam_task保持一致)
-     */
-    @TableField("sequence")
-    private String sequence;
-    /**
-     * 试卷类型
-     */
-    @TableField("paper_type")
-    private String paperType;
-    /**
-     * 状态
-     */
-    private String status;
-    @TableField("is_finish")
-    private Boolean isFinish;
-    /**
-     * 试卷原卷和标答附件ID
-     */
-    @TableField("paper_answer")
-    private String paperAnswer;
-    /**
-     * 客观题试卷结构JSON
-     */
-    @TableField("objective_structure")
-    private String objectiveStructure;
-    /**
-     * 主观题试卷结构JSON
-     */
-    @TableField("subjective_structure")
-    private String subjectiveStructure;
-
-    @ApiModelProperty(value = "试卷整体json")
-    @TableField("paper_info_json")
-    private String paperInfoJson;
-    /**
-     * 命题老师ID
-     */
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableField("proposition_teacher_id")
-    private Long propositionTeacherId;
-
-    /**
-     * 0-禁用,1-启用
-     */
-    private Boolean enable;
-
-    private String markLeader;
-
-    @ApiModelProperty(value = "云阅卷试卷结构json")
-    @TableField("cloud_info_json")
-    private String cloudInfoJson;
-
-    @ApiModelProperty(value = "云阅卷试卷结构和知学知考结构不一样(默认false)")
-    @TableField("structure_change")
-    private Boolean structureChange;
-
-
-    @ApiModelProperty(value = "客观题答案有提交,需要重新统分(1:有变动,需要统分,0:不统分)(默认0)")
-    @TableField("object_answer_change")
-    private Boolean objectAnswerChange;
-
-    @ApiModelProperty(value = "是否开启分班阅(1:开启,0:关闭)(默认0)")
-    @TableField("open_class_reading")
-    private Boolean openClassReading;
-
-    @TableField(exist = false)
-    private String taskStatus;
-
-    @TableField(exist = false)
-    private String transferId;
-
-    public Long getSchoolId() {
-        return schoolId;
-    }
-
-    public void setSchoolId(Long schoolId) {
-        this.schoolId = schoolId;
-    }
-
-    public Long getSemesterId() {
-        return semesterId;
-    }
-
-    public void setSemesterId(Long semesterId) {
-        this.semesterId = semesterId;
-    }
-
-    public String getSemesterName() {
-        return semesterName;
-    }
-
-    public void setSemesterName(String semesterName) {
-        this.semesterName = semesterName;
-    }
-
-    public Long getThirdRelateId() {
-        return thirdRelateId;
-    }
-
-    public void setThirdRelateId(Long thirdRelateId) {
-        this.thirdRelateId = thirdRelateId;
-    }
-
-    public String getThirdRelateName() {
-        return thirdRelateName;
-    }
-
-    public void setThirdRelateName(String thirdRelateName) {
-        this.thirdRelateName = thirdRelateName;
-    }
-
-    public String getPaperNumber() {
-        return paperNumber;
-    }
-
-    public void setPaperNumber(String paperNumber) {
-        this.paperNumber = paperNumber;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public String getSequence() {
-        return sequence;
-    }
-
-    public void setSequence(String sequence) {
-        this.sequence = sequence;
-    }
-
-    public String getPaperType() {
-        return paperType;
-    }
-
-    public void setPaperType(String paperType) {
-        this.paperType = paperType;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public Boolean getFinish() {
-        return isFinish;
-    }
-
-    public void setFinish(Boolean finish) {
-        isFinish = finish;
-    }
-
-    public String getPaperAnswer() {
-        return paperAnswer;
-    }
-
-    public void setPaperAnswer(String paperAnswer) {
-        this.paperAnswer = paperAnswer;
-    }
-
-    public String getObjectiveStructure() {
-        return objectiveStructure;
-    }
-
-    public void setObjectiveStructure(String objectiveStructure) {
-        this.objectiveStructure = objectiveStructure;
-    }
-
-    public String getSubjectiveStructure() {
-        return subjectiveStructure;
-    }
-
-    public void setSubjectiveStructure(String subjectiveStructure) {
-        this.subjectiveStructure = subjectiveStructure;
-    }
-
-    public Long getPropositionTeacherId() {
-        return propositionTeacherId;
-    }
-
-    public void setPropositionTeacherId(Long propositionTeacherId) {
-        this.propositionTeacherId = propositionTeacherId;
-    }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-    public Long getExamId() {
-        return examId;
-    }
-
-    public void setExamId(Long examId) {
-        this.examId = examId;
-    }
-
-    public String getPaperInfoJson() {
-        return paperInfoJson;
-    }
-
-    public void setPaperInfoJson(String paperInfoJson) {
-        this.paperInfoJson = paperInfoJson;
-    }
-
-    public String getTaskStatus() {
-        return taskStatus;
-    }
-
-    public void setTaskStatus(String taskStatus) {
-        this.taskStatus = taskStatus;
-    }
-
-    public String getMarkLeader() {
-        return markLeader;
-    }
-
-    public void setMarkLeader(String markLeader) {
-        this.markLeader = markLeader;
-    }
-
-    public String getCloudInfoJson() {
-        return cloudInfoJson;
-    }
-
-    public void setCloudInfoJson(String cloudInfoJson) {
-        this.cloudInfoJson = cloudInfoJson;
-    }
-
-    public Boolean getStructureChange() {
-        return structureChange;
-    }
-
-    public void setStructureChange(Boolean structureChange) {
-        this.structureChange = structureChange;
-    }
-
-    public String getTransferId() {
-        return transferId;
-    }
-
-    public void setTransferId(String transferId) {
-        this.transferId = transferId;
-    }
-
-    public Boolean getObjectAnswerChange() {
-        return objectAnswerChange;
-    }
-
-    public void setObjectAnswerChange(Boolean objectAnswerChange) {
-        this.objectAnswerChange = objectAnswerChange;
-    }
-
-    public Boolean getOpenClassReading() {
-        return openClassReading;
-    }
-
-    public void setOpenClassReading(Boolean openClassReading) {
-        this.openClassReading = openClassReading;
-    }
-
-    /**
-     * 状态处理
-     *
-     * @param status   状态
-     * @param type     大类,取ExamPaperStructureStatusTypeEnum
-     * @param category 类别,save或者sync
-     * @param value    值,true或者false
-     * @return
-     */
-    public static String parseStatus(String status, String type, String category, Boolean value) {
-        JSONObject jsonObject = StringUtils.isNotBlank(status) ? JSON.parseObject(status, JSONObject.class) : new JSONObject();
-        JSONObject object = jsonObject.containsKey(type) ? jsonObject.getJSONObject(type) : new JSONObject();
-        object.put(category, value);
-        jsonObject.put(type, object);
-        return JSON.toJSONString(jsonObject);
-    }
-}

+ 4 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/GradePaperStruct.java

@@ -3,7 +3,7 @@ package com.qmth.distributed.print.business.entity;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.teachcloud.common.base.BaseEntity;
-import com.qmth.teachcloud.common.enums.QuestionType;
+import com.qmth.teachcloud.common.enums.ObjectiveType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -44,7 +44,7 @@ public class GradePaperStruct extends BaseEntity implements Serializable {
     private String questionName;
 
     @ApiModelProperty(value = "题号类型(客观题、主观题)")
-    private QuestionType numberType;
+    private ObjectiveType numberType;
 
     @ApiModelProperty(value = "大题号")
     private String bigQuestionNumber;
@@ -121,11 +121,11 @@ public class GradePaperStruct extends BaseEntity implements Serializable {
         this.questionName = questionName;
     }
 
-    public QuestionType getNumberType() {
+    public ObjectiveType getNumberType() {
         return numberType;
     }
 
-    public void setNumberType(QuestionType numberType) {
+    public void setNumberType(ObjectiveType numberType) {
         this.numberType = numberType;
     }
 

+ 0 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamPaperStructureMapper.java

@@ -1,14 +0,0 @@
-package com.qmth.distributed.print.business.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.qmth.distributed.print.business.entity.ExamPaperStructure;
-
-/**
- * <p>
- * 考试试卷结构 Mapper 接口
- * </p>
- *
- * @author xf
- */
-public interface ExamPaperStructureMapper extends BaseMapper<ExamPaperStructure> {
-}

+ 0 - 23
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPaperStructureService.java

@@ -1,23 +0,0 @@
-package com.qmth.distributed.print.business.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.distributed.print.business.entity.ExamPaperStructure;
-
-/**
- * <p>
- * 试卷结构 服务类
- * </p>
- *
- * @author xf
- */
-public interface ExamPaperStructureService extends IService<ExamPaperStructure> {
-
-    /**
-     * 解析云阅卷试卷结构
-     *
-     * @param examCloudPaperStructDtoList 云阅卷试卷结构集合
-     * @return 标准题目集合 <OBJECTIVE,list> <SUBJECTIVE,list>
-     */
-
-
-}

+ 17 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/GradePaperStructService.java

@@ -5,6 +5,7 @@ import com.qmth.distributed.print.business.bean.dto.open.PaperStructure;
 import com.qmth.distributed.print.business.bean.params.analyze.GradePaperStructParam;
 import com.qmth.distributed.print.business.bean.result.analyze.GradePaperStructResult;
 import com.qmth.distributed.print.business.entity.GradePaperStruct;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.entity.SysUser;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -24,13 +25,14 @@ public interface GradePaperStructService extends IService<GradePaperStruct> {
     /**
      * 查找分析试卷结构列表
      *
-     * @param examId      考试id
-     * @param paperNumber 试卷编号
-     * @param paperType   试卷类型
-     * @param requestUser 请求的用户
+     * @param examId           考试id
+     * @param paperNumber      试卷编号
+     * @param paperType        试卷类型
+     * @param requestUser      请求的用户
+     * @param markQuestionList
      * @return 结果
      */
-    List<GradePaperStructResult> findGradePaperStructureResultList(Long examId, String paperNumber, String paperType, SysUser requestUser);
+    List<GradePaperStructResult> findGradePaperStructureResultList(Long examId, String paperNumber, String paperType, SysUser requestUser, List<MarkQuestion> markQuestionList);
 
     /**
      * 批量保存分析试卷结构
@@ -54,12 +56,13 @@ public interface GradePaperStructService extends IService<GradePaperStruct> {
     /**
      * 分析 - 试卷结构模板导出
      *
-     * @param paperNumber 试卷编号
-     * @param paperType   试卷类型
-     * @param requestUser 请求用户
+     * @param paperNumber      试卷编号
+     * @param paperType        试卷类型
+     * @param requestUser      请求用户
+     * @param markQuestionList
      * @throws Exception 异常
      */
-    void exportGradePaperStructTemplate(Long examId, String paperNumber, String paperType, SysUser requestUser) throws Exception;
+    void exportGradePaperStructTemplate(Long examId, String paperNumber, String paperType, SysUser requestUser, List<MarkQuestion> markQuestionList) throws Exception;
 
     List<PaperStructure> findBySchoolIdAndPaperNumberAndPaperType(Long schoolId,Long examId, String paperNumber, String paperType);
 
@@ -70,9 +73,10 @@ public interface GradePaperStructService extends IService<GradePaperStruct> {
      * 2.删除知学知考-分析配置试卷结构表该试卷结构下的数据
      * </p>
      *
-     * @param schoolId    学校id
-     * @param paperNumber 试卷编号
-     * @param paperType   试卷类型
+     * @param schoolId         学校id
+     * @param paperNumber      试卷编号
+     * @param paperType        试卷类型
+     * @param markQuestionList
      */
-    void updateExamCloudPaperStruct(Long schoolId, String paperNumber, String paperType);
+    void updateExamCloudPaperStruct(Long schoolId, String paperNumber, String paperType, List<MarkQuestion> markQuestionList);
 }

+ 0 - 18
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java

@@ -1,18 +0,0 @@
-package com.qmth.distributed.print.business.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.entity.ExamPaperStructure;
-import com.qmth.distributed.print.business.mapper.ExamPaperStructureMapper;
-import com.qmth.distributed.print.business.service.ExamPaperStructureService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 试卷结构 服务实现类
- * </p>
- */
-@Service
-public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructureMapper, ExamPaperStructure> implements ExamPaperStructureService {
-
-
-}

+ 30 - 166
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradePaperStructServiceImpl.java

@@ -1,6 +1,5 @@
 package com.qmth.distributed.print.business.service.impl;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -11,21 +10,20 @@ import com.qmth.distributed.print.business.bean.marking.Question;
 import com.qmth.distributed.print.business.bean.params.analyze.GradePaperStructDatasource;
 import com.qmth.distributed.print.business.bean.params.analyze.GradePaperStructParam;
 import com.qmth.distributed.print.business.bean.result.analyze.GradePaperStructResult;
-import com.qmth.distributed.print.business.entity.ExamPaperStructure;
 import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.entity.GradePaperStruct;
 import com.qmth.distributed.print.business.mapper.GradePaperStructMapper;
-import com.qmth.distributed.print.business.service.ExamPaperStructureService;
 import com.qmth.distributed.print.business.service.ExamTaskService;
 import com.qmth.distributed.print.business.service.GradeBatchPaperService;
 import com.qmth.distributed.print.business.service.GradePaperStructService;
-import com.qmth.teachcloud.common.bean.dto.stmms.ExamCloudPaperStructDto;
 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.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.enums.QuestionType;
+import com.qmth.teachcloud.common.enums.ObjectiveType;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
+import org.apache.commons.collections4.CollectionUtils;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -52,12 +50,10 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
     @Resource
     private GradeBatchPaperService gradeBatchPaperService;
     @Resource
-    private ExamPaperStructureService examPaperStructureService;
-    @Resource
     private ExamTaskService examTaskService;
 
     @Override
-    public List<GradePaperStructResult> findGradePaperStructureResultList(Long examId, String paperNumber, String paperType, SysUser requestUser) {
+    public List<GradePaperStructResult> findGradePaperStructureResultList(Long examId, String paperNumber, String paperType, SysUser requestUser, List<MarkQuestion> markQuestionList) {
         Long schoolId = requestUser.getSchoolId();
         List<GradePaperStructResult> result = new ArrayList<>();
         // 先从分析试卷结构表取
@@ -66,40 +62,14 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
             // 如果已经设置了试卷结构查询之前配置好的分析参数-试卷结构
             result = gradeStructDatasource;
         } else {
-            // 构建客观题结构集合
-            List<Question> examPaperObjList = new ArrayList<>();
-            // 构建主观题结构集合
-            List<Question> examPaperSubList = new ArrayList<>();
-            ExamPaperStructure examPaperStructure = examPaperStructureService.getOne(new QueryWrapper<ExamPaperStructure>()
-                    .lambda()
-                    .eq(ExamPaperStructure::getSchoolId, schoolId)
-                    .eq(ExamPaperStructure::getExamId, examId)
-                    .eq(ExamPaperStructure::getPaperNumber, paperNumber)
-                    .eq(ExamPaperStructure::getPaperType, paperType));
-            if (Objects.isNull(examPaperStructure)) {
-                throw ExceptionResultEnum.ERROR.exception("该试卷还没有上传评卷参数设置");
-            }
-            String cloudInfoJson = examPaperStructure.getCloudInfoJson();
-            if (SystemConstant.strNotNull(cloudInfoJson)) {
-                // 如果云阅卷同步回来的结构不为空,优先使用云阅卷的
-                List<ExamCloudPaperStructDto> examCloudPaperStructDtoList = JSON.parseArray(cloudInfoJson, ExamCloudPaperStructDto.class);
-                Map<QuestionType, List<Question>> examCloudPaperStructMap = parseExamCloudPaperStruct(examCloudPaperStructDtoList);
-                examPaperObjList = examCloudPaperStructMap.get(QuestionType.OBJECTIVE);
-                examPaperSubList = examCloudPaperStructMap.get(QuestionType.SUBJECTIVE);
-            } else {
-                // 当客观题答案未上传导致云阅卷客观题结构不完整不同步时,使用知学知考试卷结构
-                // 客观题
-                String examPaperObj = examPaperStructure.getObjectiveStructure();
-                if (SystemConstant.strNotNull(examPaperObj)) {
-                    examPaperObjList = JSON.parseArray(examPaperObj, Question.class);
-                }
-                // 主观题
-                String examPaperSub = examPaperStructure.getSubjectiveStructure();
-                if (SystemConstant.strNotNull(examPaperSub)) {
-                    examPaperSubList = JSON.parseArray(examPaperSub, Question.class);
-                }
+            if (CollectionUtils.isEmpty(markQuestionList)) {
+                throw ExceptionResultEnum.ERROR.exception("知学知考试卷结构不存在");
             }
 
+            // 如果云阅卷同步回来的结构不为空,优先使用云阅卷的
+            Map<ObjectiveType, List<Question>> examCloudPaperStructMap = parseExamCloudPaperStruct(markQuestionList);
+            List<Question> examPaperObjList = examCloudPaperStructMap.get(ObjectiveType.OBJECTIVE);
+            List<Question> examPaperSubList = examCloudPaperStructMap.get(ObjectiveType.SUBJECTIVE);
 
             List<ExamTask> examTaskList = examTaskService.list(new QueryWrapper<ExamTask>().lambda()
                     .eq(ExamTask::getSchoolId, schoolId)
@@ -124,7 +94,7 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
                 cell.setCourseName(courseName);
                 cell.setPaperNumber(paperNumber);
                 cell.setPaperType(paperType);
-                cell.setNumberType(QuestionType.OBJECTIVE);
+                cell.setNumberType(ObjectiveType.OBJECTIVE);
                 cell.setBigTopicName(question.getMainTitle());
                 cell.setBigQuestionNumber(String.valueOf(question.getMainNumber()));
                 cell.setSmallQuestionNumber(question.getSubNumber());
@@ -138,7 +108,7 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
                 cell.setCourseName(courseName);
                 cell.setPaperNumber(paperNumber);
                 cell.setPaperType(paperType);
-                cell.setNumberType(QuestionType.SUBJECTIVE);
+                cell.setNumberType(ObjectiveType.SUBJECTIVE);
                 cell.setBigTopicName(question.getMainTitle());
                 cell.setBigQuestionNumber(String.valueOf(question.getMainNumber()));
                 cell.setSmallQuestionNumber(question.getSubNumber());
@@ -207,7 +177,7 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
                         gradePaperStructDatasource.setBigQuestionNumber(gradePaperStructDto.getBigQuestionNumber());
                         gradePaperStructDatasource.setSmallQuestionNumber(gradePaperStructDto.getSmallQuestionNumber());
                         gradePaperStructDatasource.setBigTopicName(gradePaperStructDto.getBigTopicName());
-                        gradePaperStructDatasource.setNumberType(QuestionType.convertToEnum(gradePaperStructDto.getNumberType()));
+                        gradePaperStructDatasource.setNumberType(ObjectiveType.convertToEnum(gradePaperStructDto.getNumberType()));
                         gradePaperStructDatasource.setFullScore(BigDecimal.valueOf(Double.parseDouble(gradePaperStructDto.getFullScore())));
                         gradePaperStructDatasource.setKnowledgeDimension(gradePaperStructDto.getKnowledgeDimension());
                         gradePaperStructDatasource.setAbilityDimension(gradePaperStructDto.getAbilityDimension());
@@ -221,7 +191,7 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
     }
 
     @Override
-    public void exportGradePaperStructTemplate(Long examId, String paperNumber, String paperType, @NotNull SysUser requestUser) throws Exception {
+    public void exportGradePaperStructTemplate(Long examId, String paperNumber, String paperType, @NotNull SysUser requestUser, List<MarkQuestion> markQuestionList) throws Exception {
 
         ExamTask examTask = examTaskService.getOne(new QueryWrapper<ExamTask>().lambda()
                 .eq(ExamTask::getSchoolId, requestUser.getSchoolId())
@@ -232,7 +202,7 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
         String courseCode = examTask.getCourseCode();
         String courseName = examTask.getCourseName();
 
-        List<GradePaperStructResult> datasource = this.findGradePaperStructureResultList(examId, paperNumber, paperType, requestUser);
+        List<GradePaperStructResult> datasource = this.findGradePaperStructureResultList(examId, paperNumber, paperType, requestUser, markQuestionList);
         List<GradePaperStructDto> gradePaperStructDtoList = datasource.stream().flatMap(e -> {
             GradePaperStructDto cell = new GradePaperStructDto();
             cell.setCourseCode(courseCode);
@@ -258,43 +228,18 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public void updateExamCloudPaperStruct(Long schoolId, String paperNumber, String paperType) {
+    public void updateExamCloudPaperStruct(Long schoolId, String paperNumber, String paperType, List<MarkQuestion> markQuestionList) {
         // 更新试卷结构参数的云阅卷试卷结构
-        QueryWrapper<ExamPaperStructure> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda()
-                .eq(ExamPaperStructure::getSchoolId, schoolId)
-                .eq(ExamPaperStructure::getPaperNumber, paperNumber);
-        if (SystemConstant.strNotNull(paperType)) {
-            queryWrapper.lambda().eq(ExamPaperStructure::getPaperType, paperType);
-        }
-
-        List<ExamPaperStructure> examPaperStructureList = examPaperStructureService.list(queryWrapper);
-
-        if (examPaperStructureList.size() != 1) {
+        if (CollectionUtils.isEmpty(markQuestionList)) {
             throw ExceptionResultEnum.ERROR.exception("知学知考试卷结构异常");
         }
-        ExamPaperStructure examPaperStructure = examPaperStructureList.get(0);
-        // 云阅卷考试ID
-        String examId = String.valueOf(examPaperStructure.getThirdRelateId());
-        // 科目代码(课程代码+卷型+课程序号)
-        String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
-
-        String examPaperObj = examPaperStructure.getObjectiveStructure();
-
         // 如果没有客观题 试卷类型传空
         paperType = null;
-//        if (SystemConstant.strNotNull(examPaperObj)) {
-//            List<Question> examPaperObjList = JSON.parseArray(examPaperObj, Question.class);
-//            if (examPaperObjList != null && examPaperObjList.size() > 0) {
-//                paperType = examPaperStructure.getPaperType();
-//            }
-//        }
-
         // todo 3.3.0待更新
 //        String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, paperType);
 //        examPaperStructure.setCloudInfoJson(cloudInfoJson);
-        examPaperStructure.setStructureChange(false);
-        examPaperStructureService.updateById(examPaperStructure);
+//        examPaperStructure.setStructureChange(false);
+//        examPaperStructureService.updateById(examPaperStructure);
 
         // 更新grade_paper_struct
         QueryWrapper<GradePaperStruct> willDeleteQueryWrapper = new QueryWrapper<>();
@@ -344,98 +289,17 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
         }).collect(Collectors.toList());
     }
 
-    /**
-     * 保存教研分析分析中基础配置命题蓝图设置保存时的数据校验
-     * <p>
-     * 1.优先校验云阅卷试卷结构返回字段
-     * 2.如果云阅卷试卷结构返回字段为空,则和知学知考原字段做比较
-     * </p>
-     *
-     * @param datasource  保存的试卷结构数据集
-     * @param paperNumber 试卷编号
-     * @param paperType   试卷类型
-     * @param requestUser 请求用户
-     */
-    private void checkPaperStructWhenSave(List<GradePaperStructDatasource> datasource, String paperNumber, String paperType, SysUser requestUser) {
-        Long schoolId = requestUser.getSchoolId();
-        ExamPaperStructure examPaperStructure = examPaperStructureService.getOne(new QueryWrapper<ExamPaperStructure>()
-                .lambda()
-                .eq(ExamPaperStructure::getSchoolId, schoolId)
-                .eq(ExamPaperStructure::getPaperNumber, paperNumber)
-                .eq(ExamPaperStructure::getPaperType, paperType));
-        if (Objects.isNull(examPaperStructure)) {
-            throw ExceptionResultEnum.ERROR.exception("该试卷还没有上传评卷参数设置");
-        }
-        //客观题
-        List<Question> examPaperObjList = new ArrayList<>();
-        // 主观题
-        List<Question> examPaperSubList = new ArrayList<>();
-        // 对比信息
-        String comparison = "知学知考";
-        int code = ExceptionResultEnum.ERROR.getCode();
-        String cloudInfoJson = examPaperStructure.getCloudInfoJson();
-        if (SystemConstant.strNotNull(cloudInfoJson)) {
-            // 优先与云阅卷对比
-            List<ExamCloudPaperStructDto> examCloudPaperStructDtoList = JSON.parseArray(cloudInfoJson, ExamCloudPaperStructDto.class);
-            Map<QuestionType, List<Question>> questionTypeListMap = parseExamCloudPaperStruct(examCloudPaperStructDtoList);
-            examPaperObjList = questionTypeListMap.get(QuestionType.OBJECTIVE);
-            examPaperSubList = questionTypeListMap.get(QuestionType.SUBJECTIVE);
-            comparison = "云阅卷";
-            code = ExceptionResultEnum.PAPER_STRUCT_EXCEPTION.getCode();
-        } else {
-            // 当云阅卷试卷结构同步结果没有时与知学知考对比
-            String examPaperObj = examPaperStructure.getObjectiveStructure();
-            if (SystemConstant.strNotNull(examPaperObj)) {
-                examPaperObjList = JSON.parseArray(examPaperObj, Question.class);
-            }
-            String examPaperSub = examPaperStructure.getSubjectiveStructure();
-            if (SystemConstant.strNotNull(examPaperSub)) {
-                examPaperSubList = JSON.parseArray(examPaperSub, Question.class);
-            }
-        }
-
-        List<Question> gradePaperObjList = datasource.stream()
-                .filter(e -> QuestionType.OBJECTIVE.equals(e.getNumberType()))
-                .flatMap(e -> {
-                    Question cell = new Question();
-                    cell.setMainNumber(Integer.valueOf(e.getBigQuestionNumber()));
-                    cell.setMainTitle(e.getBigTopicName());
-                    cell.setSubNumber(e.getSmallQuestionNumber());
-                    cell.setTotalScore(e.getFullScore());
-                    return Stream.of(cell);
-                }).collect(Collectors.toList());
-        if (!Question.matchTwoQuestionList(examPaperObjList, gradePaperObjList)) {
-            throw ExceptionResultEnum.ERROR.exception(code, "试卷编号为【" + paperNumber + "】,试卷类型为【" + paperType +
-                    "】的分析试卷结构和 [" + comparison + "] 试卷结构在【" + QuestionType.OBJECTIVE.getDesc() + "】上不一致");
-        }
-
-        List<Question> gradePaperSubList = datasource.stream()
-                .filter(e -> QuestionType.SUBJECTIVE.equals(e.getNumberType()))
-                .flatMap(e -> {
-                    Question cell = new Question();
-                    cell.setMainNumber(Integer.valueOf(e.getBigQuestionNumber()));
-                    cell.setMainTitle(e.getBigTopicName());
-                    cell.setSubNumber(e.getSmallQuestionNumber());
-                    cell.setTotalScore(e.getFullScore());
-                    return Stream.of(cell);
-                }).collect(Collectors.toList());
-        if (!Question.matchTwoQuestionList(examPaperSubList, gradePaperSubList)) {
-            throw ExceptionResultEnum.ERROR.exception(code, "试卷编号为【" + paperNumber + "】,试卷类型为【" + paperType +
-                    "】的分析试卷结构和 [" + comparison + "] 试卷结构在【" + QuestionType.SUBJECTIVE.getDesc() + "】上不一致");
-        }
-    }
-
-    private Map<QuestionType, List<Question>> parseExamCloudPaperStruct(List<ExamCloudPaperStructDto> examCloudPaperStructDtoList) {
-        Map<QuestionType, List<Question>> result = new HashMap<>();
+    private Map<ObjectiveType, List<Question>> parseExamCloudPaperStruct(List<MarkQuestion> markQuestionList) {
+        Map<ObjectiveType, List<Question>> result = new HashMap<>();
         List<Question> objList = new ArrayList<>();
         List<Question> subList = new ArrayList<>();
-        for (ExamCloudPaperStructDto examCloudPaperStructDto : examCloudPaperStructDtoList) {
-            boolean objective = examCloudPaperStructDto.getObjective();
-            String mainTitle = examCloudPaperStructDto.getMainTitle();
-            Integer mainNumber = examCloudPaperStructDto.getMainNumber();
-            Integer subNumber = examCloudPaperStructDto.getSubNumber();
-            double totalScore = examCloudPaperStructDto.getTotalScore();
-            String answer = examCloudPaperStructDto.getAnswer();
+        for (MarkQuestion markQuestion : markQuestionList) {
+            boolean objective = markQuestion.getObjective();
+            String mainTitle = markQuestion.getMainTitle();
+            Integer mainNumber = markQuestion.getMainNumber();
+            Integer subNumber = markQuestion.getSubNumber();
+            double totalScore = markQuestion.getTotalScore();
+            String answer = markQuestion.getAnswer();
 
             Question question = new Question();
             question.setMainTitle(mainTitle);
@@ -449,8 +313,8 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
                 subList.add(question);
             }
         }
-        result.put(QuestionType.OBJECTIVE, objList);
-        result.put(QuestionType.SUBJECTIVE, subList);
+        result.put(ObjectiveType.OBJECTIVE, objList);
+        result.put(ObjectiveType.SUBJECTIVE, subList);
         return result;
     }
 }

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

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.qmth.distributed.print.business.mapper.ExamPaperStructureMapper">
-</mapper>

+ 16 - 7
distributed-print/src/main/java/com/qmth/distributed/print/api/GradePaperStructController.java

@@ -12,6 +12,8 @@ import com.qmth.teachcloud.common.enums.log.CustomizedOperationTypeEnum;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
+import com.qmth.teachcloud.mark.service.MarkQuestionService;
 import io.swagger.annotations.*;
 import org.springframework.validation.BindingResult;
 import org.springframework.validation.annotation.Validated;
@@ -21,6 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.validation.Valid;
 import java.io.IOException;
+import java.util.List;
 
 /**
  * <p>
@@ -38,11 +41,13 @@ import java.io.IOException;
 public class GradePaperStructController {
     @Resource
     private GradePaperStructService gradePaperStructService;
+    @Resource
+    private MarkQuestionService markQuestionService;
 
     @ApiOperation(value = "成绩分析试卷结构-查询")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = GradePaperStructResult.class)})
-    public Result findGradePaperStructList(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
+    public Result findGradePaperStructList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                            @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
                                            @ApiParam(value = "试卷类型", required = true) @RequestParam String paperType) {
 
@@ -50,7 +55,8 @@ public class GradePaperStructController {
         if (SystemConstant.isOneNull(paperNumber, paperType)) {
             throw ExceptionResultEnum.ERROR.exception("试卷参数不完整");
         }
-        return ResultUtil.ok(gradePaperStructService.findGradePaperStructureResultList(SystemConstant.convertIdToLong(examId),paperNumber, paperType, requestUser));
+        List<MarkQuestion> markQuestionList = markQuestionService.listByExamIdAndPaperNumberAndPaperType(examId, paperNumber, paperType, null);
+        return ResultUtil.ok(gradePaperStructService.findGradePaperStructureResultList(examId, paperNumber, paperType, requestUser, markQuestionList));
     }
 
     @ApiOperation(value = "成绩分析试卷结构-新建试卷结构")
@@ -87,7 +93,7 @@ public class GradePaperStructController {
     @RequestMapping(value = "/export", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EXPORT)
-    public Result gradePaperStructExport(@ApiParam(value = "考试id",required = true) @RequestParam String examId,
+    public Result gradePaperStructExport(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                          @ApiParam(value = "课程编号", required = true) @RequestParam String paperNumber,
                                          @ApiParam(value = "课程名称", required = true) @RequestParam String paperType) throws Exception {
 
@@ -95,7 +101,8 @@ public class GradePaperStructController {
         if (SystemConstant.isOneNull(examId, paperNumber, paperType)) {
             throw ExceptionResultEnum.ERROR.exception("参数不完整");
         }
-        gradePaperStructService.exportGradePaperStructTemplate(SystemConstant.convertIdToLong(examId), paperNumber, paperType, requestUser);
+        List<MarkQuestion> markQuestionList = markQuestionService.listByExamIdAndPaperNumberAndPaperType(examId, paperNumber, paperType, null);
+        gradePaperStructService.exportGradePaperStructTemplate(examId, paperNumber, paperType, requestUser, markQuestionList);
         return ResultUtil.ok();
     }
 
@@ -103,13 +110,15 @@ public class GradePaperStructController {
     @RequestMapping(value = "/change_paper_structure", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = Result.class)})
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
-    public Result updateExamCloudPaperStruct(@ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+    public Result updateExamCloudPaperStruct(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
+                                             @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
                                              @ApiParam(value = "试卷类型") @RequestParam(required = false) String paperType) {
-        if (SystemConstant.isOneNull(paperNumber)){
+        if (SystemConstant.isOneNull(paperNumber)) {
             throw ExceptionResultEnum.ERROR.exception("缺少试卷编号");
         }
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
-        gradePaperStructService.updateExamCloudPaperStruct(requestUser.getSchoolId(),paperNumber,paperType);
+        List<MarkQuestion> markQuestionList = markQuestionService.listByExamIdAndPaperNumberAndPaperType(examId, paperNumber, paperType, null);
+        gradePaperStructService.updateExamCloudPaperStruct(requestUser.getSchoolId(), paperNumber, paperType, markQuestionList);
         return ResultUtil.ok();
     }
 }

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkQuestionController.java

@@ -15,7 +15,7 @@ import com.qmth.teachcloud.common.util.ExamTaskUtil;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import com.qmth.teachcloud.mark.dto.mark.setting.MarkQuestionDto;
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.params.MarkObjectiveQuestionParams;
 import com.qmth.teachcloud.mark.params.MarkQuestionParams;
 import com.qmth.teachcloud.mark.service.MarkQuestionService;

+ 13 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkQuestion.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/MarkQuestion.java

@@ -1,13 +1,12 @@
-package com.qmth.teachcloud.mark.entity;
+package com.qmth.teachcloud.common.entity;
 
 import java.io.Serializable;
 
 import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.mark.enums.ObjectivePolicy;
-import com.qmth.teachcloud.mark.enums.QuestionType;
 
+import com.qmth.teachcloud.common.enums.ObjectivePolicy;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -37,6 +36,9 @@ public class MarkQuestion implements Serializable {
     @ApiModelProperty(value = "试卷类型")
     private String paperNumber;
 
+    @ApiModelProperty(value = "试卷卷型")
+    private String paperType;
+
     @ApiModelProperty(value = "是否客观题")
     private Boolean objective;
 
@@ -98,6 +100,14 @@ public class MarkQuestion implements Serializable {
         this.paperNumber = paperNumber;
     }
 
+    public String getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(String paperType) {
+        this.paperType = paperType;
+    }
+
     public Boolean getObjective() {
         return objective;
     }

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/enums/ObjectivePolicy.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ObjectivePolicy.java

@@ -1,4 +1,4 @@
-package com.qmth.teachcloud.mark.enums;
+package com.qmth.teachcloud.common.enums;
 
 /**
  * 客观题判断策略

+ 36 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ObjectiveType.java

@@ -0,0 +1,36 @@
+package com.qmth.teachcloud.common.enums;
+
+import java.util.Objects;
+
+/**
+ * @Description: 题目类型(主观题、客观题)
+ * @Author: CaoZixuan
+ * @Date: 2022-05-30
+ */
+public enum ObjectiveType {
+    OBJECTIVE("客观题"),
+    SUBJECTIVE("主观题"),
+    ;
+    private final String desc;
+
+    ObjectiveType(String desc) {
+        this.desc = desc;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public static ObjectiveType convertToEnum(String desc) {
+        ObjectiveType result = null;
+        for (ObjectiveType e : ObjectiveType.values()) {
+            if (Objects.equals(desc, e.getDesc())) {
+                result = e;
+            }
+        }
+        if (result == null){
+            throw ExceptionResultEnum.ERROR.exception("枚举类型不存在");
+        }
+        return result;
+    }
+}

+ 32 - 21
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/QuestionType.java

@@ -1,36 +1,47 @@
 package com.qmth.teachcloud.common.enums;
 
-import java.util.Objects;
+import com.baomidou.mybatisplus.annotation.EnumValue;
 
 /**
- * @Description: 题目类型(主观题、客观题)
- * @Author: CaoZixuan
- * @Date: 2022-05-30
+ * 题型
  */
 public enum QuestionType {
-    OBJECTIVE("客观题"),
-    SUBJECTIVE("主观题"),
-    ;
-    private final String desc;
+    SINGLE("单选题", 1, true),
+    MULTIPLE("多选题", 2, true),
+    TRUE_OR_FALSE("判断题", 3, true),
+    COMPLETION("填空题", 4, false),
+    QUESTION_ANSWER("解答题", 5, false);
 
-    QuestionType(String desc) {
-        this.desc = desc;
+    private String name;
+
+    @EnumValue
+    private int value;
+    private Boolean isObjective;
+
+    private QuestionType(String name, int value, Boolean isObjective) {
+        this.name = name;
+        this.value = value;
+        this.isObjective = isObjective;
+    }
+
+    public String getName() {
+        return name;
     }
 
-    public String getDesc() {
-        return desc;
+    public int getValue() {
+        return value;
     }
 
-    public static QuestionType convertToEnum(String desc) {
-        QuestionType result = null;
-        for (QuestionType e : QuestionType.values()) {
-            if (Objects.equals(desc, e.getDesc())) {
-                result = e;
+    public Boolean getObjective() {
+        return isObjective;
+    }
+
+    public static QuestionType findByValue(int value) {
+        for (QuestionType c : QuestionType.values()) {
+            if (c.getValue() == value) {
+                return c;
             }
         }
-        if (result == null){
-            throw ExceptionResultEnum.ERROR.exception("枚举类型不存在");
-        }
-        return result;
+        return null;
     }
 }

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

@@ -1,7 +1,5 @@
 package com.qmth.teachcloud.mark.dto.mark.score;
 
-import com.qmth.teachcloud.mark.enums.QuestionType;
-
 public class StudentObjectiveAnswerDto {
 
     private Integer mainNumber;

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/setting/MarkGroupDto.java

@@ -2,7 +2,7 @@ package com.qmth.teachcloud.mark.dto.mark.setting;
 
 import com.qmth.teachcloud.common.bean.dto.mark.MarkUser;
 import com.qmth.teachcloud.common.bean.dto.mark.PictureConfig;
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.enums.ScorePolicy;
 
 import java.util.List;

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/setting/MarkQuestionDto.java

@@ -1,6 +1,6 @@
 package com.qmth.teachcloud.mark.dto.mark.setting;
 
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 
 import java.util.List;
 

+ 1 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkGroup.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.dto.mark.ScoreItem;
 import com.qmth.teachcloud.mark.enums.ScorePolicy;
 import io.swagger.annotations.ApiModel;

+ 0 - 47
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/enums/QuestionType.java

@@ -1,47 +0,0 @@
-package com.qmth.teachcloud.mark.enums;
-
-import com.baomidou.mybatisplus.annotation.EnumValue;
-
-/**
- * 题型
- */
-public enum QuestionType {
-    SINGLE("单选题", 1, true),
-    MULTIPLE("多选题", 2, true),
-    TRUE_OR_FALSE("判断题", 3, true),
-    COMPLETION("填空题", 4, false),
-    QUESTION_ANSWER("解答题", 5, false);
-
-    private String name;
-
-    @EnumValue
-    private int value;
-    private Boolean isObjective;
-
-    private QuestionType(String name, int value, Boolean isObjective) {
-        this.name = name;
-        this.value = value;
-        this.isObjective = isObjective;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public int getValue() {
-        return value;
-    }
-
-    public Boolean getObjective() {
-        return isObjective;
-    }
-
-    public static QuestionType findByValue(int value) {
-        for (QuestionType c : QuestionType.values()) {
-            if (c.getValue() == value) {
-                return c;
-            }
-        }
-        return null;
-    }
-}

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

@@ -1,6 +1,6 @@
 package com.qmth.teachcloud.mark.mapper;
 
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/params/MarkObjectiveQuestionParams.java

@@ -1,6 +1,6 @@
 package com.qmth.teachcloud.mark.params;
 
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 
 import java.io.Serializable;
 import java.util.List;

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/params/MarkQuestionParams.java

@@ -1,6 +1,6 @@
 package com.qmth.teachcloud.mark.params;
 
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 
 import java.io.Serializable;
 import java.util.List;

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

@@ -2,7 +2,7 @@ package com.qmth.teachcloud.mark.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.teachcloud.mark.dto.mark.setting.MarkQuestionDto;
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.params.MarkObjectiveQuestionParams;
 import com.qmth.teachcloud.mark.params.MarkQuestionParams;
 import org.springframework.web.multipart.MultipartFile;
@@ -54,4 +54,6 @@ public interface MarkQuestionService extends IService<MarkQuestion> {
     void updateGroupNumberByExamIdAndPaperNumberAndGroupNumber(Integer newGroupNumber, Long examId, String paperNumber, Integer groupNumber);
 
     long countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(Long examId, String paperNumber, boolean objective);
+
+    List<MarkQuestion> listByExamIdAndPaperNumberAndPaperType(Long examId, String paperNumber, String paperType, Boolean objective);
 }

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

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 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.setting.MarkGroupDto;

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

@@ -10,7 +10,7 @@ import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.util.FileStoreUtil;
 import com.qmth.teachcloud.mark.dto.mark.setting.MarkQuestionDto;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.mapper.MarkQuestionMapper;
 import com.qmth.teachcloud.mark.params.MarkObjectiveQuestionParams;
 import com.qmth.teachcloud.mark.params.MarkQuestionParams;
@@ -252,4 +252,17 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                 .isNull(MarkQuestion::getGroupNumber);
         return this.count(queryWrapper);
     }
+
+    @Override
+    public List<MarkQuestion> listByExamIdAndPaperNumberAndPaperType(Long examId, String paperNumber, String paperType, Boolean objective) {
+        QueryWrapper<MarkQuestion> queryWrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<MarkQuestion> lambdaQueryWrapper = queryWrapper.lambda();
+        lambdaQueryWrapper.eq(MarkQuestion::getExamId, examId)
+                .eq(MarkQuestion::getPaperNumber, paperNumber)
+                .eq(MarkQuestion::getPaperType, paperType);
+        if (objective != null) {
+            lambdaQueryWrapper.eq(MarkQuestion::getObjective, objective);
+        }
+        return this.list(queryWrapper);
+    }
 }

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

@@ -1,5 +1,6 @@
 package com.qmth.teachcloud.mark.service.impl;
 
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.mark.*;

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

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.boot.core.concurrent.service.ConcurrentService;
 import com.qmth.boot.core.exception.ParameterException;
 import com.qmth.teachcloud.common.entity.BasicExam;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.ScanStatus;
@@ -39,7 +40,6 @@ import com.qmth.teachcloud.mark.lock.LockService;
 import com.qmth.teachcloud.mark.mapper.MarkStudentMapper;
 import com.qmth.teachcloud.mark.params.MarkHeaderGroupResult;
 import com.qmth.teachcloud.mark.params.MarkHeaderResult;
-import com.qmth.teachcloud.mark.params.MarkResult;
 import com.qmth.teachcloud.mark.service.*;
 import com.qmth.teachcloud.mark.utils.BatchGetDataUtil;
 import com.qmth.teachcloud.mark.utils.ScoreCalculateUtil;

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

@@ -34,7 +34,7 @@ import com.qmth.teachcloud.mark.dto.ScanOmrTaskResultDto;
 import com.qmth.teachcloud.mark.dto.ScanOmrTaskResultPageDto;
 import com.qmth.teachcloud.mark.dto.ScanOmrTaskSaveDto;
 import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.entity.ScanOmrTask;
 import com.qmth.teachcloud.mark.entity.ScanPaper;
@@ -42,7 +42,7 @@ import com.qmth.teachcloud.mark.entity.ScanPaperPage;
 import com.qmth.teachcloud.mark.entity.ScanStudentPaper;
 import com.qmth.teachcloud.mark.enums.LockType;
 import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
-import com.qmth.teachcloud.mark.enums.QuestionType;
+import com.qmth.teachcloud.common.enums.QuestionType;
 import com.qmth.teachcloud.mark.mapper.ScanOmrTaskMapper;
 import com.qmth.teachcloud.mark.service.MarkQuestionService;
 import com.qmth.teachcloud.mark.service.MarkStudentService;

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

@@ -1,5 +1,6 @@
 package com.qmth.teachcloud.mark.service.impl;
 
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.mark.dto.mark.ScoreItem;

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/utils/CardParseUtils.java

@@ -2,7 +2,7 @@ package com.qmth.teachcloud.mark.utils;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.qmth.teachcloud.mark.enums.QuestionType;
+import com.qmth.teachcloud.common.enums.QuestionType;
 import com.qmth.teachcloud.mark.bean.vo.parseCard.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

+ 2 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/utils/ScoreCalculateUtil.java

@@ -2,9 +2,9 @@ package com.qmth.teachcloud.mark.utils;
 
 import com.qmth.teachcloud.mark.dto.mark.ScoreInfo;
 import com.qmth.teachcloud.mark.dto.mark.ScoreItem;
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
-import com.qmth.teachcloud.mark.enums.ObjectivePolicy;
+import com.qmth.teachcloud.common.enums.ObjectivePolicy;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

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

@@ -3,7 +3,7 @@
 <mapper namespace="com.qmth.teachcloud.mark.mapper.MarkQuestionMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.qmth.teachcloud.mark.entity.MarkQuestion">
+    <resultMap id="BaseResultMap" type="com.qmth.teachcloud.common.entity.MarkQuestion">
         <id column="id" property="id" />
         <result column="exam_id" property="examId" />
         <result column="paper_number" property="paperNumber" />

+ 4 - 4
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/printOpen/PaperStructure.java

@@ -2,7 +2,7 @@ package com.qmth.teachcloud.report.business.bean.dto.printOpen;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.common.enums.QuestionType;
+import com.qmth.teachcloud.common.enums.ObjectiveType;
 
 import java.math.BigDecimal;
 
@@ -17,7 +17,7 @@ public class PaperStructure {
 
     private String questionName;
 
-    private QuestionType numberType;
+    private ObjectiveType numberType;
 
     private String bigQuestionNumber;
 
@@ -49,11 +49,11 @@ public class PaperStructure {
         this.questionName = questionName;
     }
 
-    public QuestionType getNumberType() {
+    public ObjectiveType getNumberType() {
         return numberType;
     }
 
-    public void setNumberType(QuestionType numberType) {
+    public void setNumberType(ObjectiveType numberType) {
         this.numberType = numberType;
     }
 

+ 1 - 1
teachcloud-task/src/main/java/com/qmth/teachcloud/task/service/impl/PrintFinishServiceImpl.java

@@ -13,7 +13,7 @@ import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.util.ExamTaskUtil;
 import com.qmth.teachcloud.mark.bean.vo.parseCard.Struct;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
-import com.qmth.teachcloud.mark.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.entity.ScanAnswerCard;
 import com.qmth.teachcloud.mark.enums.CardSource;