Prechádzať zdrojové kódy

fix:蓝图设置同步

caozixuan 1 rok pred
rodič
commit
97b4a7cf2f

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

@@ -1,5 +1,7 @@
 package com.qmth.distributed.print.business.bean.result.report;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.distributed.print.business.bean.dto.report.CourseTargetWebDto;
 import io.swagger.annotations.ApiModelProperty;
 import org.hibernate.validator.constraints.Range;
@@ -30,6 +32,10 @@ public class PaperStructDimensionResult implements Serializable {
     @Range(min = 1L, message = "小题号最小为1")
     private Integer subNumber;
 
+    @ApiModelProperty(value = "考试id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long examId;
+
     @ApiModelProperty(value = "试卷编码")
     private String paperNumber;
 
@@ -49,13 +55,22 @@ public class PaperStructDimensionResult implements Serializable {
 
     }
 
-    public PaperStructDimensionResult(Integer mainNumber, Integer subNumber, String paperNumber, BigDecimal score) {
+    public PaperStructDimensionResult(Integer mainNumber, Integer subNumber,Long examId, String paperNumber, BigDecimal score) {
         this.mainNumber = mainNumber;
         this.subNumber = subNumber;
+        this.examId = examId;
         this.paperNumber = paperNumber;
         this.score = score;
     }
 
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
     public String getPaperNumber() {
         return paperNumber;
     }

+ 2 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TCPaperStruct.java

@@ -70,8 +70,9 @@ public class TCPaperStruct extends BaseEntity implements Serializable {
 
     }
 
-    public TCPaperStruct(Long cultureProgramId, Long courseId, String courseCode, String courseName, String paperNumber, String paperStructDimension, Long userId, Long dimensionSign) {
+    public TCPaperStruct(Long examId, Long cultureProgramId, Long courseId, String courseCode, String courseName, String paperNumber, String paperStructDimension, Long userId, Long dimensionSign) {
         insertInfo(userId);
+        this.examId = examId;
         this.cultureProgramId = cultureProgramId;
         this.courseId = courseId;
         this.courseCode = courseCode;

+ 4 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ObeCourseTargetServiceImpl.java

@@ -265,6 +265,8 @@ public class ObeCourseTargetServiceImpl extends ServiceImpl<ObeCourseTargetMappe
                                 subCell.setMainNumber(mainNumber);
                                 subCell.setSubNumber(subNumberIndex.getAndIncrement());
                                 subCell.setScore(new BigDecimal(score));
+                                subCell.setExamId(examId);
+                                subCell.setPaperNumber(paperNumber);
                                 result.add(subCell);
                             }
 
@@ -294,6 +296,8 @@ public class ObeCourseTargetServiceImpl extends ServiceImpl<ObeCourseTargetMappe
                             cell.setMainNumber(mainNumber);
                             cell.setSubNumber(subNumberIndex.getAndIncrement());
                             cell.setScore(new BigDecimal(score));
+                            cell.setExamId(examId);
+                            cell.setPaperNumber(paperNumber);
                             result.add(cell);
                         }
                     }

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

@@ -280,7 +280,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
                             String name = scoreItem.getMainNumber() + "-" + scoreItem.getSubNumber();
                             tcFinalScoreDtoList.add(new TCFinalScoreDto(scoreItem.getScore().toString(), name));
                             if (i == 0) {
-                                paperStructDimensionResultList.add(new PaperStructDimensionResult(scoreItem.getMainNumber(), scoreItem.getSubNumber(), paperNumber, new BigDecimal(scoreItem.getTotalScore())));
+                                paperStructDimensionResultList.add(new PaperStructDimensionResult(scoreItem.getMainNumber(), scoreItem.getSubNumber(), examId, paperNumber, new BigDecimal(scoreItem.getTotalScore())));
                             }
                         }
                         tcFinalScoreList.add(new TCFinalScore(markStudentScoreVo, JacksonUtil.parseJson(tcFinalScoreDtoList), SourceEnum.SYNC, sysUser.getId(), cultureProgramId, courseId));
@@ -305,6 +305,9 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
                         Objects.requireNonNull(basicCourse, "未找到基础课程信息");
                         tcPaperStruct = new TCPaperStruct(cultureProgramId, courseId, basicCourse.getCode(), basicCourse.getName(), paperNumber, JacksonUtil.parseJson(paperStructDimensionResultList), sysUser.getId());
                     }
