Jelajahi Sumber

分布式印刷批次推送时更新source
分布式印刷批次查询字段新增 计算结果数据相关
分布式印刷回调匹配批次试卷表 : courseCode:paper_number更改为grade_course_code

caozixuan 3 tahun lalu
induk
melakukan
8978d9e15e

+ 58 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/analyze/GradeBatchResult.java

@@ -3,8 +3,11 @@ package com.qmth.distributed.print.business.bean.result.analyze;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.teachcloud.common.enums.GradeAnalyzePaperStatusEnum;
+import com.qmth.teachcloud.common.enums.TaskResultEnum;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
+
 /**
  * @Description: 批次查询返回对象
  * @Author: CaoZixuan
@@ -32,6 +35,21 @@ public class GradeBatchResult {
     @ApiModelProperty(value = "批次状态")
     private GradeAnalyzePaperStatusEnum status;
 
+    @ApiModelProperty(value = "计算进度")
+    private BigDecimal progress;
+
+    @ApiModelProperty(value = "报告路径")
+    private String reportFilePath;
+
+    @ApiModelProperty(value = "回调时间")
+    private Long notifyTime;
+
+    @ApiModelProperty(value = "数据结果,SUCCESS:成功,ERROR:失败")
+    private TaskResultEnum result;
+
+    @ApiModelProperty(value = "教研分析学期id")
+    private Long thirdSemesterId;
+
     public Long getId() {
         return id;
     }
@@ -79,4 +97,44 @@ public class GradeBatchResult {
     public void setStatus(GradeAnalyzePaperStatusEnum status) {
         this.status = status;
     }
+
+    public BigDecimal getProgress() {
+        return progress;
+    }
+
+    public void setProgress(BigDecimal progress) {
+        this.progress = progress;
+    }
+
+    public String getReportFilePath() {
+        return reportFilePath;
+    }
+
+    public void setReportFilePath(String reportFilePath) {
+        this.reportFilePath = reportFilePath;
+    }
+
+    public Long getNotifyTime() {
+        return notifyTime;
+    }
+
+    public void setNotifyTime(Long notifyTime) {
+        this.notifyTime = notifyTime;
+    }
+
+    public TaskResultEnum getResult() {
+        return result;
+    }
+
+    public void setResult(TaskResultEnum result) {
+        this.result = result;
+    }
+
+    public Long getThirdSemesterId() {
+        return thirdSemesterId;
+    }
+
+    public void setThirdSemesterId(Long thirdSemesterId) {
+        this.thirdSemesterId = thirdSemesterId;
+    }
 }

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

@@ -15,12 +15,16 @@ import com.qmth.teachcloud.common.enums.TaskResultEnum;
 import com.qmth.teachcloud.common.enums.TaskStatusEnum;
 import com.qmth.teachcloud.common.service.BasicSemesterService;
 import com.qmth.teachcloud.common.sync.TeachCloudReportTaskUtils;
+import com.qmth.teachcloud.common.util.Base64Util;
+import com.qmth.teachcloud.common.util.ShaUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -87,6 +91,7 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
             QueryWrapper<GradeBatchPaper> queryWrapper = new QueryWrapper<>();
             queryWrapper.lambda().eq(GradeBatchPaper::getBatchId, gradeBatch.getId());
             List<GradeBatchPaper> gradeBatchPaperList = gradeBatchPaperService.list(queryWrapper);
+            List<String> courseCodeList = new ArrayList<>();
             for (GradeBatchPaper gradeBatchPaper : gradeBatchPaperList) {
                 String courseCode = gradeBatchPaper.getPaperNumber() + gradeBatchPaper.getPaperType();
                 boolean syncCourse = teachCloudReportTaskUtils.syncCourse(schoolId, String.valueOf(thirdExamId), courseCode, gradeBatchPaper.getPaperName(), gradeBatchPaper.getPaperType(), gradeBatchPaper.getTeachCollegeName(), gradeBatchPaper.getEnable());
@@ -101,11 +106,14 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
                     gradeBatchPaper.setGradeCourseCode(courseCode);
                     gradeBatchPaper.setStatus(count > 0 ? GradeAnalyzePaperStatusEnum.READY_TO_CALCULATE : GradeAnalyzePaperStatusEnum.SETTING_GRADE_PAPER_PARAM);
                     gradeBatchPaperService.updateById(gradeBatchPaper);
+                    courseCodeList.add(courseCode);
                 }
             }
 
             long batchCount = gradeBatchPaperList.stream().filter(m -> GradeAnalyzePaperStatusEnum.SETTING_GRADE_PAPER_PARAM.equals(m.getStatus())).count();
-
+            Collections.sort(courseCodeList);
+            String source = Base64Util.encode(ShaUtils.sha1(thirdExamId + courseCodeList.toString()));
+            gradeBatch.setSource(source);
             gradeBatch.setStatus(batchCount > 0 ? GradeAnalyzePaperStatusEnum.SETTING_GRADE_PAPER_PARAM : GradeAnalyzePaperStatusEnum.READY_TO_CALCULATE);
 
             // 任务结果

+ 2 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradeBatchPaperServiceImpl.java

@@ -124,6 +124,7 @@ public class GradeBatchPaperServiceImpl extends ServiceImpl<GradeBatchPaperMappe
             gradeBatchPaper.setTeachCollegeId(teachCollegeId);
             gradeBatchPaper.setTeachCollegeName(teachCollegeName);
 
+
             GradeBatchPaper dbBatchPaper = this.getOne(new QueryWrapper<GradeBatchPaper>().lambda()
                     .eq(GradeBatchPaper::getSchoolId, schoolId)
                     .eq(GradeBatchPaper::getBatchId, batchId)
@@ -133,6 +134,7 @@ public class GradeBatchPaperServiceImpl extends ServiceImpl<GradeBatchPaperMappe
                 // 新增
                 gradeBatchPaper.insertInfo(requestUser.getId());
                 gradeBatchPaper.setStatus(GradeAnalyzePaperStatusEnum.PUSH_GRADE_BATCH);
+                gradeBatchPaper.setEnable(true);
                 updateBatchStatus.set(true);
             } else {
                 // 编辑(计算中的不允许被编辑,其他状态下的只要开课学院和试卷名称有变化,状态就更新为需要重新推送)

+ 6 - 1
distributed-print-business/src/main/resources/mapper/GradeBatchMapper.xml

@@ -10,7 +10,12 @@
             gb.batch_time AS batchTime,
             gb.status,
             gb.semester_id AS semesterId,
-            bs.name AS semesterName
+            bs.name AS semesterName,
+            gb.progress AS progress,
+            gb.report_file_path AS reportFilePath,
+            gb.notify_time AS notifyTime,
+            gb.result AS result,
+            gb.third_semester_id AS thirdSemesterId
         FROM
             grade_batch gb
         LEFT JOIN

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

@@ -120,7 +120,7 @@ public class NotifyApiController {
 
                 List<GradeBatchPaper> gradeBatchPaperList = new ArrayList<>();
                 calculateNotifyResult.getCourseCode().forEach((k, v) -> {
-                    gradeBatchPaperQueryWrapper.lambda().eq(GradeBatchPaper::getPaperNumber, k)
+                    gradeBatchPaperQueryWrapper.lambda().eq(GradeBatchPaper::getGradeCourseCode, k)
                             .eq(GradeBatchPaper::getEnable, true);
                     GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.getOne(gradeBatchPaperQueryWrapper);
                     Optional.ofNullable(gradeBatchPaper).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("批次科目[" + k + "]数据为空"));

+ 20 - 10
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/CallPrintOpenApiService.java

@@ -13,41 +13,51 @@ import java.util.List;
 public interface CallPrintOpenApiService {
     /**
      * 请求分布式印刷试卷基础配置查询接口
-     * @param thirdExamId 考试id
+     *
+     * @param schoolId        学校id
+     * @param thirdExamId     考试id
      * @param gradeCourseCode 科目编号
      * @return 结果
      */
