ソースを参照

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

# Conflicts:
#	distributed-print/install/mysql/upgrade/3.3.1.sql
xiaofei 1 年間 前
コミット
cc831c8f55

+ 19 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/ReportChangeResult.java

@@ -25,8 +25,26 @@ public class ReportChangeResult implements Serializable {
     @ApiModelProperty(value = "权重是否发生变化")
     private boolean weightChange;
 
-    public ReportChangeResult(){
+    @ApiModelProperty(value = "目标分是否发生变化")
+    private boolean targetScoreChange;
 
+    @ApiModelProperty(value = "目标分内容")
+    private String targetScoreChangeStr;
+
+    public boolean isTargetScoreChange() {
+        return targetScoreChange;
+    }
+
+    public void setTargetScoreChange(boolean targetScoreChange) {
+        this.targetScoreChange = targetScoreChange;
+    }
+
+    public String getTargetScoreChangeStr() {
+        return targetScoreChangeStr;
+    }
+
+    public void setTargetScoreChangeStr(String targetScoreChangeStr) {
+        this.targetScoreChangeStr = targetScoreChangeStr;
     }
 
     public boolean isCourseTargetChange() {

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

@@ -39,6 +39,17 @@ public interface TCPaperStructService extends IService<TCPaperStruct> {
      */
     public Map<String, String> paperStructExcelImport(MultipartFile file, Long examId, String courseCode, String paperNumber) throws IOException;
 
+    /**
+     * 同步试卷蓝图结构
+     *
+     * @param examId
+     * @param courseCode
+     * @param paperNumber
+     * @return
+     * @throws IOException
+     */
+    public Map<String, String> paperStructDimensionSync(Long examId, String courseCode, String paperNumber) throws IOException;
+
     /**
      * 根据考试id/科目编辑/试卷编码查询数据
      *

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

@@ -39,9 +39,10 @@ public interface TRBasicInfoService extends IService<TRBasicInfo> {
      *
      * @param trBasicInfo
      * @param paperStructDimensionResultList
+     * @param courseWeightResult
      * @return
      */
-    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructDimensionResult> paperStructDimensionResultList);
+    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructDimensionResult> paperStructDimensionResultList, CourseWeightResult courseWeightResult);
 
     /**
      * 计算课程考核成绩评价结果
@@ -58,9 +59,10 @@ public interface TRBasicInfoService extends IService<TRBasicInfo> {
      * @param trBasicInfo
      * @param markPaper
      * @param userId
+     * @param courseWeightResult
      * @return
      */
-    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId);
+    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId, CourseWeightResult courseWeightResult);
 
     /**
      * 构建word动态表格1-课程目标与毕业要求指标点的对应关系

+ 15 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCPaperStructServiceImpl.java

@@ -176,6 +176,21 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
         return messageMap;
     }
 
+    /**
+     * 同步试卷蓝图结构
+     *
+     * @param examId
+     * @param courseCode
+     * @param paperNumber
+     * @return
+     * @throws IOException
+     */
+    @Override
+    @Transactional
+    public Map<String, String> paperStructDimensionSync(Long examId, String courseCode, String paperNumber) throws IOException {
+        return null;
+    }
+
     /**
      * 根据考试id/科目编辑/试卷编码查询数据
      *

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

@@ -117,12 +117,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
      * @return
      */
     @Override
-    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructDimensionResult> paperStructDimensionResultList) {
+    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructDimensionResult> paperStructDimensionResultList, CourseWeightResult courseWeightResult) {
         Map<String, Object> paramsMap = new HashMap<>();
         //查询考生数据
         List<FinalScoreResult> finalScoreResultList = tcFinalScoreService.examStudentOverview(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), trBasicInfo.getPaperNumber());//考生成绩
         if (CollectionUtils.isEmpty(finalScoreResultList)) {
-            throw ExceptionResultEnum.ERROR.exception("考试数据为空");
+            throw ExceptionResultEnum.ERROR.exception("成绩数据异常,平时成绩与期末成绩里考生名单不一致,请检查");
         }
 
 //        Map<String, Map<Long, Map<Long, DimensionDto>>> finalScoreExamStudentDimensionMap = new LinkedHashMap<>();//汇总考生课程目标-知识点卷面分(知识点得分用)
@@ -141,7 +141,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
             targetWebMap = new LinkedHashMap<>();
             usualScoreMap = new LinkedHashMap<>();
 
-            CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(trBasicInfo.getExamId(), trBasicInfo.getCourseCode());
             List<CourseWeightDto> courseWeightDtoList = courseWeightResult.getSubmitForm();
             weightSettingSign = courseWeightResult.getWeightSettingSign();
             dimensionSign = courseWeightResult.getDimensionSign();
