Эх сурвалжийг харах

新增期末考试试卷结构导入

wangliang 1 жил өмнө
parent
commit
5e039351c7
23 өөрчлөгдсөн 993 нэмэгдсэн , 596 устгасан
  1. 6 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportCourseEvaluationSpreadDto.java
  2. 65 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/excel/PaperStructDto.java
  3. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/report/PaperStructParams.java
  4. 3 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/PaperStructDimensionResult.java
  5. 50 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TCPaperStruct.java
  6. 3 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/PrintCommonService.java
  7. 26 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TCPaperStructService.java
  8. 3 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TRBasicInfoService.java
  9. 17 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
  10. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCFinalScoreServiceImpl.java
  11. 145 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCPaperStructServiceImpl.java
  12. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCUsualScoreServiceImpl.java
  13. 15 13
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRBasicInfoServiceImpl.java
  14. 21 1
      distributed-print/install/mysql/upgrade/3.3.1.sql
  15. 1 6
      distributed-print/src/main/java/com/qmth/distributed/print/api/BasicClazzController.java
  16. 10 93
      distributed-print/src/main/java/com/qmth/distributed/print/api/TCFinalScoreController.java
  17. 156 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/TCPaperStructController.java
  18. 7 6
      distributed-print/src/main/java/com/qmth/distributed/print/api/TCUsualScoreController.java
  19. 5 4
      distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java
  20. BIN
      distributed-print/src/main/resources/temps/paperStruct.xlsx
  21. 3 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FieldUniqueEnum.java
  22. 1 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ImportTemplateEnum.java
  23. 450 441
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkPaper.java

+ 6 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportCourseEvaluationSpreadDto.java

@@ -1,6 +1,6 @@
 package com.qmth.distributed.print.business.bean.dto.report;
 