+                    if (SystemConstant.longNotNull(examId)){
+                        tcPaperStruct.setExamId(examId);
+                    }
                     tcPaperStructService.saveOrUpdate(tcPaperStruct);
                 }
             }

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

@@ -248,7 +248,7 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
                 tcPaperStructService.remove(cultureProgramId, courseId, paperNumber);
                 MarkPaper markPaper = printCommonService.getMarkPaper(examId, null, paperNumber, courseId);
                 ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId());
-                tcPaperStruct = new TCPaperStruct(cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), paperNumber, JacksonUtil.parseJson(paperStructDimensionResultList), sysUser.getId(), obeCourseWeightResult.getDimensionSign());
+                tcPaperStruct = new TCPaperStruct(examId, cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), paperNumber, JacksonUtil.parseJson(paperStructDimensionResultList), sysUser.getId(), obeCourseWeightResult.getDimensionSign());
                 List<MarkQuestion> markQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null);
                 if (CollectionUtils.isEmpty(markQuestionList)) {
                     throw ExceptionResultEnum.ERROR.exception("未找到试卷结构");

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

@@ -177,7 +177,7 @@ public class TCPaperStructController {
         TCPaperStruct tcPaperStructDb = tcPaperStructService.queryPaperStruct(paperStructParams.getCultureProgramId(), paperStructParams.getCourseId(), paperStructParams.getPaperNumber());
         if (Objects.isNull(tcPaperStructDb)) {
             MarkPaper markPaper = printCommonService.getMarkPaper(paperStructParams.getExamId(), paperStructParams.getCourseCode(), paperStructParams.getPaperNumber(), paperStructParams.getCourseId());
-            tcPaperStructDb = new TCPaperStruct(paperStructParams.getCultureProgramId(), paperStructParams.getCourseId(), paperStructParams.getCourseCode(), markPaper.getCourseName(), paperStructParams.getPaperNumber(), JacksonUtil.parseJson(paperStructParams.getPaperStruct()), sysUser.getId(), obeCourseWeightResult.getDimensionSign());
+            tcPaperStructDb = new TCPaperStruct(paperStructParams.getExamId(), paperStructParams.getCultureProgramId(), paperStructParams.getCourseId(), paperStructParams.getCourseCode(), markPaper.getCourseName(), paperStructParams.getPaperNumber(), JacksonUtil.parseJson(paperStructParams.getPaperStruct()), sysUser.getId(), obeCourseWeightResult.getDimensionSign());
             tcPaperStructService.save(tcPaperStructDb);
         } else {
             TCPaperStruct tcPaperStructSource = new TCPaperStruct();
@@ -211,7 +211,7 @@ public class TCPaperStructController {
             }
             paperStructDimensionResultList = new ArrayList<>(markQuestionList.size());
             for (MarkQuestion markQuestion : markQuestionList) {
-                paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), markQuestion.getPaperNumber(), new BigDecimal(markQuestion.getTotalScore())));
+                paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(),examId, markQuestion.getPaperNumber(), new BigDecimal(markQuestion.getTotalScore())));
             }
         } else {
             ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId());
@@ -243,7 +243,7 @@ public class TCPaperStructController {
             }.getType());
             paperStructDimensionResultList = new ArrayList<>(paperStructDtoList.size());
             for (PaperStructDto paperStructDto : paperStructDtoList) {
-                paperStructDimensionResultList.add(new PaperStructDimensionResult(paperStructDto.getMainNumber(), paperStructDto.getSubNumber(), tcPaperStruct.getPaperNumber(), new BigDecimal(paperStructDto.getScore())));
+                paperStructDimensionResultList.add(new PaperStructDimensionResult(paperStructDto.getMainNumber(), paperStructDto.getSubNumber(),tcPaperStruct.getExamId(), tcPaperStruct.getPaperNumber(), new BigDecimal(paperStructDto.getScore())));
             }
         }
         return paperStructDimensionResultList;