-    PaperConfig callPaperConfig(Long thirdExamId,String gradeCourseCode) throws IOException;
+    PaperConfig callPaperConfig(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException;
 
     /**
      * 请求分布式印刷试卷维度查询接口
-     * @param thirdExamId 考试id
+     *
+     * @param schoolId        学校id
+     * @param thirdExamId     考试id
      * @param gradeCourseCode 科目编号
      * @return 结果
      */
-    List<PaperDimension> callPaperDimension(Long thirdExamId,String gradeCourseCode) throws IOException;
+    List<PaperDimension> callPaperDimension(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException;
 
     /**
      * 请求分布式印刷试卷蓝图接口
-     * @param thirdExamId 考试id
+     *
+     * @param schoolId        学校id
+     * @param thirdExamId     考试id
      * @param gradeCourseCode 科目编号
      * @return 结果
      */
-    List<PaperStructure> callPaperStruct(Long thirdExamId,String gradeCourseCode) throws IOException;
+    List<PaperStructure> callPaperStruct(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException;
 
     /**
      * 请求分布式印刷试卷模块接口
-     * @param thirdExamId 考试id
+     *
+     * @param schoolId        学校id
+     * @param thirdExamId     考试id
      * @param gradeCourseCode 科目编号
      * @return 结果
      */
-    List<PaperEvaluation> callPaperModule(Long thirdExamId,String gradeCourseCode) throws IOException;
+    List<PaperEvaluation> callPaperModule(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException;
 
     /**
      * 请求学生成绩数据接口
-     * @param thirdExamId 考试id
+     *
+     * @param schoolId        学校id
+     * @param thirdExamId     考试id
      * @param gradeCourseCode 科目编号
      * @return 结果
      */
-    List<ExamStudentScore> callExamStudentScore(Long thirdExamId,String gradeCourseCode) throws IOException;
+    List<ExamStudentScore> callExamStudentScore(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException;
 }

+ 46 - 41
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/AnalyzeDataGetAndEditServiceImpl.java

@@ -85,13 +85,13 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
             throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
         }
         String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
-        PaperConfig paperConfig = callPrintOpenApiService.callPaperConfig(examId, courseCode);
+        PaperConfig paperConfig = callPrintOpenApiService.callPaperConfig(schoolId, examId, courseCode);
         // md5 检验
         TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
                 .eq(TBExamCourse::getSchoolId, schoolId)
                 .eq(TBExamCourse::getExamId, examId)
                 .eq(TBExamCourse::getCourseCode, courseCode));
-        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
+        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
         String oldMd5 = "";
         if (Objects.nonNull(md5)) {
             oldMd5 = md5.getPaperMd5();
@@ -151,16 +151,16 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
         if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, null)) {
             throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
         }
-        List<PaperDimension> paperDimensionList = callPrintOpenApiService.callPaperDimension(examId, courseCode);
+        List<PaperDimension> paperDimensionList = callPrintOpenApiService.callPaperDimension(schoolId, examId, courseCode);
 
         // md5 检验
         TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
-                .eq(TBExamCourse::getSchoolId,schoolId)
-                .eq(TBExamCourse::getExamId,examId)
-                .eq(TBExamCourse::getCourseCode,courseCode));
-        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
+                .eq(TBExamCourse::getSchoolId, schoolId)
+                .eq(TBExamCourse::getExamId, examId)
+                .eq(TBExamCourse::getCourseCode, courseCode));
+        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
         String oldMd5 = "";