-import com.qmth.distributed.print.business.bean.result.report.PaperStructResult;
+import com.qmth.distributed.print.business.bean.result.report.PaperStructDimensionResult;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -16,7 +16,7 @@ import java.util.List;
 public class ReportCourseEvaluationSpreadDto implements Serializable {
 
     @ApiModelProperty(value = "题目信息集合")
-    private List<PaperStructResult> questionInfo;
+    private List<PaperStructDimensionResult> questionInfo;
 
     @ApiModelProperty(value = "分数图")
     private ReportScoreViewDto scoreList;
@@ -25,20 +25,20 @@ public class ReportCourseEvaluationSpreadDto implements Serializable {
 
     }
 
-    public ReportCourseEvaluationSpreadDto(List<PaperStructResult> questionInfo) {
+    public ReportCourseEvaluationSpreadDto(List<PaperStructDimensionResult> questionInfo) {
         this.questionInfo = questionInfo;
     }
 
-    public ReportCourseEvaluationSpreadDto(List<PaperStructResult> questionInfo, ReportScoreViewDto scoreList) {
+    public ReportCourseEvaluationSpreadDto(List<PaperStructDimensionResult> questionInfo, ReportScoreViewDto scoreList) {
         this.questionInfo = questionInfo;
         this.scoreList = scoreList;
     }
 
-    public List<PaperStructResult> getQuestionInfo() {
+    public List<PaperStructDimensionResult> getQuestionInfo() {
         return questionInfo;
     }
 
-    public void setQuestionInfo(List<PaperStructResult> questionInfo) {
+    public void setQuestionInfo(List<PaperStructDimensionResult> questionInfo) {
         this.questionInfo = questionInfo;
     }
 

+ 65 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/excel/PaperStructDto.java

@@ -0,0 +1,65 @@
+package com.qmth.distributed.print.business.bean.excel;
+
+import com.qmth.boot.tools.excel.annotation.ExcelColumn;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * @Description: 试卷结构dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2024/3/20
+ */
+public class PaperStructDto implements Serializable {
+
+    @ApiModelProperty(value = "大题名称")
+    @ExcelColumn(name = "*大题名称", index = 0, nullable = true)
+    private String mainTitle;
+
+    @ApiModelProperty(value = "大题号")
+    @ExcelColumn(name = "*大题号(只能用小写数字)", index = 1, nullable = true)
+    private Integer mainNumber;
+
+    @ApiModelProperty(value = "小题号")
+    @ExcelColumn(name = "*小题号(只能用小写数字)", index = 2, nullable = true)
+    private Integer subNumber;
+
+    @ApiModelProperty(value = "小题满分")
+    @ExcelColumn(name = "*小题满分", index = 3, nullable = true)
+    private Double score;
+
+    public String getMainTitle() {
+        return mainTitle;
+    }
+
+    public void setMainTitle(String mainTitle) {
+        this.mainTitle = mainTitle;
+    }
+
+    public Integer getMainNumber() {
+        return mainNumber;
+    }
+
+    public void setMainNumber(Integer mainNumber) {
+        this.mainNumber = mainNumber;
+    }
+
+    public Integer getSubNumber() {
+        return subNumber;
+    }
+
+    public void setSubNumber(Integer subNumber) {
+        this.subNumber = subNumber;
+    }
+
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+}

+ 4 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/report/PaperStructParams.java

@@ -2,7 +2,7 @@ package com.qmth.distributed.print.business.bean.params.report;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.bean.result.report.PaperStructResult;
+import com.qmth.distributed.print.business.bean.result.report.PaperStructDimensionResult;
 import io.swagger.annotations.ApiModelProperty;
 
 import javax.validation.constraints.NotEmpty;
@@ -34,7 +34,7 @@ public class PaperStructParams implements Serializable {
 
     @ApiModelProperty(value = "试卷蓝图结构")
     @NotEmpty(message = "试卷蓝图结构不能为空")
-    private List<PaperStructResult> paperStruct;
+    private List<PaperStructDimensionResult> paperStruct;
 
     public Long getExamId() {
         return examId;
@@ -60,11 +60,11 @@ public class PaperStructParams implements Serializable {
         this.paperNumber = paperNumber;
     }
 
-    public List<PaperStructResult> getPaperStruct() {
+    public List<PaperStructDimensionResult> getPaperStruct() {
         return paperStruct;
     }
 
-    public void setPaperStruct(List<PaperStructResult> paperStruct) {
+    public void setPaperStruct(List<PaperStructDimensionResult> paperStruct) {
         this.paperStruct = paperStruct;
     }
 }

+ 3 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/PaperStructResult.java → distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/PaperStructDimensionResult.java

@@ -17,7 +17,7 @@ import java.util.List;
  * @Author: wangliang
  * @Date: 2024/2/19
  */
-public class PaperStructResult implements Serializable {
+public class PaperStructDimensionResult implements Serializable {
 
     @ApiModelProperty(value = "大题号")
     @NotNull(message = "大题号不能为空")
@@ -36,11 +36,11 @@ public class PaperStructResult implements Serializable {
     @NotEmpty(message = "课程目标集合不能为空")
     private List<CourseTargetWebDto> targetList = new ArrayList<>();
 
-    public PaperStructResult() {
+    public PaperStructDimensionResult() {
 
     }
 
-    public PaperStructResult(Integer mainNumber, Integer subNumber, Double score) {
+    public PaperStructDimensionResult(Integer mainNumber, Integer subNumber, Double score) {
         this.mainNumber = mainNumber;
         this.subNumber = subNumber;
         this.score = score;

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

@@ -1,5 +1,6 @@
 package com.qmth.distributed.print.business.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.teachcloud.common.base.BaseEntity;
@@ -38,6 +39,15 @@ public class TCPaperStruct extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "试卷结构")
     private String paperStruct;
 
+    @ApiModelProperty(value = "试卷知识点结构")
+    private String paperStructDimension;
+
+    @ApiModelProperty(value = "全卷满分")
+    private Double totalScore;
+
+    @ApiModelProperty(value = "及格分")
+    private Double passScore;
+
     @ApiModelProperty(value = "是否启用,0:停用,1:启用")
     private Boolean enable;
 
@@ -49,22 +59,50 @@ public class TCPaperStruct extends BaseEntity implements Serializable {
 
     }
 
-    public TCPaperStruct(Long examId, String courseCode, String courseName, String paperNumber, String paperStruct, Long userId, Long dimensionSign) {
+    public TCPaperStruct(Long examId, String courseCode, String courseName, String paperNumber, String paperStructDimension, Long userId, Long dimensionSign) {
         insertInfo(userId);
         this.examId = examId;
         this.courseCode = courseCode;
         this.courseName = courseName;
         this.paperNumber = paperNumber;
-        this.paperStruct = paperStruct;
+        this.paperStructDimension = paperStructDimension;
         this.enable = true;
         this.dimensionSign = dimensionSign;
     }
 
+    public TCPaperStruct(Long examId, String courseCode, String courseName, String paperNumber, String paperStruct, Double totalScore, Double passScore, Long userId) {
+        insertInfo(userId);
+        this.examId = examId;
+        this.courseCode = courseCode;
+        this.courseName = courseName;
+        this.paperNumber = paperNumber;
+        this.paperStruct = paperStruct;
+        this.totalScore = totalScore;
+        this.passScore = passScore;
+        this.enable = true;
+    }
+
     public void updateInfo(String paperStruct, Long userId) {
         this.paperStruct = paperStruct;
         updateInfo(userId);
     }
 
+    public Double getTotalScore() {
+        return totalScore;
+    }
+
+    public void setTotalScore(Double totalScore) {
+        this.totalScore = totalScore;
+    }
+
+    public Double getPassScore() {
+        return passScore;
+    }
+
+    public void setPassScore(Double passScore) {
+        this.passScore = passScore;
+    }
+
     public Long getDimensionSign() {
         return dimensionSign;
     }
@@ -121,6 +159,14 @@ public class TCPaperStruct extends BaseEntity implements Serializable {
         this.enable = enable;
     }
 
+    public String getPaperStructDimension() {
+        return paperStructDimension;
+    }
+
+    public void setPaperStructDimension(String paperStructDimension) {
+        this.paperStructDimension = paperStructDimension;
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) {
@@ -130,11 +176,11 @@ public class TCPaperStruct extends BaseEntity implements Serializable {
             return false;
         }
         TCPaperStruct that = (TCPaperStruct) o;
-        return examId.equals(that.examId) && courseCode.equals(that.courseCode) && courseName.equals(that.courseName) && paperNumber.equals(that.paperNumber) && paperStruct.equals(that.paperStruct);
+        return examId.equals(that.examId) && courseCode.equals(that.courseCode) && courseName.equals(that.courseName) && paperNumber.equals(that.paperNumber) && paperStruct.equals(that.paperStruct) && paperStructDimension.equals(that.paperStructDimension) && getCreateId().equals(that.getCreateId());
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(examId, courseCode, courseName, paperNumber, paperStruct);
+        return Objects.hash(examId, courseCode, courseName, paperNumber, paperStruct, paperStructDimension, getCreateId());
     }
 }

+ 3 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/PrintCommonService.java

@@ -2,7 +2,6 @@ package com.qmth.distributed.print.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.itextpdf.text.DocumentException;
-import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.distributed.print.business.bean.dto.PdfDto;
 import com.qmth.distributed.print.business.bean.dto.PdfPackageDto;
 import com.qmth.distributed.print.business.bean.dto.PdfSignDto;
@@ -13,6 +12,7 @@ import com.qmth.distributed.print.business.entity.BasicTemplate;
 import com.qmth.distributed.print.business.entity.ExamDetail;
 import com.qmth.distributed.print.business.entity.ExamStudent;
 import com.qmth.distributed.print.business.entity.ExamTask;
+import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
 import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.SysOrg;
@@ -296,10 +296,11 @@ public interface PrintCommonService {
      *
      * @param file
      * @param examId
+     * @param courseCode
      * @param paperNumber
      * @return
      */
-    public MarkPaper scoreImportExcelVaild(MultipartFile file, Long examId, String paperNumber) throws IOException;
+    public MarkPaper scoreImportExcelVaild(MultipartFile file, Long examId, String courseCode, String paperNumber) throws IOException;
 
     /**
      * 成绩管理动态生成excel

+ 26 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TCPaperStructService.java

@@ -2,6 +2,10 @@ package com.qmth.distributed.print.business.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.distributed.print.business.entity.TCPaperStruct;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.Map;
 
 /**
  * <p>
@@ -22,4 +26,26 @@ public interface TCPaperStructService extends IService<TCPaperStruct> {
      * @return
      */
     public Boolean remove(Long examId, String courseCode, String paperNumber);
+
+    /**
+     * 导入期末成绩-试卷结构excel
+     *
+     * @param file
+     * @param examId
+     * @param courseCode
+     * @param paperNumber
+     * @return
+     * @throws IOException
+     */
+    public Map<String, String> paperStructExcelImport(MultipartFile file, Long examId, String courseCode, String paperNumber) throws IOException;
+
+    /**
+     * 根据考试id/科目编辑/试卷编码查询数据
+     *
+     * @param examId
+     * @param courseCode
+     * @param paperNumber
+     * @return
+     */
+    public TCPaperStruct queryByExamIdAndCourseCodeAndPaperNumber(Long examId, String courseCode, String paperNumber);
 }

+ 3 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TRBasicInfoService.java

@@ -7,7 +7,7 @@ import com.qmth.distributed.print.business.bean.dto.report.CourseTargetWordDto;
 import com.qmth.distributed.print.business.bean.dto.report.ReportCourseEvaluationResultDto;
 import com.qmth.distributed.print.business.bean.dto.report.ReportScoreViewDto;
 import com.qmth.distributed.print.business.bean.result.CourseWeightResult;
-import com.qmth.distributed.print.business.bean.result.report.PaperStructResult;
+import com.qmth.distributed.print.business.bean.result.report.PaperStructDimensionResult;
 import com.qmth.distributed.print.business.bean.result.report.word.CourseReportBean;
 import com.qmth.distributed.print.business.entity.TRBasicInfo;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
@@ -38,10 +38,10 @@ public interface TRBasicInfoService extends IService<TRBasicInfo> {
      * 获取计算参数
      *
      * @param trBasicInfo
-     * @param paperStructResultList
+     * @param paperStructDimensionResultList
      * @return
      */
-    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructResult> paperStructResultList);
+    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructDimensionResult> paperStructDimensionResultList);
 
     /**
      * 计算课程考核成绩评价结果

+ 17 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java

@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.itextpdf.text.pdf.PdfReader;
 import com.qmth.boot.api.exception.ApiException;
-import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.distributed.print.business.bean.dto.PdfDto;
 import com.qmth.distributed.print.business.bean.dto.PdfPackageDto;
 import com.qmth.distributed.print.business.bean.dto.PdfSignDto;
@@ -31,6 +30,7 @@ import com.qmth.teachcloud.common.bean.params.ArraysParams;
 import com.qmth.teachcloud.common.bean.result.BasicStudentResult;
 import com.qmth.teachcloud.common.bean.result.TbTaskDetailResult;
 import com.qmth.teachcloud.common.bean.vo.FilePathVo;
+import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SpringContextHolder;
 import com.qmth.teachcloud.common.contant.SystemConstant;
@@ -94,6 +94,7 @@ public class PrintCommonServiceImpl implements PrintCommonService {
     private BasicCourseMapper basicCourseMapper;
 
     @Resource
+    @Lazy
     BasicCourseService basicCourseService;
 
     @Resource
@@ -107,6 +108,7 @@ public class PrintCommonServiceImpl implements PrintCommonService {
 
     @Resource
     TBTaskService tbTaskService;
+
     @Resource
     TBTaskPdfService tbTaskPdfService;
 
@@ -151,9 +153,6 @@ public class PrintCommonServiceImpl implements PrintCommonService {
     @Resource
     BasicTeachClazzService basicTeachClazzService;
 
-    @Resource
-    BasicMajorService basicMajorService;
-
     @Resource
     CreatePrintPdfUtil createPrintPdfUtil;
 
@@ -172,6 +171,10 @@ public class PrintCommonServiceImpl implements PrintCommonService {
     @Resource
     BasicRoleDataPermissionService basicRoleDataPermissionService;
 
+    @Resource
+    @Lazy
+    TCPaperStructService tcPaperStructService;
+
     /**
      * 保存附件
      *
@@ -393,17 +396,25 @@ public class PrintCommonServiceImpl implements PrintCommonService {
      *
      * @param file
      * @param examId
+     * @param courseCode
      * @param paperNumber
      * @return
      */
     @Override
-    public MarkPaper scoreImportExcelVaild(MultipartFile file, Long examId, String paperNumber) throws IOException {
+    public MarkPaper scoreImportExcelVaild(MultipartFile file, Long examId, String courseCode, String paperNumber) throws IOException {
         String reqFileMd5 = ServletUtil.getRequestMd5();
         String fileMd5 = DigestUtils.md5Hex(file.getBytes());
         if (!Objects.equals(fileMd5, reqFileMd5)) {
             throw ExceptionResultEnum.MD5_EQUALS_FALSE.exception();
         }
-        MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
+        //优先找本地paperStruct
+        MarkPaper markPaper = null;
+        TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
+        if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStruct()) && Objects.nonNull(tcPaperStruct.getTotalScore())) {
+            markPaper = new MarkPaper(examId, courseCode, paperNumber, tcPaperStruct.getTotalScore(), tcPaperStruct.getPassScore());
+        } else {
+            markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
+        }
         Objects.requireNonNull(markPaper, "未找到科目信息");
         return markPaper;
     }

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

@@ -89,7 +89,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
         long start = System.currentTimeMillis();
         Map<String, String> messageMap = new LinkedHashMap<>();
         try {
-            MarkPaper markPaper = printCommonService.scoreImportExcelVaild(file, examId, paperNumber);
+            MarkPaper markPaper = printCommonService.scoreImportExcelVaild(file, examId, courseCode, paperNumber);
             Double totalScore = markPaper.getTotalScore();
             Objects.requireNonNull(totalScore, "试卷满分为空");
 

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

@@ -2,13 +2,33 @@ package com.qmth.distributed.print.business.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.boot.api.exception.ApiException;
+import com.qmth.boot.tools.excel.ExcelReader;
+import com.qmth.boot.tools.excel.enums.ExcelType;
+import com.qmth.distributed.print.business.bean.excel.PaperStructDto;
 import com.qmth.distributed.print.business.entity.TCPaperStruct;
 import com.qmth.distributed.print.business.mapper.TCPaperStructMapper;
+import com.qmth.distributed.print.business.service.TCFinalScoreService;
 import com.qmth.distributed.print.business.service.TCPaperStructService;
+import com.qmth.distributed.print.business.service.TRBasicInfoService;
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.common.enums.FieldUniqueEnum;
+import com.qmth.teachcloud.common.util.JacksonUtil;
+import com.qmth.teachcloud.common.util.ResultUtil;
+import com.qmth.teachcloud.common.util.ServletUtil;
+import org.apache.commons.collections4.CollectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DuplicateKeyException;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
 
 /**
  * <p>
@@ -20,10 +40,17 @@ import javax.annotation.Resource;
  */
 @Service
 public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, TCPaperStruct> implements TCPaperStructService {
+    private final static Logger log = LoggerFactory.getLogger(TCPaperStructServiceImpl.class);
 
     @Resource
     TCPaperStructService tcPaperStructService;
 
+    @Resource
+    TCFinalScoreService tcFinalScoreService;
+
+    @Resource
+    TRBasicInfoService trBasicInfoService;
+
     /**
      * 根据考试id/课程编码/试卷编码查询数据库数据
      *
@@ -35,8 +62,125 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
     @Override
     @Transactional
     public Boolean remove(Long examId, String courseCode, String paperNumber) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         return tcPaperStructService.remove(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, examId)
                 .eq(TCPaperStruct::getCourseCode, courseCode)
-                .eq(TCPaperStruct::getPaperNumber, paperNumber));
+                .eq(TCPaperStruct::getPaperNumber, paperNumber)
+                .eq(TCPaperStruct::getCreateId, sysUser.getId()));
+    }
+
+    /**
+     * 导入期末成绩-试卷结构excel
+     *
+     * @param file
+     * @param examId
+     * @param courseCode
+     * @param paperNumber
+     * @return
+     * @throws IOException
+     */
+    @Override
+    @Transactional
+    public Map<String, String> paperStructExcelImport(MultipartFile file, Long examId, String courseCode, String paperNumber) throws IOException {
+        log.debug("导入Excel开始...");
+        long start = System.currentTimeMillis();
+        Map<String, String> messageMap = new LinkedHashMap<>();
+        try {
+            StringJoiner errorData = new StringJoiner("");
+            StringJoiner successData = new StringJoiner("");
+
+            ExcelReader excelReader = ExcelReader.create(ExcelType.XLSX, file.getInputStream(), 1);
+            List<PaperStructDto> paperStructDtoList = excelReader.getObjectList(PaperStructDto.class);
+            log.info("paperStructDtoList:{}", JacksonUtil.parseJson(paperStructDtoList));
+
+            if (!CollectionUtils.isEmpty(paperStructDtoList)) {
+                SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+                String[] columnNames = excelReader.getColumnNames();
+                for (int i = 0; i < columnNames.length; i++) {
+                    if (i == 0 && Objects.nonNull(columnNames[i]) && !columnNames[i].trim().contains("大题名称")) {
+                        throw ExceptionResultEnum.ERROR.exception("excel表头第一行为大题名称");
+                    } else if (i == 1 && Objects.nonNull(columnNames[i]) && !columnNames[i].trim().contains("大题号")) {
+                        throw ExceptionResultEnum.ERROR.exception("excel表头第二行为大题号");
+                    } else if (i == 2 && Objects.nonNull(columnNames[i]) && !columnNames[i].trim().contains("小题号")) {
+                        throw ExceptionResultEnum.ERROR.exception("excel表头第三行为小题号");
+                    } else if (i == 3 && Objects.nonNull(columnNames[i]) && !columnNames[i].trim().contains("小题满分")) {
+                        throw ExceptionResultEnum.ERROR.exception("excel表头第四行为小题满分");
+                    }
+                }
+
+                Double totalScore = 0.0d;
+                List<PaperStructDto> paperStructDtoNewList = new ArrayList<>(paperStructDtoList.size());
+                for (int i = 0; i < paperStructDtoList.size(); i++) {
+                    PaperStructDto paperStructDto = paperStructDtoList.get(i);
+                    boolean error = false;
+                    if (Objects.isNull(paperStructDto.getMainTitle()) || Objects.equals(paperStructDto.getMainTitle().trim(), "")) {
+                        errorData.add("excel第").add((i + 1) + "").add("行[").add(columnNames[0] + "]为空;").add("\r\n");
+                        error = true;
+                    }
+                    if (Objects.isNull(paperStructDto.getMainNumber()) || Objects.equals(paperStructDto.getMainNumber(), "")) {
+                        errorData.add("excel第").add((i + 1) + "").add("行[").add(columnNames[1] + "]为空;").add("\r\n");
+                        error = true;
+                    }
+                    if (Objects.isNull(paperStructDto.getSubNumber()) || Objects.equals(paperStructDto.getSubNumber(), "")) {
+                        errorData.add("excel第").add((i + 1) + "").add("行[").add(columnNames[2] + "]为空;").add("\r\n");
+                        error = true;
+                    }
+                    if (Objects.isNull(paperStructDto.getScore()) || Objects.equals(paperStructDto.getScore(), "")) {
+                        errorData.add("excel第").add((i + 1) + "").add("行[").add(columnNames[3] + "]为空;").add("\r\n");
+                        error = true;
+                    }
+                    if (!error) {
+                        totalScore = totalScore + paperStructDto.getScore();
+                        paperStructDtoNewList.add(paperStructDto);
+                    }
+                }
+                if (totalScore < 100d) {
+                    throw ExceptionResultEnum.ERROR.exception("试卷满分小于100分");
+                }
+                if (!CollectionUtils.isEmpty(paperStructDtoNewList)) {
+                    successData.add("共导入").add(paperStructDtoNewList.size() + "").add("条数据");
+                    TCPaperStruct tcPaperStruct = new TCPaperStruct(examId, courseCode, null, paperNumber, JacksonUtil.parseJson(paperStructDtoNewList), totalScore, 60d, sysUser.getId());
+                    TCPaperStruct tcPaperStructDb = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
+                    if (Objects.nonNull(tcPaperStructDb) && !tcPaperStructDb.equals(tcPaperStruct)) {
+                        tcFinalScoreService.remove(examId, courseCode, paperNumber);
+                        trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
+                    }
+                    tcPaperStructService.remove(examId, courseCode, paperNumber);
+                    tcPaperStructService.save(tcPaperStruct);
+                }
+            }
+            messageMap.put(SystemConstant.SUCCESS, successData.length() > 0 ? successData.toString() : "无");
+            messageMap.put(SystemConstant.EXCEL_ERROR, errorData.length() > 0 ? errorData.toString() : "无");
+        } catch (
+                Exception e) {
+            log.error(SystemConstant.LOG_ERROR, e);
+            if (e instanceof DuplicateKeyException) {
+                String errorColumn = e.getCause().toString();
+                String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
+                throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
+            } else if (e instanceof ApiException) {
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
+            } else {
+                ResultUtil.error(e.getMessage());
+            }
+        }
+        log.debug("导入Excel结束...");
+        long end = System.currentTimeMillis();
+        log.info("============耗时{}秒============:", (end - start) / 1000);
+        return messageMap;
+    }
+
+    /**
+     * 根据考试id/科目编辑/试卷编码查询数据
+     *
+     * @param examId
+     * @param courseCode
+     * @param paperNumber
+     * @return
+     */
+    @Override
+    public TCPaperStruct queryByExamIdAndCourseCodeAndPaperNumber(Long examId, String courseCode, String paperNumber) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        return tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, examId).eq(TCPaperStruct::getCourseCode, courseCode).eq(TCPaperStruct::getPaperNumber, paperNumber).eq(TCPaperStruct::getCreateId, sysUser.getId()));
     }
 }

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

@@ -71,7 +71,7 @@ public class TCUsualScoreServiceImpl extends ServiceImpl<TCUsualScoreMapper, TCU
         long start = System.currentTimeMillis();
         Map<String, String> messageMap = new LinkedHashMap<>();
         try {
-            MarkPaper markPaper = printCommonService.scoreImportExcelVaild(file, examId, paperNumber);
+            MarkPaper markPaper = printCommonService.scoreImportExcelVaild(file, examId, courseCode, paperNumber);
             Double totalScore = markPaper.getTotalScore();
             Objects.requireNonNull(totalScore, "试卷满分为空");
 

+ 15 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRBasicInfoServiceImpl.java

@@ -13,7 +13,7 @@ import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.bean.dto.report.*;
 import com.qmth.distributed.print.business.bean.result.CourseWeightResult;
 import com.qmth.distributed.print.business.bean.result.FinalScoreResult;
-import com.qmth.distributed.print.business.bean.result.report.PaperStructResult;
+import com.qmth.distributed.print.business.bean.result.report.PaperStructDimensionResult;
 import com.qmth.distributed.print.business.bean.result.report.word.CourseReportBean;
 import com.qmth.distributed.print.business.bean.result.report.word.CourseTargetTableBean3;
 import com.qmth.distributed.print.business.bean.result.report.word.CourseTargetTableBean4;
@@ -112,11 +112,11 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
      * 获取计算参数
      *
      * @param trBasicInfo
-     * @param paperStructResultList
+     * @param paperStructDimensionResultList
      * @return
      */
     @Override
-    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructResult> paperStructResultList) {
+    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructDimensionResult> paperStructDimensionResultList) {
         Map<String, Object> paramsMap = new HashMap<>();
         //查询考生数据
         List<FinalScoreResult> finalScoreResultList = tcFinalScoreService.examStudentOverview(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), trBasicInfo.getPaperNumber());//考生成绩
@@ -129,7 +129,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
 
         List<ReportExamStudentDto> examStudentList = null;//考生集合
         Map<String, FinalScoreResult> finalScoreResultMap = null;//考生成绩map
-        Map<String, PaperStructResult> paperStructResultMap = null;//试卷蓝图map
+        Map<String, PaperStructDimensionResult> paperStructResultMap = null;//试卷蓝图map
         Map<Long, CourseTargetWordDto> targetWordMap = null;//word目标集合
         Map<Long, CourseTargetWebDto> targetWebMap = null;//web目标集合
         Map<String, ReportEvaluationDto> usualScoreMap = null;//平时作业集合
@@ -185,7 +185,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
             }
 
             //期末成绩明细map
-            paperStructResultMap = paperStructResultList.stream().collect(Collectors.toMap(k -> k.getMainNumber() + "-" + k.getSubNumber(), Function.identity(), (dto1, dto2) -> dto1));
+            paperStructResultMap = paperStructDimensionResultList.stream().collect(Collectors.toMap(k -> k.getMainNumber() + "-" + k.getSubNumber(), Function.identity(), (dto1, dto2) -> dto1));
             finalScoreResultMap = finalScoreResultList.stream().collect(Collectors.toMap(FinalScoreResult::getStudentCode, Function.identity(), (dto1, dto2) -> dto1));
 
             examStudentList = new ArrayList<>(finalScoreResultList.size());
@@ -196,9 +196,9 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 }.getType());
                 for (TCFinalScoreDto t : tcFinalScoreDtoList) {
                     Double score = Objects.nonNull(t.getScore()) ? Double.parseDouble(t.getScore().toString()) : 0d;
-                    PaperStructResult paperStructResult = paperStructResultMap.get(t.getName().toString());
-                    if (Objects.nonNull(paperStructResult)) {
-                        List<CourseTargetWebDto> courseTargetDtoList = paperStructResult.getTargetList();
+                    PaperStructDimensionResult paperStructDimensionResult = paperStructResultMap.get(t.getName().toString());
+                    if (Objects.nonNull(paperStructDimensionResult)) {
+                        List<CourseTargetWebDto> courseTargetDtoList = paperStructDimensionResult.getTargetList();
                         for (CourseTargetWebDto courseTargetDto : courseTargetDtoList) {
                             //知识点-期末考试明细分
                             List<DimensionDto> dimensionDtoList = courseTargetDto.getDimensionList();
@@ -207,7 +207,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                                 this.calculateFinalScoreByExamStudent(finalScoreExamStudentDimensionMap,
                                         finalScoreResult, courseTargetDto, dimensionDto, score);
                                 if (i == 0) {//计算各知识点原始卷面分总和
-                                    Double paperScore = paperStructResult.getScore();
+                                    Double paperScore = paperStructDimensionResult.getScore();
                                     //目标-考生知识点去重
                                     if (!targetDimensionMap.containsKey(courseTargetDto.getTargetId())) {
                                         Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
@@ -365,18 +365,18 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
         TCPaperStruct tcPaperStruct = tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, markPaper.getExamId()).eq(TCPaperStruct::getCourseCode, markPaper.getCourseCode()).eq(TCPaperStruct::getPaperNumber, markPaper.getPaperNumber()));
         Objects.requireNonNull(tcPaperStruct, "未找到试卷蓝图信息");
 
-        List<PaperStructResult> paperStructResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStruct(), new TypeToken<List<PaperStructResult>>() {
+        List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStruct(), new TypeToken<List<PaperStructDimensionResult>>() {
         }.getType());
 
         //课程目标考核分布
-        ReportCourseEvaluationSpreadDto reportCourseEvaluationSpreadDto = new ReportCourseEvaluationSpreadDto(paperStructResultList);
+        ReportCourseEvaluationSpreadDto reportCourseEvaluationSpreadDto = new ReportCourseEvaluationSpreadDto(paperStructDimensionResultList);
         if (Objects.nonNull(reportCourseEvaluationSpreadDto)) {
             reportCourseEvaluationSpreadDto.setScoreList(trBasicInfoService.getScoreList(trBasicInfo, markPaper));
             trBasicInfo.setCourseEvaluationSpread(JacksonUtil.parseJson(reportCourseEvaluationSpreadDto));
             trBasicInfo.getReportResult().setCourseEvaluationSpreadInfo(reportCourseEvaluationSpreadDto);
         }
 
-        Map<String, Object> paramsMap = trBasicInfoService.getReportCalculateParams(trBasicInfo, paperStructResultList);
+        Map<String, Object> paramsMap = trBasicInfoService.getReportCalculateParams(trBasicInfo, paperStructDimensionResultList);
 
         //课程目标达成评价明细结果-考生集合
         List<ReportExamStudentDto> examStudentNewList = trExamStudentService.getExamStudentReportDetail(trBasicInfo, paramsMap);
@@ -776,9 +776,11 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
     @Override
     @Transactional
     public Boolean remove(Long examId, String courseCode, String paperNumber) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         return trBasicInfoService.remove(new QueryWrapper<TRBasicInfo>().lambda().eq(TRBasicInfo::getExamId, examId)
                 .eq(TRBasicInfo::getCourseCode, courseCode)
-                .eq(TRBasicInfo::getPaperNumber, paperNumber));
+                .eq(TRBasicInfo::getPaperNumber, paperNumber)
+                .eq(TRBasicInfo::getCreateId, sysUser.getId()));
     }
 
     /**

+ 21 - 1
distributed-print/install/mysql/upgrade/3.3.1.sql

@@ -627,4 +627,24 @@ VALUES(2031, '报告数据发生变化', '/api/admin/course/degree/report/change
 UPDATE `sys_privilege` SET `enable` = '0', `front_display` = '0' WHERE (`id` = '515');
 UPDATE `sys_privilege` SET `enable` = '0', `front_display` = '0' WHERE (`id` = '450');
 UPDATE `sys_privilege` SET `enable` = '0', `front_display` = '0' WHERE (`id` = '358');
-update `sys_privilege` set enable = 0, front_display = 0 where parent_id in (358, 450, 515);
+update `sys_privilege` set enable = 0, front_display = 0 where parent_id in (358, 450, 515);
+
+-- 2014/03/20
+ALTER TABLE t_c_paper_struct CHANGE paper_struct paper_struct_dimension mediumtext NULL COMMENT '试卷知识点结构';
+ALTER TABLE t_c_paper_struct MODIFY COLUMN paper_struct_dimension mediumtext NULL COMMENT '试卷知识点结构';
+ALTER TABLE t_c_paper_struct ADD paper_struct MEDIUMTEXT NULL COMMENT '试卷结构';
+ALTER TABLE t_c_paper_struct CHANGE paper_struct paper_struct MEDIUMTEXT NULL COMMENT '试卷结构' AFTER paper_number;
+ALTER TABLE t_c_paper_struct ADD total_score DOUBLE NULL COMMENT '全卷满分';
+ALTER TABLE t_c_paper_struct CHANGE total_score total_score DOUBLE NULL COMMENT '全卷满分' AFTER paper_struct_dimension;
+ALTER TABLE t_c_paper_struct ADD pass_score DOUBLE NULL COMMENT '及格分';
+ALTER TABLE t_c_paper_struct CHANGE pass_score pass_score DOUBLE NULL COMMENT '及格分' AFTER total_score;
+
+ALTER TABLE t_c_paper_struct MODIFY COLUMN course_name varchar(100) NULL COMMENT '课程名称';
+ALTER TABLE t_c_paper_struct ADD CONSTRAINT t_c_paper_struct_unique UNIQUE KEY (exam_id,course_code,paper_number,create_id);
+
+UPDATE sys_privilege
+SET name='管理成绩', url='Score', `type`='LINK', parent_id=2001, `sequence`=1, property='AUTH', related='2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2029,2030,2031,2032', enable=1, default_auth=0, front_display=1
+WHERE id=2006;
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(2032, '试卷结构-导入模版', '/api/admin/course/degree/final_score/paper_struct/import', 'URL', 2006, 1, 'AUTH', NULL, 1, 1, 1);

+ 1 - 6
distributed-print/src/main/java/com/qmth/distributed/print/api/BasicClazzController.java

@@ -2,8 +2,6 @@ package com.qmth.distributed.print.api;
 
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.distributed.print.business.bean.result.EditResult;
-import com.qmth.distributed.print.business.service.PrintCommonService;
-import com.qmth.distributed.print.business.templete.execute.AsyncBasicClazzImportService;
 import com.qmth.teachcloud.common.annotation.OperationLogDetail;
 import com.qmth.teachcloud.common.bean.params.BasicClazzParams;
 import com.qmth.teachcloud.common.contant.SystemConstant;
@@ -36,12 +34,9 @@ import java.util.stream.Collectors;
 @Validated
 //@Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
 public class BasicClazzController {
+
     @Resource
     private BasicClazzService basicClazzService;
-    @Resource
-    private PrintCommonService printCommonService;
-    @Resource
-    private AsyncBasicClazzImportService asyncBasicClazzImportService;
 
     @ApiOperation(value = "班级基本信息管理-查询")
     @RequestMapping(value = "/query", method = RequestMethod.POST)

+ 10 - 93
distributed-print/src/main/java/com/qmth/distributed/print/api/TCFinalScoreController.java

@@ -1,17 +1,11 @@
 package com.qmth.distributed.print.api;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.google.gson.reflect.TypeToken;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.bean.excel.ExcelField;
-import com.qmth.distributed.print.business.bean.params.report.PaperStructParams;
-import com.qmth.distributed.print.business.bean.result.CourseWeightResult;
 import com.qmth.distributed.print.business.bean.result.EditResult;
-import com.qmth.distributed.print.business.bean.result.report.PaperStructResult;
 import com.qmth.distributed.print.business.entity.TCFinalScore;
-import com.qmth.distributed.print.business.entity.TCPaperStruct;
 import com.qmth.distributed.print.business.service.PrintCommonService;
 import com.qmth.distributed.print.business.service.TCFinalScoreService;
 import com.qmth.distributed.print.business.service.TCPaperStructService;
@@ -22,8 +16,10 @@ 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.log.CustomizedOperationTypeEnum;
-import com.qmth.teachcloud.common.util.*;
-import com.qmth.teachcloud.mark.entity.MarkPaper;
+import com.qmth.teachcloud.common.util.RedisUtil;
+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.mark.service.MarkPaperService;
 import com.qmth.teachcloud.mark.service.MarkQuestionService;
 import io.swagger.annotations.*;
@@ -66,12 +62,6 @@ public class TCFinalScoreController {
     @Resource
     MarkQuestionService markQuestionService;
 
-    @Resource
-    TCPaperStructService tcPaperStructService;
-
-    @Resource
-    MarkPaperService markPaperService;
-
     @Resource
     RedisUtil redisUtil;
 
@@ -107,7 +97,7 @@ public class TCFinalScoreController {
     @RequestMapping(value = "/final_score/import", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.IMPORT)
     @ApiResponses({@ApiResponse(code = 200, message = "导入成功", response = EditResult.class)})
-    public Object finalScoreImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
+    public Result finalScoreImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
                                    @ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                    @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                    @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
@@ -136,7 +126,7 @@ public class TCFinalScoreController {
     @RequestMapping(value = "/final_score/sync", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "同步成功", response = EditResult.class)})
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
-    public Object finalScoreSync(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+    public Result finalScoreSync(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                  @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                  @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
         String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + examId + "_" + courseCode + "_" + paperNumber;
@@ -164,7 +154,7 @@ public class TCFinalScoreController {
     @RequestMapping(value = "/final_score/list", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = TCFinalScore.class)})
-    public Object finalScoreList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+    public Result finalScoreList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                  @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                  @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
                                  @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
@@ -176,7 +166,7 @@ public class TCFinalScoreController {
     @RequestMapping(value = "/final_score/edit", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EDIT)
     @ApiResponses({@ApiResponse(code = 200, message = "编辑", response = TCFinalScore.class)})
-    public Object finalScoreEdit(@ApiParam(value = "主键", required = true) @RequestParam Long id) throws IOException {
+    public Result finalScoreEdit(@ApiParam(value = "主键", required = true) @RequestParam Long id) throws IOException {
         TCFinalScore tcFinalScore = tcFinalScoreService.getById(id);
         Objects.requireNonNull(tcFinalScore, "未找到期末成绩信息");
         return ResultUtil.ok(tcFinalScoreService.getById(id));
@@ -187,7 +177,7 @@ public class TCFinalScoreController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     @ApiResponses({@ApiResponse(code = 200, message = "保存", response = EditResult.class)})
     @Transactional
-    public Object finalScoreSave(@ApiParam(value = "期末考试成绩信息", required = true) @Valid @RequestBody TCFinalScore tcFinalScore, BindingResult bindingResult) throws IOException {
+    public Result finalScoreSave(@ApiParam(value = "期末考试成绩信息", required = true) @Valid @RequestBody TCFinalScore tcFinalScore, BindingResult bindingResult) throws IOException {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
@@ -211,7 +201,7 @@ public class TCFinalScoreController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     @ApiResponses({@ApiResponse(code = 200, message = "编辑", response = EditResult.class)})
     @Transactional
-    public Object finalScoreEnable(@ApiParam(value = "主键", required = true) @RequestParam Long id,
+    public Result finalScoreEnable(@ApiParam(value = "主键", required = true) @RequestParam Long id,
                                    @ApiParam(value = "启用/禁用", required = true) @RequestParam Boolean enable) throws IOException {
         TCFinalScore tcFinalScoreDb = tcFinalScoreService.getById(id);
         Objects.requireNonNull(tcFinalScoreDb, "未找到期末成绩信息");
@@ -227,77 +217,4 @@ public class TCFinalScoreController {
         }
         return ResultUtil.ok(true);
     }
-
-    @ApiOperation(value = "期末成绩试卷蓝图保存")
-    @RequestMapping(value = "/final_score/paper_struct/save", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
-    @ApiResponses({@ApiResponse(code = 200, message = "试卷蓝图保存", response = Object.class)})
-    @Transactional
-    public Object finalScorePaperStructSave(@ApiParam(value = "试卷蓝图结构", required = true) @Valid @RequestBody PaperStructParams paperStructParams, BindingResult bindingResult) throws IOException {
-        if (bindingResult.hasErrors()) {
-            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
-        }
-        for (PaperStructResult paperStructResult : paperStructParams.getPaperStruct()) {
-            Objects.requireNonNull(paperStructResult.getMainNumber(), "大题号为空");
-            Objects.requireNonNull(paperStructResult.getSubNumber(), "小题号为空");
-            if (!CollectionUtils.isEmpty(paperStructResult.getTargetList()) && paperStructResult.getTargetList().size() > 1) {
-                throw ExceptionResultEnum.ERROR.exception("一个题只能属于一个目标");
-            }
-        }
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        TCPaperStruct tcPaperStructDb = tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, paperStructParams.getExamId()).eq(TCPaperStruct::getCourseCode, paperStructParams.getCourseCode()).eq(TCPaperStruct::getPaperNumber, paperStructParams.getPaperNumber()));
-        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(paperStructParams.getExamId(), paperStructParams.getCourseCode());
-        if (Objects.isNull(tcPaperStructDb)) {
-            MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(paperStructParams.getExamId(), paperStructParams.getPaperNumber());
-            Objects.requireNonNull(markPaper, "未找到科目信息");
-
-            tcPaperStructDb = new TCPaperStruct(paperStructParams.getExamId(), paperStructParams.getCourseCode(), markPaper.getCourseName(), paperStructParams.getPaperNumber(), JacksonUtil.parseJson(paperStructParams.getPaperStruct()), sysUser.getId(), courseWeightResult.getDimensionSign());
-            tcPaperStructService.save(tcPaperStructDb);
-        } else {
-            TCPaperStruct tcPaperStructSource = new TCPaperStruct();
-            BeanUtils.copyProperties(tcPaperStructDb, tcPaperStructSource);
-            tcPaperStructDb.updateInfo(JacksonUtil.parseJson(paperStructParams.getPaperStruct()), sysUser.getId());
-            if (!tcPaperStructDb.equals(tcPaperStructSource)) {
-                if (Objects.nonNull(tcPaperStructDb.getDimensionSign()) && tcPaperStructDb.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue()) {
-                    trBasicInfoService.clearReportData(tcPaperStructDb.getExamId(), tcPaperStructDb.getCourseCode(), tcPaperStructDb.getPaperNumber(), true);
-                }
-                tcPaperStructDb.setDimensionSign(courseWeightResult.getDimensionSign());
-                tcPaperStructService.updateById(tcPaperStructDb);
-            }
-        }
-        return ResultUtil.ok(true);
-    }
-
-    @ApiOperation(value = "期末成绩试卷蓝图查询")
-    @RequestMapping(value = "/final_score/paper_struct/query", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
-    @ApiResponses({@ApiResponse(code = 200, message = "试卷蓝图保存", response = PaperStructResult.class)})
-    public Object finalScorePaperStructQuery(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
-                                             @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                                             @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
-        List<PaperStructResult> paperStructResultList = null;
-        TCPaperStruct tcPaperStruct = tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, examId).eq(TCPaperStruct::getCourseCode, courseCode).eq(TCPaperStruct::getPaperNumber, paperNumber));
-        if (Objects.isNull(tcPaperStruct)) {
-            List<MarkQuestion> markQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null);
-            if (CollectionUtils.isEmpty(markQuestionList)) {
-                throw ExceptionResultEnum.ERROR.exception("未找到试卷结构");
-            }
-            paperStructResultList = new ArrayList<>(markQuestionList.size());
-            for (MarkQuestion markQuestion : markQuestionList) {
-                paperStructResultList.add(new PaperStructResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), markQuestion.getTotalScore()));
-            }
-        } else {
-            CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
-            if (Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue()) {
-                trBasicInfoService.clearReportData(examId, courseCode, paperNumber, true);
-                return this.finalScorePaperStructQuery(examId, courseCode, paperNumber);
-            } else {
-                if (Objects.nonNull(tcPaperStruct.getPaperStruct())) {
-                    paperStructResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStruct(), new TypeToken<List<PaperStructResult>>() {
-                    }.getType());
-                }
-            }
-        }
-        return ResultUtil.ok(paperStructResultList);
-    }
 }

+ 156 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/TCPaperStructController.java

@@ -0,0 +1,156 @@
+package com.qmth.distributed.print.api;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.gson.reflect.TypeToken;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.distributed.print.business.bean.params.report.PaperStructParams;
+import com.qmth.distributed.print.business.bean.result.CourseWeightResult;
+import com.qmth.distributed.print.business.bean.result.EditResult;
+import com.qmth.distributed.print.business.bean.result.report.PaperStructDimensionResult;
+import com.qmth.distributed.print.business.entity.TCPaperStruct;
+import com.qmth.distributed.print.business.service.TCFinalScoreService;
+import com.qmth.distributed.print.business.service.TCPaperStructService;
+import com.qmth.distributed.print.business.service.TRBasicInfoService;
+import com.qmth.teachcloud.common.annotation.OperationLogDetail;
+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.log.CustomizedOperationTypeEnum;
+import com.qmth.teachcloud.common.util.*;
+import com.qmth.teachcloud.mark.entity.MarkPaper;
+import com.qmth.teachcloud.mark.service.MarkPaperService;
+import com.qmth.teachcloud.mark.service.MarkQuestionService;
+import io.swagger.annotations.*;
+import org.apache.commons.collections4.CollectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 试卷结构 前端控制器
+ * </p>
+ *
+ * @author wangliang
+ * @since 2024-02-18
+ */
+@Api(tags = "课程目标达成度-成绩管理-试卷结构Controller")
+@RestController
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_COURSE_DEGREE)
+public class TCPaperStructController {
+    private final static Logger log = LoggerFactory.getLogger(TCPaperStructController.class);
+
+    @Resource
+    TCFinalScoreService tcFinalScoreService;
+
+    @Resource
+    MarkQuestionService markQuestionService;
+
+    @Resource
+    TCPaperStructService tcPaperStructService;
+
+    @Resource
+    MarkPaperService markPaperService;
+
+    @Resource
+    RedisUtil redisUtil;
+
+    @Resource
+    TRBasicInfoService trBasicInfoService;
+
+    @ApiOperation(value = "导入试卷结构")
+    @RequestMapping(value = "/final_score/paper_struct/import", method = RequestMethod.POST)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.IMPORT)
+    @ApiResponses({@ApiResponse(code = 200, message = "导入成功", response = EditResult.class)})
+    public Result finalScorePaperStructImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
+                                              @ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+                                              @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
+                                              @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
+        return ResultUtil.ok(tcPaperStructService.paperStructExcelImport(file, examId, courseCode, paperNumber));
+    }
+
+    @ApiOperation(value = "期末成绩试卷蓝图保存")
+    @RequestMapping(value = "/final_score/paper_struct/save", method = RequestMethod.POST)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
+    @ApiResponses({@ApiResponse(code = 200, message = "试卷蓝图保存", response = Object.class)})
+    @Transactional
+    public Result finalScorePaperStructSave(@ApiParam(value = "试卷蓝图结构", required = true) @Valid @RequestBody PaperStructParams paperStructParams, BindingResult bindingResult) throws IOException {
+        if (bindingResult.hasErrors()) {
+            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+        }
+        for (PaperStructDimensionResult paperStructDimensionResult : paperStructParams.getPaperStruct()) {
+            Objects.requireNonNull(paperStructDimensionResult.getMainNumber(), "大题号为空");
+            Objects.requireNonNull(paperStructDimensionResult.getSubNumber(), "小题号为空");
+            if (!CollectionUtils.isEmpty(paperStructDimensionResult.getTargetList()) && paperStructDimensionResult.getTargetList().size() > 1) {
+                throw ExceptionResultEnum.ERROR.exception("一个题只能属于一个目标");
+            }
+        }
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        TCPaperStruct tcPaperStructDb = tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, paperStructParams.getExamId()).eq(TCPaperStruct::getCourseCode, paperStructParams.getCourseCode()).eq(TCPaperStruct::getPaperNumber, paperStructParams.getPaperNumber()));
+        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(paperStructParams.getExamId(), paperStructParams.getCourseCode());
+        if (Objects.isNull(tcPaperStructDb)) {
+            MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(paperStructParams.getExamId(), paperStructParams.getPaperNumber());
+            Objects.requireNonNull(markPaper, "未找到科目信息");
+
+            tcPaperStructDb = new TCPaperStruct(paperStructParams.getExamId(), paperStructParams.getCourseCode(), markPaper.getCourseName(), paperStructParams.getPaperNumber(), JacksonUtil.parseJson(paperStructParams.getPaperStruct()), sysUser.getId(), courseWeightResult.getDimensionSign());
+            tcPaperStructService.save(tcPaperStructDb);
+        } else {
+            TCPaperStruct tcPaperStructSource = new TCPaperStruct();
+            BeanUtils.copyProperties(tcPaperStructDb, tcPaperStructSource);
+            tcPaperStructDb.updateInfo(JacksonUtil.parseJson(paperStructParams.getPaperStruct()), sysUser.getId());
+            if (!tcPaperStructDb.equals(tcPaperStructSource)) {
+                if (Objects.nonNull(tcPaperStructDb.getDimensionSign()) && tcPaperStructDb.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue()) {
+                    trBasicInfoService.clearReportData(tcPaperStructDb.getExamId(), tcPaperStructDb.getCourseCode(), tcPaperStructDb.getPaperNumber(), true);
+                }
+                tcPaperStructDb.setDimensionSign(courseWeightResult.getDimensionSign());
+                tcPaperStructService.updateById(tcPaperStructDb);
+            }
+        }
+        return ResultUtil.ok(true);
+    }
+
+    @ApiOperation(value = "期末成绩试卷蓝图查询")
+    @RequestMapping(value = "/final_score/paper_struct/query", method = RequestMethod.POST)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
+    @ApiResponses({@ApiResponse(code = 200, message = "试卷蓝图保存", response = PaperStructDimensionResult.class)})
+    public Result finalScorePaperStructQuery(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+                                             @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
+                                             @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
+        List<PaperStructDimensionResult> paperStructDimensionResultList = null;
+        TCPaperStruct tcPaperStruct = tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, examId).eq(TCPaperStruct::getCourseCode, courseCode).eq(TCPaperStruct::getPaperNumber, paperNumber));
+        if (Objects.isNull(tcPaperStruct)) {
+            List<MarkQuestion> markQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null);
+            if (CollectionUtils.isEmpty(markQuestionList)) {
+                throw ExceptionResultEnum.ERROR.exception("未找到试卷结构");
+            }
+            paperStructDimensionResultList = new ArrayList<>(markQuestionList.size());
+            for (MarkQuestion markQuestion : markQuestionList) {
+                paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), markQuestion.getTotalScore()));
+            }
+        } else {
+            CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
+            if (Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue()) {
+                trBasicInfoService.clearReportData(examId, courseCode, paperNumber, true);
+                return this.finalScorePaperStructQuery(examId, courseCode, paperNumber);
+            } else {
+                if (Objects.nonNull(tcPaperStruct.getPaperStruct())) {
+                    paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStruct(), new TypeToken<List<PaperStructDimensionResult>>() {
+                    }.getType());
+                }
+            }
+        }
+        return ResultUtil.ok(paperStructDimensionResultList);
+    }
+}