@@ -348,11 +347,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
      * @param trBasicInfo
      * @param markPaper
      * @param userId
+     * @param courseWeightResult
      * @return
      */
     @Override
     @Transactional
-    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId) {
+    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId, CourseWeightResult courseWeightResult) {
         BasicSemester basicSemester = basicSemesterService.selectByExamId(markPaper.getExamId());
         Objects.requireNonNull(basicSemester, "未找到学期信息");
 
@@ -386,7 +386,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
             trBasicInfo.getReportResult().setCourseEvaluationSpreadInfo(reportCourseEvaluationSpreadDto);
         }
 
-        Map<String, Object> paramsMap = trBasicInfoService.getReportCalculateParams(trBasicInfo, paperStructDimensionResultList);
+        Map<String, Object> paramsMap = trBasicInfoService.getReportCalculateParams(trBasicInfo, paperStructDimensionResultList, courseWeightResult);
 
         //课程目标达成评价明细结果-考生集合
         List<ReportExamStudentDto> examStudentNewList = trExamStudentService.getExamStudentReportDetail(trBasicInfo, paramsMap);

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

@@ -687,5 +687,13 @@ UPDATE `sys_privilege` SET `enable` = '0', `front_display` = '0' WHERE (`id` = '
 -- 2024/03/26
 ALTER TABLE `mark_subjective_score` CHANGE COLUMN `sub_number` `sub_number` INT(11) NOT NULL COMMENT '小题号' ;
 
+-- 2024/03/27
+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,2033', 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(2033, '同步试卷蓝图结构', '/api/admin/course/degree/final_score/paper_struct_dimension/sync', 'URL', 2006, 1, 'AUTH', NULL, 1, 1, 1);
 -- 2024/03/28
 DELETE FROM t_b_task where type in ('STUDENT_IMPORT', 'CLAZZ_IMPORT', 'CREATE_PDF');

+ 14 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/TCPaperStructController.java

@@ -82,6 +82,17 @@ public class TCPaperStructController {
         return ResultUtil.ok(tcPaperStructService.paperStructExcelImport(file, examId, courseCode, paperNumber));
     }
 
+    @ApiOperation(value = "同步试卷蓝图结构")
+    @RequestMapping(value = "/final_score/paper_struct_dimension/sync", method = RequestMethod.POST)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
+    @ApiResponses({@ApiResponse(code = 200, message = "同步成功", response = EditResult.class)})
+    public Result finalScorePaperStructDimensionSync(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+                                                     @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
+                                                     @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
+        tcFinalScoreService.getFinalScoreSyncLock(examId, courseCode, paperNumber);
+        return ResultUtil.ok();
+    }
+
     @ApiOperation(value = "期末成绩试卷蓝图保存")
     @RequestMapping(value = "/final_score/paper_struct/save", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
@@ -141,7 +152,6 @@ public class TCPaperStructController {
                                              @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                              @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
         tcFinalScoreService.getFinalScoreSyncLock(examId, courseCode, paperNumber);
-        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
         List<PaperStructDimensionResult> paperStructDimensionResultList = null;
         TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
         if (Objects.isNull(tcPaperStruct) || Objects.isNull(tcPaperStruct.getPaperStruct())) {
@@ -154,6 +164,7 @@ public class TCPaperStructController {
                 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, false);
                 paperStructDimensionResultList = this.getPaperStructDimensionResult(tcPaperStruct, paperStructDimensionResultList);
@@ -171,7 +182,8 @@ public class TCPaperStructController {
      * @param paperStructDimensionResultList
      * @return
      */
-    protected List<PaperStructDimensionResult> getPaperStructDimensionResult(TCPaperStruct tcPaperStruct, List<PaperStructDimensionResult> paperStructDimensionResultList) {
+    protected List<PaperStructDimensionResult> getPaperStructDimensionResult(TCPaperStruct tcPaperStruct,
+                                                                             List<PaperStructDimensionResult> paperStructDimensionResultList) {
         if (Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
             paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
             }.getType());

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

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.deepoove.poi.XWPFTemplate;
+import com.google.gson.reflect.TypeToken;
 import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.exception.ApiException;
@@ -16,6 +17,7 @@ import com.qmth.distributed.print.business.bean.dto.TCUsualScoreDto;
 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.ScoreResult;
+import com.qmth.distributed.print.business.bean.result.report.PaperStructDimensionResult;
 import com.qmth.distributed.print.business.bean.result.report.ReportChangeResult;
 import com.qmth.distributed.print.business.bean.result.report.ReportResult;
 import com.qmth.distributed.print.business.bean.result.report.word.CourseBasicBean;
@@ -30,14 +32,12 @@ import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSchool;
 import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.ImportTemplateEnum;
 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.common.util.*;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
 import io.swagger.annotations.*;
 import org.apache.commons.collections4.CollectionUtils;
@@ -54,6 +54,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -114,15 +115,27 @@ public class TRBasicInfoController {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         TRBasicInfo trBasicInfo = trBasicInfoService.getOne(new QueryWrapper<TRBasicInfo>().lambda().eq(TRBasicInfo::getExamId, examId).eq(TRBasicInfo::getCourseCode, courseCode).eq(TRBasicInfo::getPaperNumber, paperNumber));
 
+        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
+        TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
+        if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
+            List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
+            }.getType());
+            for (CourseWeightDto c : courseWeightResult.getSubmitForm()) {
+                Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
+                if (new BigDecimal(score).compareTo(c.getTotalWeight()) != 0) {
+                    trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
+                    throw ExceptionResultEnum.ERROR.exception("[" + c.getCourseTargetName() + "]知识点小题总分大于该课程目标分,请重新设置");
+                }
+            }
+        }
+
         if (Objects.isNull(trBasicInfo)) {
-            trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId());
+            trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(), courseWeightResult);
         } else {
-            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()) {
-                TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, 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());
+                trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(), courseWeightResult);
             } else {
                 ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
                 ReportCourseEvaluationSpreadDto reportCourseEvaluationSpreadDto = Objects.nonNull(trBasicInfo.getCourseEvaluationSpread()) ? JSONObject.parseObject(trBasicInfo.getCourseEvaluationSpread(), ReportCourseEvaluationSpreadDto.class) : null;
@@ -158,7 +171,7 @@ public class TRBasicInfoController {
         if (Objects.isNull(trBasicInfoDb)) {
             trBasicInfoDb = new TRBasicInfo(trBasicInfo, sysUser.getId());
             MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfo.getExamId(), trBasicInfo.getPaperNumber());
-            trBasicInfoDb = trBasicInfoService.getReportView(trBasicInfoDb, markPaper, sysUser.getId());
+            trBasicInfoDb = trBasicInfoService.getReportView(trBasicInfoDb, markPaper, sysUser.getId(), trBasicInfoService.findCourseWeightResultRmi(trBasicInfo.getExamId(), trBasicInfo.getCourseCode()));
         } else {
             trBasicInfoDb.updateInfo(trBasicInfo, sysUser.getId());
         }
@@ -184,10 +197,22 @@ public class TRBasicInfoController {
             Objects.requireNonNull(trBasicInfo.getCourseEvaluationResultDetail(), "没有课程考生信息");
 
             CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
+            TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
+            if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
+                List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
+                }.getType());
+                for (CourseWeightDto c : courseWeightResult.getSubmitForm()) {
+                    Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
+                    if (new BigDecimal(score).compareTo(c.getTotalWeight()) != 0) {
+                        trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
+                        throw ExceptionResultEnum.ERROR.exception("[" + c.getCourseTargetName() + "]知识点小题总分大于该课程目标分,请重新设置");
+                    }
+                }
+            }
+
             ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class);
             if (Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign()) && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != courseWeightResult.getWeightSettingSign().longValue()) {
                 printCommonService.getMarkPaper(examId, paperNumber);
-                TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, 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);
@@ -267,7 +292,8 @@ public class TRBasicInfoController {
     @ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
     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 {
+                                   @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                                   @ApiParam(value = "true:报告,false:成绩管理", required = true) @RequestParam boolean report) throws IOException {
         ReportChangeResult reportChangeResult = new ReportChangeResult();
         List<TCUsualScore> tcUsualScoreList = tcUsualScoreService.list(new QueryWrapper<TCUsualScore>().lambda().eq(TCUsualScore::getExamId, examId).eq(TCUsualScore::getCourseCode, courseCode).eq(TCUsualScore::getPaperNumber, paperNumber));
         if (CollectionUtils.isNotEmpty(tcUsualScoreList)) {
@@ -312,6 +338,26 @@ public class TRBasicInfoController {
                     }
                 }
             }
+
+            if (!report) {
+                TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
+                if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
+                    List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
+                    }.getType());
+                    StringJoiner stringJoiner = new StringJoiner("");
+                    for (CourseWeightDto c : courseWeightDtoList) {
+                        Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
+                        if (new BigDecimal(score).compareTo(c.getTotalWeight()) != 0) {
+                            reportChangeResult.setTargetScoreChange(true);
+                            stringJoiner.add("[").add(c.getCourseTargetName()).add("]").add("知识点小题总分大于该课程目标分,请重新设置").add("\r\n");
+                        }
+                    }
+                    if (reportChangeResult.isTargetScoreChange()) {
+                        trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
+                        reportChangeResult.setTargetScoreChangeStr(stringJoiner.toString());
+                    }
+                }
+            }
         }
         return ResultUtil.ok(reportChangeResult);
     }