Ver Fonte

最终报告修改

wangliang há 1 ano atrás
pai
commit
ecc27cb364

+ 1 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportCourseEvaluationResultDto.java

@@ -21,10 +21,6 @@ public class ReportCourseEvaluationResultDto implements Serializable {
     @ApiModelProperty(value = "权重变化id")
     private Long weightSettingSign;
 
-    @JsonSerialize(using = ToStringSerializer.class)
-    @ApiModelProperty("知识点变化id")
-    private Long dimensionSign;
-
     @ApiModelProperty(value = "课程目标总达成评价值")
     private BigDecimal targetEvaluationSumValue;
 
@@ -35,19 +31,10 @@ public class ReportCourseEvaluationResultDto implements Serializable {
 
     }
 
-    public ReportCourseEvaluationResultDto(BigDecimal targetEvaluationSumValue, List<CourseTargetWebDto> targetList, Long weightSettingSign, Long dimensionSign) {
+    public ReportCourseEvaluationResultDto(BigDecimal targetEvaluationSumValue, List<CourseTargetWebDto> targetList, Long weightSettingSign) {
         this.targetEvaluationSumValue = targetEvaluationSumValue;
         this.targetList = targetList;
         this.weightSettingSign = weightSettingSign;
-        this.dimensionSign = dimensionSign;
-    }
-
-    public Long getDimensionSign() {
-        return dimensionSign;
-    }
-
-    public void setDimensionSign(Long dimensionSign) {
-        this.dimensionSign = dimensionSign;
     }
 
     public BigDecimal getTargetEvaluationSumValue() {

+ 5 - 74
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TCFinalScore.java

@@ -3,7 +3,7 @@ package com.qmth.distributed.print.business.entity;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.distributed.print.business.enums.SourceEnum;
-import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.mark.bean.archivescore.MarkStudentScoreVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -21,15 +21,10 @@ import java.util.Objects;
  * @since 2024-02-18
  */
 @ApiModel(value = "TCFinalScore对象", description = "期末考试成绩表")
-public class TCFinalScore implements Serializable {
+public class TCFinalScore extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    @ApiModelProperty(value = "主键")
-    @JsonSerialize(using = ToStringSerializer.class)
-    @NotNull(message = "id不能为空")
-    private Long id;
-
     @ApiModelProperty(value = "考试id")
     @JsonSerialize(using = ToStringSerializer.class)
     private Long examId;
@@ -64,38 +59,22 @@ public class TCFinalScore implements Serializable {
     @ApiModelProperty(value = "来源,EXCEL_IMPORT:excel导入,SYNC:数据同步")
     private SourceEnum source;
 
-    @ApiModelProperty(value = "创建人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long createId;
-
-    @ApiModelProperty(value = "创建时间")
-    private Long createTime;
-
-    @ApiModelProperty(value = "更新人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long updateId;
-
-    @ApiModelProperty(value = "更新时间")
-    private Long updateTime;
-
     public TCFinalScore() {
 
     }
 
     public TCFinalScore(Long examId, String courseCode, String courseName, String paperNumber, SourceEnum source, Long userId) {
-        this.id = SystemConstant.getDbUuid();
+        insertInfo(userId);
         this.examId = examId;
         this.courseCode = courseCode;
         this.courseName = courseName;
         this.paperNumber = paperNumber;
         this.source = source;
         this.enable = true;
-        this.createId = userId;
-        this.createTime = System.currentTimeMillis();
     }
 
     public TCFinalScore(MarkStudentScoreVo markStudentScoreVo, String scoreDetail, SourceEnum source, Long userId) {
-        this.id = SystemConstant.getDbUuid();
+        insertInfo(userId);
         this.examId = markStudentScoreVo.getExamId();
         this.courseCode = markStudentScoreVo.getCourseCode();
         this.courseName = markStudentScoreVo.getCourseName();
@@ -106,21 +85,13 @@ public class TCFinalScore implements Serializable {
         this.scoreDetail = scoreDetail;
         this.source = source;
         this.enable = true;
-        this.createId = userId;
-        this.createTime = System.currentTimeMillis();
     }
 
     public void updateInfo(TCFinalScore tcFinalScore, Long userId) {
         this.name = tcFinalScore.getName();
         this.score = tcFinalScore.getScore();
         this.scoreDetail = tcFinalScore.getScoreDetail();
-        this.updateId = userId;
-        this.updateTime = System.currentTimeMillis();
-    }
-
-    public void updateInfo(Long userId) {
-        this.updateId = userId;
-        this.updateTime = System.currentTimeMillis();
+        updateInfo(userId);
     }
 
     public SourceEnum getSource() {
@@ -131,14 +102,6 @@ public class TCFinalScore implements Serializable {
         this.source = source;
     }
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
     public Long getExamId() {
         return examId;
     }
@@ -211,38 +174,6 @@ public class TCFinalScore implements Serializable {
         this.enable = enable;
     }
 
-    public Long getCreateId() {
-        return createId;
-    }
-
-    public void setCreateId(Long createId) {
-        this.createId = createId;
-    }
-
-    public Long getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Long createTime) {
-        this.createTime = createTime;
-    }
-
-    public Long getUpdateId() {
-        return updateId;
-    }
-
-    public void setUpdateId(Long updateId) {
-        this.updateId = updateId;
-    }
-
-    public Long getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Long updateTime) {
-        this.updateTime = updateTime;
-    }
-
     @Override
     public boolean equals(Object o) {
         if (this == o) {

+ 12 - 60
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TCPaperStruct.java

@@ -2,7 +2,7 @@ package com.qmth.distributed.print.business.entity;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.base.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -18,14 +18,10 @@ import java.util.Objects;
  * @since 2024-02-18
  */
 @ApiModel(value = "TCPaperStruct对象", description = "试卷蓝图表")
-public class TCPaperStruct implements Serializable {
+public class TCPaperStruct extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    @ApiModelProperty(value = "主键")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long id;
-
     @ApiModelProperty(value = "考试id")
     @JsonSerialize(using = ToStringSerializer.class)
     private Long examId;
@@ -45,48 +41,36 @@ public class TCPaperStruct implements Serializable {
     @ApiModelProperty(value = "是否启用,0:停用,1:启用")
     private Boolean enable;
 
-    @ApiModelProperty(value = "创建人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long createId;
-
-    @ApiModelProperty(value = "创建时间")
-    private Long createTime;
-
-    @ApiModelProperty(value = "更新人id")
     @JsonSerialize(using = ToStringSerializer.class)
-    private Long updateId;
-
-    @ApiModelProperty(value = "更新时间")
-    private Long updateTime;
+    @ApiModelProperty(value = "权重变化id")
+    private Long dimensionSign;
 
     public TCPaperStruct() {
 
     }
 
-    public TCPaperStruct(Long examId, String courseCode, String courseName, String paperNumber, String paperStruct, Long userId) {
-        this.id = SystemConstant.getDbUuid();
+    public TCPaperStruct(Long examId, String courseCode, String courseName, String paperNumber, String paperStruct, Long userId, Long dimensionSign) {
+        insertInfo(userId);
         this.examId = examId;
         this.courseCode = courseCode;
         this.courseName = courseName;
         this.paperNumber = paperNumber;
         this.paperStruct = paperStruct;
         this.enable = true;
-        this.createId = userId;
-        this.createTime = System.currentTimeMillis();
+        this.dimensionSign = dimensionSign;
     }
 
     public void updateInfo(String paperStruct, Long userId) {
         this.paperStruct = paperStruct;
-        this.updateId = userId;
-        this.updateTime = System.currentTimeMillis();
+        updateInfo(userId);
     }
 
-    public Long getId() {
-        return id;
+    public Long getDimensionSign() {
+        return dimensionSign;
     }
 
-    public void setId(Long id) {
-        this.id = id;
+    public void setDimensionSign(Long dimensionSign) {
+        this.dimensionSign = dimensionSign;
     }
 
     public Long getExamId() {
@@ -137,38 +121,6 @@ public class TCPaperStruct implements Serializable {
         this.enable = enable;
     }
 
-    public Long getCreateId() {
-        return createId;
-    }
-
-    public void setCreateId(Long createId) {
-        this.createId = createId;
-    }
-
-    public Long getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Long createTime) {
-        this.createTime = createTime;
-    }
-
-    public Long getUpdateId() {
-        return updateId;
-    }
-
-    public void setUpdateId(Long updateId) {
-        this.updateId = updateId;
-    }
-
-    public Long getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Long updateTime) {
-        this.updateTime = updateTime;
-    }
-
     @Override
     public boolean equals(Object o) {
         if (this == o) {

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

@@ -2,7 +2,7 @@ package com.qmth.distributed.print.business.entity;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.base.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -19,15 +19,10 @@ import java.util.Objects;
  * @since 2024-02-18
  */
 @ApiModel(value = "TCUsualScore对象", description = "平常作业成绩表")
-public class TCUsualScore implements Serializable {
+public class TCUsualScore extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    @ApiModelProperty(value = "主键")
-    @JsonSerialize(using = ToStringSerializer.class)
-    @NotNull(message = "id不能为空")
-    private Long id;
-
     @ApiModelProperty(value = "考试id")
     @JsonSerialize(using = ToStringSerializer.class)
     private Long examId;
@@ -55,54 +50,23 @@ public class TCUsualScore implements Serializable {
     @ApiModelProperty(value = "是否启用,0:停用,1:启用")
     private Boolean enable;
 
-    @ApiModelProperty(value = "创建人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long createId;
-
-    @ApiModelProperty(value = "创建时间")
-    private Long createTime;
-
-    @ApiModelProperty(value = "更新人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long updateId;
-
-    @ApiModelProperty(value = "更新时间")
-    private Long updateTime;
-
     public TCUsualScore() {
 
     }
 
     public TCUsualScore(Long examId, String courseCode, String courseName, String paperNumber, Long userId) {
-        this.id = SystemConstant.getDbUuid();
+        insertInfo(userId);
         this.examId = examId;
         this.courseCode = courseCode;
         this.courseName = courseName;
         this.paperNumber = paperNumber;
         this.enable = true;
-        this.createId = userId;
-        this.createTime = System.currentTimeMillis();
     }
 
     public void updateInfo(TCUsualScore tcUsualScore, Long userId) {
+        updateInfo(userId);
         this.name = tcUsualScore.getName();
         this.score = tcUsualScore.getScore();
-        this.updateId = userId;
-        this.updateTime = System.currentTimeMillis();
-    }
-
-    public void updateInfo(Long userId) {
-        this.updateId = userId;
-        this.updateTime = System.currentTimeMillis();
-    }
-
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
     }
 
     public Long getExamId() {
@@ -169,38 +133,6 @@ public class TCUsualScore implements Serializable {
         this.enable = enable;
     }
 
-    public Long getCreateId() {
-        return createId;
-    }
-
-    public void setCreateId(Long createId) {
-        this.createId = createId;
-    }
-
-    public Long getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Long createTime) {
-        this.createTime = createTime;
-    }
-
-    public Long getUpdateId() {
-        return updateId;
-    }
-
-    public void setUpdateId(Long updateId) {
-        this.updateId = updateId;
-    }
-
-    public Long getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Long updateTime) {
-        this.updateTime = updateTime;
-    }
-
     @Override
     public boolean equals(Object o) {
         if (this == o) {

+ 5 - 73
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TRBasicInfo.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.distributed.print.business.bean.result.report.ReportResult;
-import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.base.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -20,14 +20,10 @@ import java.io.Serializable;
  * @since 2024-02-18
  */
 @ApiModel(value = "TRBasicInfo对象", description = "报告基本情况表")
-public class TRBasicInfo implements Serializable {
+public class TRBasicInfo extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    @ApiModelProperty(value = "主键")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long id;
-
     @ApiModelProperty(value = "考试id")
     @JsonSerialize(using = ToStringSerializer.class)
     @NotNull(message = "考试id不能为空")
@@ -84,20 +80,6 @@ public class TRBasicInfo implements Serializable {
     @ApiModelProperty(value = "是否启用,0:停用,1:启用")
     private Boolean enable;
 
-    @ApiModelProperty(value = "创建人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long createId;
-
-    @ApiModelProperty(value = "创建时间")
-    private Long createTime;
-
-    @ApiModelProperty(value = "更新人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long updateId;
-
-    @ApiModelProperty(value = "更新时间")
-    private Long updateTime;
-
     @ApiModelProperty(value = "课程目标考核分布")
     private String courseEvaluationSpread;
 
@@ -116,7 +98,7 @@ public class TRBasicInfo implements Serializable {
     }
 
     public TRBasicInfo(Long examId, String courseCode, String courseName, String paperNumber, String openTime, String teachingObject, String teacher, Integer participantCount, Long userId) {
-        this.id = SystemConstant.getDbUuid();
+        insertInfo(userId);
         this.examId = examId;
         this.courseCode = courseCode;
         this.courseName = courseName;
@@ -126,28 +108,18 @@ public class TRBasicInfo implements Serializable {
         this.teacher = teacher;
         this.participantCount = participantCount;
         this.enable = true;
-        this.createId = userId;
-        this.createTime = System.currentTimeMillis();
         this.reportResult = new ReportResult();
     }
 
     public TRBasicInfo(TRBasicInfo trBasicInfo, Long userId) {
-        this.id = SystemConstant.getDbUuid();
+        insertInfo(userId);
         this.setValue(trBasicInfo);
         this.enable = true;
-        this.createId = userId;
-        this.createTime = System.currentTimeMillis();
     }
 
     public void updateInfo(TRBasicInfo trBasicInfo, Long userId) {
         this.setValue(trBasicInfo);
-        this.updateId = userId;
-        this.updateTime = System.currentTimeMillis();
-    }
-
-    public void updateInfo(Long userId) {
-        this.updateId = userId;
-        this.updateTime = System.currentTimeMillis();
+        updateInfo(userId);
     }
 
     protected void setValue(TRBasicInfo trBasicInfo) {
@@ -209,14 +181,6 @@ public class TRBasicInfo implements Serializable {
         this.period = period;
     }
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
     public Long getExamId() {
         return examId;
     }
@@ -337,38 +301,6 @@ public class TRBasicInfo implements Serializable {
         this.enable = enable;
     }
 
-    public Long getCreateId() {
-        return createId;
-    }
-
-    public void setCreateId(Long createId) {
-        this.createId = createId;
-    }
-
-    public Long getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Long createTime) {
-        this.createTime = createTime;
-    }
-
-    public Long getUpdateId() {
-        return updateId;
-    }
-
-    public void setUpdateId(Long updateId) {
-        this.updateId = updateId;
-    }
-
-    public Long getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Long updateTime) {
-        this.updateTime = updateTime;
-    }
-
     public String getCourseEvaluationSpread() {
         return courseEvaluationSpread;
     }

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

@@ -314,7 +314,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                         courseTargetWordDto.setEvaluationValue(targetEvaluationValue);
                     }
                 }
-                reportCourseEvaluationResultDto = new ReportCourseEvaluationResultDto(targetEvaluationSumValue, new ArrayList<>(targetWebMap.values()), (Long) paramsMap.get("weightSettingSign"), (Long) paramsMap.get("dimensionSign"));
+                reportCourseEvaluationResultDto = new ReportCourseEvaluationResultDto(targetEvaluationSumValue, new ArrayList<>(targetWebMap.values()), (Long) paramsMap.get("weightSettingSign"));
             }
             paramsMap.put("targetWebMap", targetWebMap);
         }

+ 3 - 0
distributed-print/install/mysql/upgrade/3.3.1.sql

@@ -610,3 +610,6 @@ ALTER TABLE `teach_course`
 
 ALTER TABLE `teach_course`
     ADD COLUMN `dimension_sign` BIGINT NULL COMMENT '知识点标识' AFTER `weight_setting_sign`;
+
+ALTER TABLE t_c_paper_struct ADD dimension_sign BIGINT NULL COMMENT '知识点变化id';
+ALTER TABLE t_c_paper_struct CHANGE dimension_sign dimension_sign BIGINT NULL COMMENT '知识点变化id' AFTER enable;

+ 19 - 21
distributed-print/src/main/java/com/qmth/distributed/print/api/TCFinalScoreController.java

@@ -1,12 +1,10 @@
 package com.qmth.distributed.print.api;
 
-import com.alibaba.fastjson.JSONObject;
 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.dto.report.ReportCourseEvaluationResultDto;
 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;
@@ -14,8 +12,10 @@ 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.entity.TRBasicInfo;
-import com.qmth.distributed.print.business.service.*;
+import com.qmth.distributed.print.business.service.PrintCommonService;
+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;
@@ -78,9 +78,6 @@ public class TCFinalScoreController {
     @Resource
     TRBasicInfoService trBasicInfoService;
 
-    @Resource
-    TRExamStudentService trExamStudentService;
-
     @ApiOperation(value = "导入期末成绩-模板下载")
     @RequestMapping(value = "/final_score/template_download", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EXPORT)
@@ -253,18 +250,22 @@ public class TCFinalScoreController {
         }
         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());
+            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)) {
-                trBasicInfoService.clearReportData(paperStructParams.getExamId(), paperStructParams.getCourseCode(), paperStructParams.getPaperNumber(), false);
+                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);
             }
         }
@@ -278,15 +279,6 @@ public class TCFinalScoreController {
     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 {
-        TRBasicInfo trBasicInfo = trBasicInfoService.getOne(new QueryWrapper<TRBasicInfo>().lambda().eq(TRBasicInfo::getExamId, examId).eq(TRBasicInfo::getCourseCode, courseCode).eq(TRBasicInfo::getPaperNumber, paperNumber));
-        if (Objects.nonNull(trBasicInfo)) {
-            ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class);
-            CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
-            if (Objects.nonNull(reportCourseEvaluationResultDto.getDimensionSign()) && reportCourseEvaluationResultDto.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue()) {
-                trBasicInfoService.clearReportData(examId, courseCode, paperNumber, true);
-            }
-        }
-
         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)) {
@@ -299,9 +291,15 @@ public class TCFinalScoreController {
                 paperStructResultList.add(new PaperStructResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), markQuestion.getTotalScore()));
             }
         } else {
-            if (Objects.nonNull(tcPaperStruct.getPaperStruct())) {
-                paperStructResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStruct(), new TypeToken<List<PaperStructResult>>() {
-                }.getType());
+            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);

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

@@ -14,9 +14,11 @@ import com.qmth.distributed.print.business.bean.result.ScoreResult;
 import com.qmth.distributed.print.business.bean.result.report.ReportResult;
 import com.qmth.distributed.print.business.bean.result.report.word.CourseBasicBean;
 import com.qmth.distributed.print.business.bean.result.report.word.CourseReportBean;
+import com.qmth.distributed.print.business.entity.TCPaperStruct;
 import com.qmth.distributed.print.business.entity.TRBasicInfo;
 import com.qmth.distributed.print.business.entity.TRExamStudent;
 import com.qmth.distributed.print.business.service.PrintCommonService;
+import com.qmth.distributed.print.business.service.TCPaperStructService;
 import com.qmth.distributed.print.business.service.TRBasicInfoService;
 import com.qmth.distributed.print.business.service.TRExamStudentService;
 import com.qmth.teachcloud.common.annotation.OperationLogDetail;
@@ -82,6 +84,9 @@ public class TRBasicInfoController {
     @Resource
     FileUploadService fileUploadService;
 
+    @Resource
+    TCPaperStructService tcPaperStructService;
+
     @ApiOperation(value = "报告管理列表")
     @RequestMapping(value = "/report/list", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
@@ -113,7 +118,8 @@ public class TRBasicInfoController {
             CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
             ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = Objects.nonNull(trBasicInfo.getCourseEvaluationResult()) ? JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class) : null;
             if (Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign()) && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != courseWeightResult.getWeightSettingSign().longValue()) {
-                trBasicInfoService.clearReportData(examId, courseCode, paperNumber, Objects.nonNull(reportCourseEvaluationResultDto.getDimensionSign()) && reportCourseEvaluationResultDto.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue() ? true : false);
+                TCPaperStruct tcPaperStruct = tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, examId).eq(TCPaperStruct::getCourseCode, courseCode).eq(TCPaperStruct::getPaperNumber, paperNumber));
+                trBasicInfoService.clearReportData(examId, courseCode, paperNumber, Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue() ? true : false);
                 trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId());
             } else {
                 ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
@@ -169,7 +175,6 @@ public class TRBasicInfoController {
                              @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
         File txtFileTemp = null, fileTemp = null;
         try {
-            SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
             Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
             BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
 
@@ -181,11 +186,12 @@ public class TRBasicInfoController {
             CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
             ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class);
             if (Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign()) && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != courseWeightResult.getWeightSettingSign().longValue()) {
-                trBasicInfoService.clearReportData(examId, courseCode, paperNumber, Objects.nonNull(reportCourseEvaluationResultDto.getDimensionSign()) && reportCourseEvaluationResultDto.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue() ? true : false);
-
                 MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
                 Objects.requireNonNull(markPaper, "未找到科目信息");
-                trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId());
+
+                TCPaperStruct tcPaperStruct = tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, examId).eq(TCPaperStruct::getCourseCode, courseCode).eq(TCPaperStruct::getPaperNumber, paperNumber));
+                trBasicInfoService.clearReportData(examId, courseCode, paperNumber, Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue() ? true : false);
+                this.reportView(examId, courseCode, paperNumber);
                 this.reportExport(examId, courseCode, paperNumber);
             } else {
                 //评价样本的基本信息