+ 7 - 6
distributed-print/src/main/java/com/qmth/distributed/print/api/TCUsualScoreController.java

@@ -16,6 +16,7 @@ import com.qmth.teachcloud.common.annotation.OperationLogDetail;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.SysUser;
 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 io.swagger.annotations.*;
@@ -65,7 +66,7 @@ public class TCUsualScoreController {
     @RequestMapping(value = "/score/list", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ScoreResult.class)})
-    public Object scoreList(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
+    public Result scoreList(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
                             @ApiParam(value = "课程编码") @RequestParam(required = false) String courseCode,
                             @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                             @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
@@ -102,7 +103,7 @@ public class TCUsualScoreController {
     @RequestMapping(value = "/usual_score/import", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.IMPORT)
     @ApiResponses({@ApiResponse(code = 200, message = "导入成功", response = EditResult.class)})
-    public Object usualScoreImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
+    public Result usualScoreImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
                                    @ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                    @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                    @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
@@ -113,7 +114,7 @@ public class TCUsualScoreController {
     @RequestMapping(value = "/usual_score/list", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = TCUsualScore.class)})
-    public Object usualScoreList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+    public Result usualScoreList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                  @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                  @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
                                  @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
@@ -125,7 +126,7 @@ public class TCUsualScoreController {
     @RequestMapping(value = "/usual_score/edit", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EDIT)
     @ApiResponses({@ApiResponse(code = 200, message = "编辑", response = TCUsualScore.class)})
-    public Object usualScoreEdit(@ApiParam(value = "主键", required = true) @RequestParam Long id) throws IOException {
+    public Result usualScoreEdit(@ApiParam(value = "主键", required = true) @RequestParam Long id) throws IOException {
         TCUsualScore tcUsualScore = tcUsualScoreService.getById(id);
         Objects.requireNonNull(tcUsualScore, "未找到平时成绩信息");
         return ResultUtil.ok(tcUsualScore);
@@ -136,7 +137,7 @@ public class TCUsualScoreController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     @ApiResponses({@ApiResponse(code = 200, message = "保存", response = EditResult.class)})
     @Transactional
-    public Object usualScoreSave(@ApiParam(value = "平时成绩信息", required = true) @Valid @RequestBody TCUsualScore tcUsualScore, BindingResult bindingResult) throws IOException {
+    public Result usualScoreSave(@ApiParam(value = "平时成绩信息", required = true) @Valid @RequestBody TCUsualScore tcUsualScore, BindingResult bindingResult) throws IOException {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
@@ -160,7 +161,7 @@ public class TCUsualScoreController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     @ApiResponses({@ApiResponse(code = 200, message = "编辑", response = EditResult.class)})
     @Transactional
-    public Object usualScoreEnable(@ApiParam(value = "主键", required = true) @RequestParam Long id,
+    public Result usualScoreEnable(@ApiParam(value = "主键", required = true) @RequestParam Long id,
                                    @ApiParam(value = "启用/禁用", required = true) @RequestParam Boolean enable) throws IOException {
         TCUsualScore tcUsualScoreDb = tcUsualScoreService.getById(id);
         Objects.requireNonNull(tcUsualScoreDb, "未找到平时成绩信息");

+ 5 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java

@@ -35,6 +35,7 @@ import com.qmth.teachcloud.common.enums.log.CustomizedOperationTypeEnum;
 import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.service.FileUploadService;
 import com.qmth.teachcloud.common.util.FileUtil;
+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.mark.entity.MarkPaper;
@@ -98,7 +99,7 @@ public class TRBasicInfoController {
     @RequestMapping(value = "/report/list", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ScoreResult.class)})
-    public Object reportList(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
+    public Result reportList(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
                              @ApiParam(value = "课程编码") @RequestParam(required = false) String courseCode,
                              @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                              @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
@@ -110,7 +111,7 @@ public class TRBasicInfoController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "查看报告", response = ReportResult.class)})
     @Transactional
-    public Object reportView(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+    public Result reportView(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                              @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                              @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) {
         MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
@@ -154,7 +155,7 @@ public class TRBasicInfoController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     @ApiResponses({@ApiResponse(code = 200, message = "保存报告", response = Object.class)})
     @Transactional
-    public Object reportSave(@ApiParam(value = "保存报告结构", required = true) @Valid @RequestBody TRBasicInfo trBasicInfo, BindingResult bindingResult) {
+    public Result reportSave(@ApiParam(value = "保存报告结构", required = true) @Valid @RequestBody TRBasicInfo trBasicInfo, BindingResult bindingResult) {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
@@ -274,7 +275,7 @@ public class TRBasicInfoController {
     @ApiOperation(value = "报告发生改变")
     @RequestMapping(value = "/report/change", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
-    public Object reportDataChange(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+    public Result reportDataChange(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                    @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                    @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
         ReportChangeResult reportChangeResult = new ReportChangeResult();

BIN
distributed-print/src/main/resources/temps/paperStruct.xlsx


+ 3 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FieldUniqueEnum.java

@@ -41,7 +41,9 @@ public enum FieldUniqueEnum {
 
     t_c_score_normal_unique("考生"),
 
-    t_c_score_end_exam_unique("考生");
+    t_c_score_end_exam_unique("考生"),
+
+    t_c_paper_struct_unique("试卷结构");
 
     private String title;
 

+ 1 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ImportTemplateEnum.java

@@ -19,6 +19,7 @@ public enum ImportTemplateEnum {
     TEMPLATE_BASIC_EXAM_STUDENT("basicExamStudent.xlsx", "考生字典导入模板.xlsx"),
     TEMPLATE_COURSE_DIMENSION("courseDimension.xlsx", "课程知识点导入模板.xlsx"),
     TEMPLATE_MARK_STUDENT("markStudent.xlsx","阅卷数据导入模板.xlsx"),
+    TEMPLATE_PAPER_STRUCT("paperStruct.xlsx", "试卷结构导入模板.xlsx"),
 
     STATIC_COURSE_DEGREE_REPORT("course_degree_report.docx", "课程目标达成度");
 

+ 450 - 441
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkPaper.java

@@ -1,441 +1,450 @@
-package com.qmth.teachcloud.mark.entity;
-
-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.contant.SystemConstant;
-import com.qmth.teachcloud.common.enums.mark.MarkMode;
-import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 考试科目表
- * </p>
- *
- * @author xf
- * @since 2023-09-22
- */
-@TableName("mark_paper")
-@ApiModel(value = "MarkPaper对象", description = "考试科目表")
-public class MarkPaper implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @JsonSerialize(using = ToStringSerializer.class)
-    @ApiModelProperty(value = "ID")
-    @TableId(value = "id")
-    private Long id;
-
-    @JsonSerialize(using = ToStringSerializer.class)
-    @ApiModelProperty(value = "考试ID")
-    private Long examId;
-
-    @ApiModelProperty(value = "课程代码")
-    private String courseCode;
-
-    @ApiModelProperty(value = "科目名称")
-    private String courseName;
-
-    @ApiModelProperty(value = "试卷编号(显示)")
-    private String paperNumber;
-
-    @ApiModelProperty(value = "试卷编号(交互)")
-    private String coursePaperId;
-
-    @ApiModelProperty(value = "客观题满分")
-    private Double objectiveScore;
-
-    @ApiModelProperty(value = "主观题满分")
-    private Double subjectiveScore;
-
-    @ApiModelProperty(value = "全卷满分")
-    private Double totalScore;
-
-    @ApiModelProperty(value = "考生人数")
-    private Integer studentCount;
-
-    @ApiModelProperty(value = "已上传人数")
-    private Integer uploadCount;
-
-    @ApiModelProperty(value = "缺考人数")
-    private Integer absentCount;
-
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    @ApiModelProperty(value = "原图遮盖配置")
-    private String sheetConfig;
-
-    @ApiModelProperty(value = "及格分")
-    private Double passScore;
-
-    @ApiModelProperty(value = "优秀分")
-    private Double excellentScore;
-
-    @ApiModelProperty(value = "题卡类型")
-    private String cardType;
-
-    @ApiModelProperty(value = "试卷文件类型")
-    private String paperFilePath;
-
-    @ApiModelProperty(value = "标答文件类型")
-    private String answerFilePath;
-
-    @ApiModelProperty(value = "评卷是否跳转")
-    private Boolean autoScroll;
-
-    @ApiModelProperty(value = "评卷模式")
-    private MarkMode markMode;
-
-    @ApiModelProperty(value = "强制评卷模式")
-    private Boolean forceMode;
-
-    @ApiModelProperty(value = "评卷开始时间")
-    private Long markStartTime;
-
-    @ApiModelProperty(value = "评卷结束时间")
-    private Long markEndTime;
-
-    @ApiModelProperty(value = "是否原卷显示")
-    private Boolean sheetView;
-
-    @ApiModelProperty(value = "评卷是否显示客观分")
-    private Boolean showObjectScore;
-    @ApiModelProperty(value = "评卷分组是否提交")
-    private Boolean groupStatus;
-
-    @ApiModelProperty(value = "是否开启分班阅")
-    private Boolean openMarkClass;
-
-    @ApiModelProperty(value = "是否开启双评")
-    private Boolean openDoubleMarking;
-
-    private MarkPaperStatus status;
-    @ApiModelProperty(value = "命题老师ID")
-    private Long userId;
-
-    @ApiModelProperty(value = "试卷类型")
-    private String paperType;
-
-    public MarkPaper() {
-    }
-
-    public MarkPaper(Long examId, String courseCode, String courseName, String paperNumber, String coursePaperId, Long userId, String paperType) {
-        this.id = SystemConstant.getDbUuid();
-        this.examId = examId;
-        this.courseCode = courseCode;
-        this.courseName = courseName;
-        this.paperNumber = paperNumber;
-        this.coursePaperId = coursePaperId;
-        this.userId = userId;
-        this.paperType = paperType;
-        this.markMode = MarkMode.TRACK;
-        this.objectiveScore = 0D;
-        this.subjectiveScore = 0D;
-        this.totalScore = 0D;
-        this.studentCount = 0;
-        this.uploadCount = 0;
-        this.absentCount = 0;
-        this.groupStatus = false;
-        this.openMarkClass = false;
-        this.openDoubleMarking = false;
-        this.status = MarkPaperStatus.FORMAL;
-        this.passScore = 60D;
-        this.excellentScore = 80D;
-        this.forceMode = true;
-        this.showObjectScore = false;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getExamId() {
-        return examId;
-    }
-
-    public void setExamId(Long examId) {
-        this.examId = examId;
-    }
-
-    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 getPaperNumber() {
-        return paperNumber;
-    }
-
-    public void setPaperNumber(String paperNumber) {
-        this.paperNumber = paperNumber;
-    }
-
-    public String getCoursePaperId() {
-        return coursePaperId;
-    }
-
-    public void setCoursePaperId(String coursePaperId) {
-        this.coursePaperId = coursePaperId;
-    }
-
-    public Double getObjectiveScore() {
-        return objectiveScore;
-    }
-
-    public void setObjectiveScore(Double objectiveScore) {
-        this.objectiveScore = objectiveScore;
-    }
-
-    public Double getSubjectiveScore() {
-        return subjectiveScore;
-    }
-
-    public void setSubjectiveScore(Double subjectiveScore) {
-        this.subjectiveScore = subjectiveScore;
-    }
-
-    public Double getTotalScore() {
-        return totalScore;
-    }
-
-    public void setTotalScore(Double totalScore) {
-        this.totalScore = totalScore;
-    }
-
-    public Integer getStudentCount() {
-        return studentCount;
-    }
-
-    public void setStudentCount(Integer studentCount) {
-        this.studentCount = studentCount;
-    }
-
-    public Integer getUploadCount() {
-        return uploadCount;
-    }
-
-    public void setUploadCount(Integer uploadCount) {
-        this.uploadCount = uploadCount;
-    }
-
-    public Integer getAbsentCount() {
-        return absentCount;
-    }
-
-    public void setAbsentCount(Integer absentCount) {
-        this.absentCount = absentCount;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public String getSheetConfig() {
-        return sheetConfig;
-    }
-
-    public void setSheetConfig(String sheetConfig) {
-        this.sheetConfig = sheetConfig;
-    }
-
-    public Double getPassScore() {
-        return passScore;
-    }
-
-    public void setPassScore(Double passScore) {
-        this.passScore = passScore;
-    }
-
-    public Double getExcellentScore() {
-        return excellentScore;
-    }
-
-    public void setExcellentScore(Double excellentScore) {
-        this.excellentScore = excellentScore;
-    }
-
-    public String getCardType() {
-        return cardType;
-    }
-
-    public void setCardType(String cardType) {
-        this.cardType = cardType;
-    }
-
-    public String getPaperFilePath() {
-        return paperFilePath;
-    }
-
-    public void setPaperFilePath(String paperFilePath) {
-        this.paperFilePath = paperFilePath;
-    }
-
-    public String getAnswerFilePath() {
-        return answerFilePath;
-    }
-
-    public void setAnswerFilePath(String answerFilePath) {
-        this.answerFilePath = answerFilePath;
-    }
-
-    public Boolean getAutoScroll() {
-        return autoScroll;
-    }
-
-    public void setAutoScroll(Boolean autoScroll) {
-        this.autoScroll = autoScroll;
-    }
-
-    public MarkMode getMarkMode() {
-        return markMode;
-    }
-
-    public void setMarkMode(MarkMode markMode) {
-        this.markMode = markMode;
-    }
-
-    public Boolean getForceMode() {
-        return forceMode;
-    }
-
-    public void setForceMode(Boolean forceMode) {
-        this.forceMode = forceMode;
-    }
-
-    public Long getMarkStartTime() {
-        return markStartTime;
-    }
-
-    public void setMarkStartTime(Long markStartTime) {
-        this.markStartTime = markStartTime;
-    }
-
-    public Long getMarkEndTime() {
-        return markEndTime;
-    }
-
-    public void setMarkEndTime(Long markEndTime) {
-        this.markEndTime = markEndTime;
-    }
-
-    public Boolean getSheetView() {
-        return sheetView;
-    }
-
-    public void setSheetView(Boolean sheetView) {
-        this.sheetView = sheetView;
-    }
-
-    public Boolean getShowObjectScore() {
-        return showObjectScore;
-    }
-
-    public void setShowObjectScore(Boolean showObjectScore) {
-        this.showObjectScore = showObjectScore;
-    }
-
-    public Boolean getGroupStatus() {
-        return groupStatus;
-    }
-
-    public void setGroupStatus(Boolean groupStatus) {
-        this.groupStatus = groupStatus;
-    }
-
-    public Boolean getOpenMarkClass() {
-        return openMarkClass;
-    }
-
-    public void setOpenMarkClass(Boolean openMarkClass) {
-        this.openMarkClass = openMarkClass;
-    }
-
-    public Boolean getOpenDoubleMarking() {
-        return openDoubleMarking;
-    }
-
-    public void setOpenDoubleMarking(Boolean openDoubleMarking) {
-        this.openDoubleMarking = openDoubleMarking;
-    }
-
-    public MarkPaperStatus getStatus() {
-        return status;
-    }
-
-    public void setStatus(MarkPaperStatus status) {
-        this.status = status;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    public String getPaperType() {
-        return paperType;
-    }
-
-    public void setPaperType(String paperType) {
-        this.paperType = paperType;
-    }
-
-    @Override
-    public String toString() {
-        return "MarkPaper{" +
-                "examId=" + examId +
-                ", courseCode=" + courseCode +
-                ", courseName=" + courseName +
-                ", paperNumber=" + paperNumber +
-                ", objectiveScore=" + objectiveScore +
-                ", subjectiveScore=" + subjectiveScore +
-                ", totalScore=" + totalScore +
-                ", studentCount=" + studentCount +
-                ", uploadCount=" + uploadCount +
-                ", absentCount=" + absentCount +
-                ", remark=" + remark +
-                ", sheetConfig=" + sheetConfig +
-                ", passScore=" + passScore +
-                ", excellentScore=" + excellentScore +
-                ", cardType=" + cardType +
-                ", paperFilePath=" + paperFilePath +
-                ", answerFilePath=" + answerFilePath +
-                ", autoScroll=" + autoScroll +
-                ", markMode=" + markMode +
-                ", markStartTime=" + markStartTime +
-                ", markEndTime=" + markEndTime +
-                ", sheetView=" + sheetView +
-                ", showObjectScore=" + showObjectScore +
-                ", groupStatus=" + groupStatus +
-                ", openMarkClass=" + openMarkClass +
-                ", status=" + status +
-                "}";
-    }
-}
+package com.qmth.teachcloud.mark.entity;
+
+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.contant.SystemConstant;
+import com.qmth.teachcloud.common.enums.mark.MarkMode;
+import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 考试科目表
+ * </p>
+ *
+ * @author xf
+ * @since 2023-09-22
+ */
+@TableName("mark_paper")
+@ApiModel(value = "MarkPaper对象", description = "考试科目表")
+public class MarkPaper implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "ID")
+    @TableId(value = "id")
+    private Long id;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "考试ID")
+    private Long examId;
+
+    @ApiModelProperty(value = "课程代码")
+    private String courseCode;
+
+    @ApiModelProperty(value = "科目名称")
+    private String courseName;
+
+    @ApiModelProperty(value = "试卷编号(显示)")
+    private String paperNumber;
+
+    @ApiModelProperty(value = "试卷编号(交互)")
+    private String coursePaperId;
+
+    @ApiModelProperty(value = "客观题满分")
+    private Double objectiveScore;
+
+    @ApiModelProperty(value = "主观题满分")
+    private Double subjectiveScore;
+
+    @ApiModelProperty(value = "全卷满分")
+    private Double totalScore;
+
+    @ApiModelProperty(value = "考生人数")
+    private Integer studentCount;
+
+    @ApiModelProperty(value = "已上传人数")
+    private Integer uploadCount;
+
+    @ApiModelProperty(value = "缺考人数")
+    private Integer absentCount;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "原图遮盖配置")
+    private String sheetConfig;
+
+    @ApiModelProperty(value = "及格分")
+    private Double passScore;
+
+    @ApiModelProperty(value = "优秀分")
+    private Double excellentScore;
+
+    @ApiModelProperty(value = "题卡类型")
+    private String cardType;
+
+    @ApiModelProperty(value = "试卷文件类型")
+    private String paperFilePath;
+
+    @ApiModelProperty(value = "标答文件类型")
+    private String answerFilePath;
+
+    @ApiModelProperty(value = "评卷是否跳转")
+    private Boolean autoScroll;
+
+    @ApiModelProperty(value = "评卷模式")
+    private MarkMode markMode;
+
+    @ApiModelProperty(value = "强制评卷模式")
+    private Boolean forceMode;
+
+    @ApiModelProperty(value = "评卷开始时间")
+    private Long markStartTime;
+
+    @ApiModelProperty(value = "评卷结束时间")
+    private Long markEndTime;
+
+    @ApiModelProperty(value = "是否原卷显示")
+    private Boolean sheetView;
+
+    @ApiModelProperty(value = "评卷是否显示客观分")
+    private Boolean showObjectScore;
+    @ApiModelProperty(value = "评卷分组是否提交")
+    private Boolean groupStatus;
+
+    @ApiModelProperty(value = "是否开启分班阅")
+    private Boolean openMarkClass;
+
+    @ApiModelProperty(value = "是否开启双评")
+    private Boolean openDoubleMarking;
+
+    private MarkPaperStatus status;
+    @ApiModelProperty(value = "命题老师ID")
+    private Long userId;
+
+    @ApiModelProperty(value = "试卷类型")
+    private String paperType;
+
+    public MarkPaper() {
+    }
+
+    public MarkPaper(Long examId, String courseCode, String courseName, String paperNumber, String coursePaperId, Long userId, String paperType) {
+        this.id = SystemConstant.getDbUuid();
+        this.examId = examId;
+        this.courseCode = courseCode;
+        this.courseName = courseName;
+        this.paperNumber = paperNumber;
+        this.coursePaperId = coursePaperId;
+        this.userId = userId;
+        this.paperType = paperType;
+        this.markMode = MarkMode.TRACK;
+        this.objectiveScore = 0D;
+        this.subjectiveScore = 0D;
+        this.totalScore = 0D;
+        this.studentCount = 0;
+        this.uploadCount = 0;
+        this.absentCount = 0;
+        this.groupStatus = false;
+        this.openMarkClass = false;
+        this.openDoubleMarking = false;
+        this.status = MarkPaperStatus.FORMAL;
+        this.passScore = 60D;
+        this.excellentScore = 80D;
+        this.forceMode = true;
+        this.showObjectScore = false;
+    }
+
+    public MarkPaper(Long examId, String courseCode, String paperNumber, Double totalScore, Double passScore) {
+        this.examId = examId;
+        this.courseCode = courseCode;
+        this.paperNumber = paperNumber;
+        this.totalScore = totalScore;
+        this.passScore = passScore;
+        this.excellentScore = 80d;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    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 getPaperNumber() {
+        return paperNumber;
+    }
+
+    public void setPaperNumber(String paperNumber) {
+        this.paperNumber = paperNumber;
+    }
+
+    public String getCoursePaperId() {
+        return coursePaperId;
+    }
+
+    public void setCoursePaperId(String coursePaperId) {
+        this.coursePaperId = coursePaperId;
+    }
+
+    public Double getObjectiveScore() {
+        return objectiveScore;
+    }
+
+    public void setObjectiveScore(Double objectiveScore) {
+        this.objectiveScore = objectiveScore;
+    }
+
+    public Double getSubjectiveScore() {
+        return subjectiveScore;
+    }
+
+    public void setSubjectiveScore(Double subjectiveScore) {
+        this.subjectiveScore = subjectiveScore;
+    }
+
+    public Double getTotalScore() {
+        return totalScore;
+    }
+
+    public void setTotalScore(Double totalScore) {
+        this.totalScore = totalScore;
+    }
+
+    public Integer getStudentCount() {
+        return studentCount;
+    }
+
+    public void setStudentCount(Integer studentCount) {
+        this.studentCount = studentCount;
+    }
+
+    public Integer getUploadCount() {
+        return uploadCount;
+    }
+
+    public void setUploadCount(Integer uploadCount) {
+        this.uploadCount = uploadCount;
+    }
+
+    public Integer getAbsentCount() {
+        return absentCount;
+    }
+
+    public void setAbsentCount(Integer absentCount) {
+        this.absentCount = absentCount;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getSheetConfig() {
+        return sheetConfig;
+    }
+
+    public void setSheetConfig(String sheetConfig) {
+        this.sheetConfig = sheetConfig;
+    }
+
+    public Double getPassScore() {
+        return passScore;
+    }
+
+    public void setPassScore(Double passScore) {
+        this.passScore = passScore;
+    }
+
+    public Double getExcellentScore() {
+        return excellentScore;
+    }
+
+    public void setExcellentScore(Double excellentScore) {
+        this.excellentScore = excellentScore;
+    }
+
+    public String getCardType() {
+        return cardType;
+    }
+
+    public void setCardType(String cardType) {
+        this.cardType = cardType;
+    }
+
+    public String getPaperFilePath() {
+        return paperFilePath;
+    }
+
+    public void setPaperFilePath(String paperFilePath) {
+        this.paperFilePath = paperFilePath;
+    }
+
+    public String getAnswerFilePath() {
+        return answerFilePath;
+    }
+
+    public void setAnswerFilePath(String answerFilePath) {
+        this.answerFilePath = answerFilePath;
+    }
+
+    public Boolean getAutoScroll() {
+        return autoScroll;
+    }
+
+    public void setAutoScroll(Boolean autoScroll) {
+        this.autoScroll = autoScroll;
+    }
+
+    public MarkMode getMarkMode() {
+        return markMode;
+    }
+
+    public void setMarkMode(MarkMode markMode) {
+        this.markMode = markMode;
+    }
+
+    public Boolean getForceMode() {
+        return forceMode;
+    }
+
+    public void setForceMode(Boolean forceMode) {
+        this.forceMode = forceMode;
+    }
+
+    public Long getMarkStartTime() {
+        return markStartTime;
+    }
+
+    public void setMarkStartTime(Long markStartTime) {
+        this.markStartTime = markStartTime;
+    }
+
+    public Long getMarkEndTime() {
+        return markEndTime;
+    }
+
+    public void setMarkEndTime(Long markEndTime) {
+        this.markEndTime = markEndTime;
+    }
+
+    public Boolean getSheetView() {
+        return sheetView;
+    }
+
+    public void setSheetView(Boolean sheetView) {
+        this.sheetView = sheetView;
+    }
+
+    public Boolean getShowObjectScore() {
+        return showObjectScore;
+    }
+
+    public void setShowObjectScore(Boolean showObjectScore) {
+        this.showObjectScore = showObjectScore;
+    }
+
+    public Boolean getGroupStatus() {
+        return groupStatus;
+    }
+
+    public void setGroupStatus(Boolean groupStatus) {
+        this.groupStatus = groupStatus;
+    }
+
+    public Boolean getOpenMarkClass() {
+        return openMarkClass;
+    }
+
+    public void setOpenMarkClass(Boolean openMarkClass) {
+        this.openMarkClass = openMarkClass;
+    }
+
+    public Boolean getOpenDoubleMarking() {
+        return openDoubleMarking;
+    }
+
+    public void setOpenDoubleMarking(Boolean openDoubleMarking) {
+        this.openDoubleMarking = openDoubleMarking;
+    }
+
+    public MarkPaperStatus getStatus() {
+        return status;
+    }
+
+    public void setStatus(MarkPaperStatus status) {
+        this.status = status;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(String paperType) {
+        this.paperType = paperType;
+    }
+
+    @Override
+    public String toString() {
+        return "MarkPaper{" +
+                "examId=" + examId +
+                ", courseCode=" + courseCode +
+                ", courseName=" + courseName +
+                ", paperNumber=" + paperNumber +
+                ", objectiveScore=" + objectiveScore +
+                ", subjectiveScore=" + subjectiveScore +
+                ", totalScore=" + totalScore +
+                ", studentCount=" + studentCount +
+                ", uploadCount=" + uploadCount +
+                ", absentCount=" + absentCount +
+                ", remark=" + remark +
+                ", sheetConfig=" + sheetConfig +
+                ", passScore=" + passScore +
+                ", excellentScore=" + excellentScore +
+                ", cardType=" + cardType +
+                ", paperFilePath=" + paperFilePath +
+                ", answerFilePath=" + answerFilePath +
+                ", autoScroll=" + autoScroll +
+                ", markMode=" + markMode +
+                ", markStartTime=" + markStartTime +
+                ", markEndTime=" + markEndTime +
+                ", sheetView=" + sheetView +
+                ", showObjectScore=" + showObjectScore +
+                ", groupStatus=" + groupStatus +
+                ", openMarkClass=" + openMarkClass +
+                ", status=" + status +
+                "}";
+    }
+}