-        if (Objects.nonNull(md5)){
+        if (Objects.nonNull(md5)) {
             oldMd5 = md5.getDimensionMd5();
         }
         String currentMd5 = this.buildDimensionDataMd5(paperDimensionList);
@@ -174,8 +174,8 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
 
             String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
             List<TBDimension> old = tbDimensionService.list(new QueryWrapper<TBDimension>().lambda().eq(TBDimension::getExamId, examId).eq(TBDimension::getCourseCode, courseCode));
-            if (old != null && old.size() > 0){
-                repeat = this.checkTBDimensionRepeat(old,paperDimensionList);
+            if (old != null && old.size() > 0) {
+                repeat = this.checkTBDimensionRepeat(old, paperDimensionList);
             }
 
             List<TBDimension> tbDimensionList = paperDimensionList.stream().flatMap(e -> {
@@ -214,16 +214,16 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
         TBPaper tbPaper = tbPaperList.get(0);
         Long paperId = tbPaper.getId();
 
-        List<PaperStructure> paperStructureList = callPrintOpenApiService.callPaperStruct(examId, courseCode);
+        List<PaperStructure> paperStructureList = callPrintOpenApiService.callPaperStruct(schoolId, examId, courseCode);
 
         // md5 检验
         TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
-                .eq(TBExamCourse::getSchoolId,schoolId)
-                .eq(TBExamCourse::getExamId,examId)
-                .eq(TBExamCourse::getCourseCode,courseCode));
-        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
+                .eq(TBExamCourse::getSchoolId, schoolId)
+                .eq(TBExamCourse::getExamId, examId)
+                .eq(TBExamCourse::getCourseCode, courseCode));
+        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
         String oldMd5 = "";
-        if (Objects.nonNull(md5)){
+        if (Objects.nonNull(md5)) {
             oldMd5 = md5.getStructMd5();
         }
         String currentMd5 = this.buildStructDataMd5(paperStructureList);
@@ -237,8 +237,8 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
             // -- --
             List<TBDimension> tbDimensionList = tbDimensionService.list(new QueryWrapper<TBDimension>()
                     .lambda()
-                    .eq(TBDimension::getExamId,examId)
-                    .eq(TBDimension::getCourseCode,courseCode));
+                    .eq(TBDimension::getExamId, examId)
+                    .eq(TBDimension::getCourseCode, courseCode));
 
             // 知识 - 二级维度
             List<String> knowledgeDatasource = tbDimensionList.stream()
@@ -265,17 +265,17 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
                 String knowledgeDimension = e.getKnowledgeDimension();
                 String abilityDimension = e.getAbilityDimension();
                 // 校验试卷结构每题的维度点都在该科目的维度池中(知识二级能力一级)
-                if (SystemConstant.strNotNull(knowledgeDimension)){
+                if (SystemConstant.strNotNull(knowledgeDimension)) {
                     for (String knowledge : knowledgeDimension.split(",")) {
-                        if (!knowledgeDatasource.contains(knowledge)){
+                        if (!knowledgeDatasource.contains(knowledge)) {
                             throw ExceptionResultEnum.ERROR.exception("试卷结构知识点二级维度【" + knowledge + "】不在知识维度池中");
                         }
                     }
                     tbPaperStruct.setKnowledgeDimension(knowledgeDimension);
                 }
-                if (SystemConstant.strNotNull(abilityDimension)){
+                if (SystemConstant.strNotNull(abilityDimension)) {
                     for (String ability : abilityDimension.split(",")) {
-                        if (!abilityDatasource.contains(ability)){
+                        if (!abilityDatasource.contains(ability)) {
                             throw ExceptionResultEnum.ERROR.exception("试卷结构能力点一级维度【" + ability + "】不在能力维度池中");
                         }
                     }
@@ -300,16 +300,16 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
             throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
         }
         String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
-        List<PaperEvaluation> paperEvaluationList = callPrintOpenApiService.callPaperModule(examId, courseCode);
+        List<PaperEvaluation> paperEvaluationList = callPrintOpenApiService.callPaperModule(schoolId, examId, courseCode);
 
         // md5 检验
         TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
-                .eq(TBExamCourse::getSchoolId,schoolId)
-                .eq(TBExamCourse::getExamId,examId)
-                .eq(TBExamCourse::getCourseCode,courseCode));
-        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
+                .eq(TBExamCourse::getSchoolId, schoolId)
+                .eq(TBExamCourse::getExamId, examId)
+                .eq(TBExamCourse::getCourseCode, courseCode));
+        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
         String oldMd5 = "";
-        if (Objects.nonNull(md5)){
+        if (Objects.nonNull(md5)) {
             oldMd5 = md5.getModuleMd5();
         }
         String currentMd5 = this.buildModuleDataMd5(paperEvaluationList);
@@ -402,21 +402,21 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
             throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
         }
         String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
-        List<ExamStudentScore> examStudentScoreList = callPrintOpenApiService.callExamStudentScore(examId, courseCode);
+        List<ExamStudentScore> examStudentScoreList = callPrintOpenApiService.callExamStudentScore(schoolId, examId, courseCode);
         // md5 检查
         TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
-                .eq(TBExamCourse::getSchoolId,schoolId)
-                .eq(TBExamCourse::getExamId,examId)
-                .eq(TBExamCourse::getCourseCode,courseCode));
-        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
+                .eq(TBExamCourse::getSchoolId, schoolId)
+                .eq(TBExamCourse::getExamId, examId)
+                .eq(TBExamCourse::getCourseCode, courseCode));
+        BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
         String oldMd5 = "";
-        if (Objects.nonNull(md5)){
+        if (Objects.nonNull(md5)) {
             oldMd5 = md5.getStudentScoreMd5();
         }
         String currentMd5 = this.buildExamStudentDataMd5(examStudentScoreList);
 
         //因为t_b_paper表是做更新操作的所以当学生数据md5一致,即使是t_b_paper的数据改了,也不影响学生数据所绑定的paper_id 所以不用重新算
-        if (!currentMd5.equals(oldMd5)){
+        if (!currentMd5.equals(oldMd5)) {
             // md5 不一致需要重算
             repeat = true;
             md5.setStudentScoreMd5(currentMd5);
@@ -445,7 +445,7 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
         boolean repeatForStruct = this.tbPaperStructDispose(examId, courseCode, schoolId);
         boolean repeatForModule = this.tbPaperModuleDispose(examId, courseCode, schoolId);
         boolean repeatForExamStudentScore = this.tbExamStudentScoreDatasourceDispose(examId, courseCode, schoolId);
-        if (repeatForPaper || repeatForDimension || repeatForStruct || repeatForModule || repeatForExamStudentScore){
+        if (repeatForPaper || repeatForDimension || repeatForStruct || repeatForModule || repeatForExamStudentScore) {
             repeat = true;
         }
         return repeat;
@@ -834,19 +834,21 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
 
     /**
      * 构建试卷信息md5
+     *
      * @param paperConfig 试卷配置
      * @return md5
      */
-    private String buildPaperDataMd5(PaperConfig paperConfig){
+    private String buildPaperDataMd5(PaperConfig paperConfig) {
         return DigestUtils.md5Hex(JSON.toJSONString(paperConfig));
     }
 
     /**
      * 构建维度信息md5
+     *
      * @param paperDimensionList 维度信息
      * @return MD5
      */
-    private String buildDimensionDataMd5(List<PaperDimension> paperDimensionList){
+    private String buildDimensionDataMd5(List<PaperDimension> paperDimensionList) {
         paperDimensionList = paperDimensionList.stream().sorted(Comparator.comparing(PaperDimension::getDimensionType)
                         .thenComparing(PaperDimension::getCodePrimary)
                         .thenComparing(PaperDimension::getCodeSecond))
@@ -856,10 +858,11 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
 
     /**
      * 构建结构信息md5
+     *
      * @param paperStructureList 试卷结构信息
      * @return MD5
      */
-    private String buildStructDataMd5(List<PaperStructure> paperStructureList){
+    private String buildStructDataMd5(List<PaperStructure> paperStructureList) {
         paperStructureList = paperStructureList.stream().sorted(Comparator.comparing(PaperStructure::getNumberType)
                 .thenComparing(PaperStructure::getBigQuestionNumber)
                 .thenComparing(PaperStructure::getSmallQuestionNumber)).collect(Collectors.toList());
@@ -868,10 +871,11 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
 
     /**
      * 构建模块信息MD5
+     *
      * @param paperEvaluationList 试卷模块信息
      * @return MD5
      */
-    private String buildModuleDataMd5(List<PaperEvaluation> paperEvaluationList){
+    private String buildModuleDataMd5(List<PaperEvaluation> paperEvaluationList) {
         paperEvaluationList = paperEvaluationList.stream().sorted(Comparator.comparing(PaperEvaluation::getModuleType))
                 .collect(Collectors.toList());
         return DigestUtils.md5Hex(JSON.toJSONString(paperEvaluationList));
@@ -879,10 +883,11 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
 
     /**
      * 构建学生成绩数据md5
+     *
      * @param examStudentScoreList 学生成绩数据
      * @return md5
      */
-    private String buildExamStudentDataMd5(List<ExamStudentScore> examStudentScoreList){
+    private String buildExamStudentDataMd5(List<ExamStudentScore> examStudentScoreList) {
         examStudentScoreList = examStudentScoreList.stream().sorted(Comparator.comparing(ExamStudentScore::getStudentCode)).collect(Collectors.toList());
         return DigestUtils.md5Hex(JSON.toJSONString(examStudentScoreList));
     }

+ 5 - 11
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/CallPrintOpenApiServiceImpl.java

@@ -40,9 +40,7 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
 
 
     @Override
-    public PaperConfig callPaperConfig(Long thirdExamId, String gradeCourseCode) throws IOException {
-//        Long schoolId = SystemConstant.getHeadOrUserSchoolId();
-        Long schoolId = 2L;
+    public PaperConfig callPaperConfig(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException {
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         log.info("请求分布式印刷试卷配置");
         JSONObject printOpenParams = new JSONObject();
@@ -63,8 +61,7 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
     }
 
     @Override
-    public List<PaperDimension> callPaperDimension(Long thirdExamId, String gradeCourseCode) throws IOException {
-        Long schoolId = 2L;
+    public List<PaperDimension> callPaperDimension(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException {
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         log.info("请求分布式印刷维度查询");
         JSONObject printOpenParams = new JSONObject();
@@ -85,8 +82,7 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
     }
 
     @Override
-    public List<PaperStructure> callPaperStruct(Long thirdExamId, String gradeCourseCode) throws IOException {
-        Long schoolId = 2L;
+    public List<PaperStructure> callPaperStruct(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException {
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         log.info("请求分布式印刷试卷结构查询");
         JSONObject printOpenParams = new JSONObject();
@@ -107,8 +103,7 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
     }
 
     @Override
-    public List<PaperEvaluation> callPaperModule(Long thirdExamId, String gradeCourseCode) throws IOException {
-        Long schoolId = 2L;
+    public List<PaperEvaluation> callPaperModule(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException {
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         log.info("请求分布式印刷试卷模块评价查询");
         JSONObject printOpenParams = new JSONObject();
@@ -129,8 +124,7 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
     }
 
     @Override
-    public List<ExamStudentScore> callExamStudentScore(Long thirdExamId, String gradeCourseCode) throws IOException {
-        Long schoolId = 2L;
+    public List<ExamStudentScore> callExamStudentScore(Long schoolId, Long thirdExamId, String gradeCourseCode) throws IOException {
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         log.info("请求分布式印刷考生成绩查询");
         JSONObject printOpenParams = new JSONObject();

+ 7 - 6
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/TestCallPrintOpenApiController.java

@@ -25,7 +25,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.util.List;
 
 /**
- * @Description:
+ * @Description: 需要删除的controllor
  * @Author: CaoZixuan
  * @Date:
  */
@@ -33,6 +33,7 @@ import java.util.List;
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/test/call")
 @Validated
+@Deprecated
 public class TestCallPrintOpenApiController {
     @Resource
     CallPrintOpenApiService callPrintOpenApiService;
@@ -49,7 +50,7 @@ public class TestCallPrintOpenApiController {
     @Aac(auth = BOOL.FALSE)
     public Result paperConfig(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
                               @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        PaperConfig paperConfig = callPrintOpenApiService.callPaperConfig(thirdExamId, courseCode);
+        PaperConfig paperConfig = callPrintOpenApiService.callPaperConfig(2L,thirdExamId, courseCode);
         System.out.println(JSON.toJSONString(paperConfig));
         return ResultUtil.ok();
     }
@@ -60,7 +61,7 @@ public class TestCallPrintOpenApiController {
     @Aac(auth = BOOL.FALSE)
     public Result paperDimension(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
                                  @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        List<PaperDimension> paperDimensionList = callPrintOpenApiService.callPaperDimension(thirdExamId, courseCode);
+        List<PaperDimension> paperDimensionList = callPrintOpenApiService.callPaperDimension(2L,thirdExamId, courseCode);
         System.out.println(JSON.toJSONString(paperDimensionList));
         return ResultUtil.ok();
     }
@@ -71,7 +72,7 @@ public class TestCallPrintOpenApiController {
     @Aac(auth = BOOL.FALSE)
     public Result paperStruct(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
                               @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        List<PaperStructure> paperStructureList = callPrintOpenApiService.callPaperStruct(thirdExamId, courseCode);
+        List<PaperStructure> paperStructureList = callPrintOpenApiService.callPaperStruct(2L,thirdExamId, courseCode);
         System.out.println(JSON.toJSONString(paperStructureList));
         return ResultUtil.ok();
     }
@@ -82,7 +83,7 @@ public class TestCallPrintOpenApiController {
     @Aac(auth = BOOL.FALSE)
     public Result paperModule(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
                               @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        List<PaperEvaluation> paperEvaluationList = callPrintOpenApiService.callPaperModule(thirdExamId, courseCode);
+        List<PaperEvaluation> paperEvaluationList = callPrintOpenApiService.callPaperModule(2L,thirdExamId, courseCode);
         System.out.println(JSON.toJSONString(paperEvaluationList));
         return ResultUtil.ok();
     }
@@ -93,7 +94,7 @@ public class TestCallPrintOpenApiController {
     @Aac(auth = BOOL.FALSE)
     public Result examStudentScore(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
                                    @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        List<ExamStudentScore> examStudentScoreList = callPrintOpenApiService.callExamStudentScore(thirdExamId, courseCode);
+        List<ExamStudentScore> examStudentScoreList = callPrintOpenApiService.callExamStudentScore(2L,thirdExamId, courseCode);
         System.out.println(JSON.toJSONString(examStudentScoreList));
         return ResultUtil.ok();
     }

+ 1 - 1
teachcloud-report/src/test/java/com/qmth/teachcloud/report/report/CallPrintOpenApiServiceTest.java

@@ -22,6 +22,6 @@ public class CallPrintOpenApiServiceTest {
 
     @Test
     public void callPaperConfig() throws IOException {
-        callPrintOpenApiService.callPaperConfig(1L,"1001");
+        callPrintOpenApiService.callPaperConfig(2L,1L,"1001");
     }
 }