瀏覽代碼

课程目标达成度加入当前用户id查询

wangliang 1 年之前
父節點
當前提交
84b2c1a778
共有 15 個文件被更改,包括 126 次插入70 次删除
  1. 14 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/report/PaperStructParams.java
  2. 14 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TCFinalScore.java
  3. 13 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TRBasicInfo.java
  4. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/PrintCommonService.java
  5. 4 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TCFinalScoreService.java
  6. 6 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TCPaperStructService.java
  7. 4 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TRBasicInfoService.java
  8. 6 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
  9. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCFinalScoreServiceImpl.java
  10. 9 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCPaperStructServiceImpl.java
  11. 6 10
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRBasicInfoServiceImpl.java
  12. 15 11
      distributed-print/src/main/java/com/qmth/distributed/print/api/TCFinalScoreController.java
  13. 14 11
      distributed-print/src/main/java/com/qmth/distributed/print/api/TCPaperStructController.java
  14. 3 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/TCUsualScoreController.java
  15. 12 9
      distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java

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

@@ -1,5 +1,6 @@
 package com.qmth.distributed.print.business.bean.params.report;
 
+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.PaperStructDimensionResult;
@@ -36,6 +37,19 @@ public class PaperStructParams implements Serializable {
     @NotEmpty(message = "试卷蓝图结构不能为空")
     private List<PaperStructDimensionResult> paperStruct;
 
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "教学课程id")
+    @NotNull(message = "教学课程id不能为空")
+    private Long teachCourseId;
+
+    public Long getTeachCourseId() {
+        return teachCourseId;
+    }
+
+    public void setTeachCourseId(Long teachCourseId) {
+        this.teachCourseId = teachCourseId;
+    }
+
     public Long getExamId() {
         return examId;
     }

+ 14 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TCFinalScore.java

@@ -1,5 +1,6 @@
 package com.qmth.distributed.print.business.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.distributed.print.business.enums.SourceEnum;
@@ -59,6 +60,11 @@ public class TCFinalScore extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "来源,EXCEL_IMPORT:excel导入,SYNC:数据同步")
     private SourceEnum source;
 
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "教学课程id")
+    @TableField(exist = false)
+    private Long teachCourseId;
+
     public TCFinalScore() {
 
     }
@@ -94,6 +100,14 @@ public class TCFinalScore extends BaseEntity implements Serializable {
         updateInfo(userId);
     }
 
+    public Long getTeachCourseId() {
+        return teachCourseId;
+    }
+
+    public void setTeachCourseId(Long teachCourseId) {
+        this.teachCourseId = teachCourseId;
+    }
+
     public SourceEnum getSource() {
         return source;
     }

+ 13 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TRBasicInfo.java

@@ -93,6 +93,11 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
     @TableField(exist = false)
     private ReportResult reportResult;
 
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "教学课程id")
+    @TableField(exist = false)
+    private Long teachCourseId;
+
     public TRBasicInfo() {
 
     }
@@ -157,6 +162,14 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.reportResult = new ReportResult();
     }
 
+    public Long getTeachCourseId() {
+        return teachCourseId;
+    }
+
+    public void setTeachCourseId(Long teachCourseId) {
+        this.teachCourseId = teachCourseId;
+    }
+
     public ReportResult getReportResult() {
         return reportResult;
     }

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

@@ -323,6 +323,7 @@ public interface PrintCommonService {
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      */
-    public void getLock(Long examId, String courseCode, String paperNumber);
+    public void getLock(Long examId, String courseCode, String paperNumber,Long teachCourseId);
 }

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

@@ -113,8 +113,9 @@ public interface TCFinalScoreService extends IService<TCFinalScore> {
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      */
-    public void getFinalScoreSyncLock(Long examId, String courseCode, String paperNumber);
+    public void getFinalScoreSyncLock(Long examId, String courseCode, String paperNumber, Long teachCourseId);
 
     /**
      * 获取期末考试导入锁
@@ -122,6 +123,7 @@ public interface TCFinalScoreService extends IService<TCFinalScore> {
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      */
-    public void getFinalScoreImportLock(Long examId, String courseCode, String paperNumber);
+    public void getFinalScoreImportLock(Long examId, String courseCode, String paperNumber, Long teachCourseId);
 }

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

@@ -45,10 +45,11 @@ public interface TCPaperStructService extends IService<TCPaperStruct> {
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      * @return
      * @throws IOException
      */
-    public Map<String, String> paperStructSync(Long examId, String courseCode, String paperNumber) throws IOException;
+    public Map<String, String> paperStructSync(Long examId, String courseCode, String paperNumber, Long teachCourseId) throws IOException;
 
     /**
      * 根据考试id/科目编辑/试卷编码查询数据
@@ -66,8 +67,9 @@ public interface TCPaperStructService extends IService<TCPaperStruct> {
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      */
-    public void getPaperStructSyncLock(Long examId, String courseCode, String paperNumber);
+    public void getPaperStructSyncLock(Long examId, String courseCode, String paperNumber, Long teachCourseId);
 
     /**
      * 获取试卷结构导入锁
@@ -75,6 +77,7 @@ public interface TCPaperStructService extends IService<TCPaperStruct> {
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      */
-    public void getPaperStructImportLock(Long examId, String courseCode, String paperNumber);
+    public void getPaperStructImportLock(Long examId, String courseCode, String paperNumber, Long teachCourseId);
 }

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

@@ -128,20 +128,18 @@ public interface TRBasicInfoService extends IService<TRBasicInfo> {
     /**
      * 查找课程评价值
      *
-     * @param examId
-     * @param courseCode
+     * @param teachCourseId
      * @return
      */
-    public CourseWeightResult findCourseWeightResultRmi(Long examId, String courseCode);
+    public CourseWeightResult findCourseWeightResultRmi(Long teachCourseId);
 
     /**
      * 查找课程评价值
      *
-     * @param examId
-     * @param courseCode
+     * @param teachCourseId
      * @return
      */
-    public List<CourseWeightDto> findCourseWeightDtoRmi(Long examId, String courseCode);
+    public List<CourseWeightDto> findCourseWeightDtoRmi(Long teachCourseId);
 
     /**
      * 清除报告数据

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

@@ -538,13 +538,14 @@ public class PrintCommonServiceImpl implements PrintCommonService {
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      */
     @Override
-    public void getLock(Long examId, String courseCode, String paperNumber) {
-        tcFinalScoreService.getFinalScoreSyncLock(examId, courseCode, paperNumber);
-        tcFinalScoreService.getFinalScoreImportLock(examId, courseCode, paperNumber);
-        tcPaperStructService.getPaperStructSyncLock(examId, courseCode, paperNumber);
-        tcPaperStructService.getPaperStructImportLock(examId, courseCode, paperNumber);
+    public void getLock(Long examId, String courseCode, String paperNumber, Long teachCourseId) {
+        tcFinalScoreService.getFinalScoreSyncLock(examId, courseCode, paperNumber, teachCourseId);
+        tcFinalScoreService.getFinalScoreImportLock(examId, courseCode, paperNumber, teachCourseId);
+        tcPaperStructService.getPaperStructSyncLock(examId, courseCode, paperNumber, teachCourseId);
+        tcPaperStructService.getPaperStructImportLock(examId, courseCode, paperNumber, teachCourseId);
     }
 
     /**

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

@@ -352,8 +352,8 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
      * @param paperNumber
      */
     @Override
-    public void getFinalScoreSyncLock(Long examId, String courseCode, String paperNumber) {
-        String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber;
+    public void getFinalScoreSyncLock(Long examId, String courseCode, String paperNumber, Long teachCourseId) {
+        String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber + "_" + teachCourseId;
         Object o = redisUtil.get(lockKey);
         if (Objects.nonNull(o)) {
             throw ExceptionResultEnum.ERROR.exception("正在同步期末成绩数据,请稍候再试!");
@@ -368,8 +368,8 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
      * @param paperNumber
      */
     @Override
-    public void getFinalScoreImportLock(Long examId, String courseCode, String paperNumber) {
-        String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber;
+    public void getFinalScoreImportLock(Long examId, String courseCode, String paperNumber, Long teachCourseId) {
+        String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber + "_" + teachCourseId;
         Object o = redisUtil.get(lockKey);
         if (Objects.nonNull(o)) {
             throw ExceptionResultEnum.ERROR.exception("正在导入期末成绩数据,请稍候再试!");

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

@@ -193,12 +193,13 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      * @return
      * @throws IOException
      */
     @Override
     @Transactional
-    public Map<String, String> paperStructSync(Long examId, String courseCode, String paperNumber) throws IOException {
+    public Map<String, String> paperStructSync(Long examId, String courseCode, String paperNumber, Long teachCourseId) throws IOException {
         Map<String, String> messageMap = new LinkedHashMap<>();
         try {
             SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
@@ -246,7 +247,7 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
                 } else {
                     tcPaperStructService.remove(examId, courseCode, paperNumber);
                     MarkPaper markPaper = printCommonService.getMarkPaper(examId, paperNumber);
-                    CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
+                    CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(teachCourseId);
                     tcPaperStruct = new TCPaperStruct(examId, courseCode, markPaper.getCourseName(), paperNumber, JacksonUtil.parseJson(paperStructDimensionResultList), sysUser.getId(), courseWeightResult.getDimensionSign());
                     List<MarkQuestion> markQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null);
                     if (CollectionUtils.isEmpty(markQuestionList)) {
@@ -304,10 +305,11 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      */
     @Override
-    public void getPaperStructSyncLock(Long examId, String courseCode, String paperNumber) {
-        String lockKey = SystemConstant.REDIS_PAPER_STRUCT_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber;
+    public void getPaperStructSyncLock(Long examId, String courseCode, String paperNumber, Long teachCourseId) {
+        String lockKey = SystemConstant.REDIS_PAPER_STRUCT_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber + "_" + teachCourseId;
         Object o = redisUtil.get(lockKey);
         if (Objects.nonNull(o)) {
             throw ExceptionResultEnum.ERROR.exception("正在同步试卷蓝图数据,请稍候再试!");
@@ -320,10 +322,11 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
      * @param examId
      * @param courseCode
      * @param paperNumber
+     * @param teachCourseId
      */
     @Override
-    public void getPaperStructImportLock(Long examId, String courseCode, String paperNumber) {
-        String lockKey = SystemConstant.REDIS_PAPER_STRUCT_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber;
+    public void getPaperStructImportLock(Long examId, String courseCode, String paperNumber, Long teachCourseId) {
+        String lockKey = SystemConstant.REDIS_PAPER_STRUCT_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber + "_" + teachCourseId;
         Object o = redisUtil.get(lockKey);
         if (Objects.nonNull(o)) {
             throw ExceptionResultEnum.ERROR.exception("正在导入试卷蓝图数据,请稍候再试!");

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

@@ -815,14 +815,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
     /**
      * 查找课程评价值
      *
-     * @param examId
-     * @param courseCode
+     * @param teachCourseId
      * @return
      */
     @Override
-    public CourseWeightResult findCourseWeightResultRmi(Long examId, String courseCode) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        CourseWeightResult courseWeightResult = courseWeightService.findCourseWeight(examId, courseCode, sysUser.getId());
+    public CourseWeightResult findCourseWeightResultRmi(Long teachCourseId) {
+        CourseWeightResult courseWeightResult = courseWeightService.findCourseWeight(teachCourseId);
         Objects.requireNonNull(courseWeightResult, "未设置课程目标数据");
         Objects.requireNonNull(courseWeightResult.getCustomRate(), "未设置平时成绩权重");
         Objects.requireNonNull(courseWeightResult.getDefaultRate(), "未设置期末考试权重");
@@ -838,14 +836,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
     /**
      * 查找课程评价值
      *
-     * @param examId
-     * @param courseCode
+     * @param teachCourseId
      * @return
      */
     @Override
-    public List<CourseWeightDto> findCourseWeightDtoRmi(Long examId, String courseCode) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        CourseWeightResult courseWeightResult = courseWeightService.findCourseWeight(examId, courseCode, sysUser.getId());
+    public List<CourseWeightDto> findCourseWeightDtoRmi(Long teachCourseId) {
+        CourseWeightResult courseWeightResult = courseWeightService.findCourseWeight(teachCourseId);
         if (Objects.nonNull(courseWeightResult) && !CollectionUtils.isEmpty(courseWeightResult.getSubmitForm())) {
             return courseWeightResult.getSubmitForm();
         }

+ 15 - 11
distributed-print/src/main/java/com/qmth/distributed/print/api/TCFinalScoreController.java

@@ -79,8 +79,9 @@ public class TCFinalScoreController {
     @ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
     public void finalScoreTemplateDownload(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                            @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                                           @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
-        printCommonService.getLock(examId, courseCode, paperNumber);
+                                           @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                                           @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
+        printCommonService.getLock(examId, courseCode, paperNumber, teachCourseId);
         TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
         List<ExcelField> excelFieldList = new ArrayList<>();
         excelFieldList.addAll(new ArrayList<>(Arrays.asList(new ExcelField("studentCode", "学号", true), new ExcelField("name", "姓名", true), new ExcelField("score", "成绩", true))));
@@ -114,9 +115,10 @@ public class TCFinalScoreController {
     public Result finalScoreImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
                                    @ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                    @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                                   @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
-        printCommonService.getLock(examId, courseCode, paperNumber);
-        String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber;
+                                   @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                                   @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
+        printCommonService.getLock(examId, courseCode, paperNumber, teachCourseId);
+        String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber + "_" + teachCourseId;
         boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_LOCK_IMPORT_EXAM_DATA_TIME_OUT);
         if (!lock) {
             throw ExceptionResultEnum.ERROR.exception("正在导入数据,请稍候再试!");
@@ -144,9 +146,10 @@ public class TCFinalScoreController {
     @Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
     public Result finalScoreSync(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                  @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                                 @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
-        printCommonService.getLock(examId, courseCode, paperNumber);
-        String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber;
+                                 @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                                 @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
+        printCommonService.getLock(examId, courseCode, paperNumber, teachCourseId);
+        String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber + "_" + teachCourseId;
         boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_LOCK_IMPORT_EXAM_DATA_TIME_OUT);
         if (!lock) {
             throw ExceptionResultEnum.ERROR.exception("正在同步数据,请稍候再试!");
@@ -201,7 +204,7 @@ public class TCFinalScoreController {
         TCFinalScore tcFinalScoreDb = tcFinalScoreService.getById(tcFinalScore.getId());
         Objects.requireNonNull(tcFinalScoreDb, "未找到期末成绩信息");
 
-        printCommonService.getLock(tcFinalScoreDb.getExamId(), tcFinalScoreDb.getCourseCode(), tcFinalScoreDb.getPaperNumber());
+        printCommonService.getLock(tcFinalScoreDb.getExamId(), tcFinalScoreDb.getCourseCode(), tcFinalScoreDb.getPaperNumber(), tcFinalScore.getTeachCourseId());
 
         List<TCFinalScoreDto> tcFinalScoreDtoList = GsonUtil.fromJson(tcFinalScore.getScoreDetail(), new TypeToken<List<TCFinalScoreDto>>() {
         }.getType());
@@ -228,11 +231,12 @@ public class TCFinalScoreController {
     @ApiResponses({@ApiResponse(code = 200, message = "编辑", response = EditResult.class)})
     @Transactional
     public Result finalScoreEnable(@ApiParam(value = "主键", required = true) @RequestParam Long id,
-                                   @ApiParam(value = "启用/禁用", required = true) @RequestParam Boolean enable) throws IOException {
+                                   @ApiParam(value = "启用/禁用", required = true) @RequestParam Boolean enable,
+                                   @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
         TCFinalScore tcFinalScoreDb = tcFinalScoreService.getById(id);
         Objects.requireNonNull(tcFinalScoreDb, "未找到期末成绩信息");
 
-        printCommonService.getLock(tcFinalScoreDb.getExamId(), tcFinalScoreDb.getCourseCode(), tcFinalScoreDb.getPaperNumber());
+        printCommonService.getLock(tcFinalScoreDb.getExamId(), tcFinalScoreDb.getCourseCode(), tcFinalScoreDb.getPaperNumber(), teachCourseId);
 
         TCFinalScore tcFinalScoreSource = new TCFinalScore();
         BeanUtils.copyProperties(tcFinalScoreDb, tcFinalScoreSource);

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

@@ -80,9 +80,10 @@ public class TCPaperStructController {
     public Result finalScorePaperStructImport(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
                                               @ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                               @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                                              @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
-        printCommonService.getLock(examId, courseCode, paperNumber);
-        String lockKey = SystemConstant.REDIS_PAPER_STRUCT_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber;
+                                              @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                                              @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
+        printCommonService.getLock(examId, courseCode, paperNumber, teachCourseId);
+        String lockKey = SystemConstant.REDIS_PAPER_STRUCT_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber + "_" + teachCourseId;
         boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_PAPER_STRUCT_TIME_OUT);
         if (!lock) {
             throw ExceptionResultEnum.ERROR.exception("正在导入数据,请稍候再试!");
@@ -110,16 +111,17 @@ public class TCPaperStructController {
     @Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
     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 {
-        printCommonService.getLock(examId, courseCode, paperNumber);
-        String lockKey = SystemConstant.REDIS_PAPER_STRUCT_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber;
+                                                     @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                                                     @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
+        printCommonService.getLock(examId, courseCode, paperNumber, teachCourseId);
+        String lockKey = SystemConstant.REDIS_PAPER_STRUCT_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber + "_" + teachCourseId;
         boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_PAPER_STRUCT_TIME_OUT);
         if (!lock) {
             throw ExceptionResultEnum.ERROR.exception("正在同步数据,请稍候再试!");
         }
         Map<String, String> map = null;
         try {
-            map = tcPaperStructService.paperStructSync(examId, courseCode, paperNumber);
+            map = tcPaperStructService.paperStructSync(examId, courseCode, paperNumber, teachCourseId);
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
@@ -142,8 +144,8 @@ public class TCPaperStructController {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
-        printCommonService.getLock(paperStructParams.getExamId(), paperStructParams.getCourseCode(), paperStructParams.getPaperNumber());
-        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(paperStructParams.getExamId(), paperStructParams.getCourseCode());
+        printCommonService.getLock(paperStructParams.getExamId(), paperStructParams.getCourseCode(), paperStructParams.getPaperNumber(), paperStructParams.getTeachCourseId());
+        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(paperStructParams.getTeachCourseId());
         for (CourseWeightDto c : courseWeightResult.getSubmitForm()) {
             for (PaperStructDimensionResult paperStructDimensionResult : paperStructParams.getPaperStruct()) {
                 Objects.requireNonNull(paperStructDimensionResult.getMainNumber(), "大题号为空");
@@ -192,7 +194,8 @@ public class TCPaperStructController {
     @ApiResponses({@ApiResponse(code = 200, message = "试卷蓝图保存", response = PaperStructDimensionResult.class)})
     public Result finalScorePaperStructQuery(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                              @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                                             @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
+                                             @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                                             @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
         List<PaperStructDimensionResult> paperStructDimensionResultList = null;
         TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
         if (Objects.isNull(tcPaperStruct) || (Objects.isNull(tcPaperStruct.getPaperStruct()) && Objects.isNull(tcPaperStruct.getPaperStructDimension()))) {
@@ -205,7 +208,7 @@ public class TCPaperStructController {
                 paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), markQuestion.getTotalScore()));
             }
         } else {
-            CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
+            CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(teachCourseId);
             if (Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue()) {
                 trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
                 paperStructDimensionResultList = this.getPaperStructDimensionResult(tcPaperStruct, paperStructDimensionResultList);

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

@@ -84,8 +84,9 @@ public class TCUsualScoreController {
     @ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
     public void usualScoreTemplateDownload(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                            @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                                           @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
-        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
+                                           @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                                           @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
+        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(teachCourseId);
         List<CourseWeightDto> courseWeightDtoList = courseWeightResult.getSubmitForm();
 
         List<ExcelField> excelFieldList = new ArrayList<>();

+ 12 - 9
distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java

@@ -115,12 +115,13 @@ public class TRBasicInfoController {
     @Transactional
     public Result reportView(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                              @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                             @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) {
+                             @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
+                             @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) {
         MarkPaper markPaper = printCommonService.getMarkPaper(examId, paperNumber);
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         TRBasicInfo trBasicInfo = trBasicInfoService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
 
-        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
+        CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(teachCourseId);
         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>>() {
@@ -180,7 +181,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(), trBasicInfoService.findCourseWeightResultRmi(trBasicInfo.getExamId(), trBasicInfo.getCourseCode()));
+                trBasicInfoDb = trBasicInfoService.getReportView(trBasicInfoDb, markPaper, sysUser.getId(), trBasicInfoService.findCourseWeightResultRmi(trBasicInfo.getTeachCourseId()));
             } else {
                 trBasicInfoDb.updateInfo(trBasicInfo, sysUser.getId());
             }
@@ -206,7 +207,8 @@ public class TRBasicInfoController {
     @Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
     public void reportExport(@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 = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
         File txtFileTemp = null, fileTemp = null;
         try {
             Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
@@ -217,7 +219,7 @@ public class TRBasicInfoController {
             Objects.requireNonNull(trBasicInfo.getCourseEvaluationResult(), "没有课程目标信息");
             Objects.requireNonNull(trBasicInfo.getCourseEvaluationResultDetail(), "没有课程考生信息");
 
-            CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
+            CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(teachCourseId);
             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>>() {
@@ -237,8 +239,8 @@ public class TRBasicInfoController {
             if (Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign()) && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != courseWeightResult.getWeightSettingSign().longValue()) {
                 printCommonService.getMarkPaper(examId, 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);
+                this.reportView(examId, courseCode, paperNumber, teachCourseId);
+                this.reportExport(examId, courseCode, paperNumber, teachCourseId);
             } else {
                 //评价样本的基本信息
                 String period = Objects.nonNull(trBasicInfo.getPeriod()) ? trBasicInfo.getPeriod() : null;
@@ -316,7 +318,8 @@ public class TRBasicInfoController {
     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,
-                                   @ApiParam(value = "true:报告,false:成绩管理", required = true) @RequestParam boolean report) throws IOException {
+                                   @ApiParam(value = "true:报告,false:成绩管理", required = true) @RequestParam boolean report,
+                                   @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
         ReportChangeResult reportChangeResult = new ReportChangeResult();
         List<TCUsualScore> tcUsualScoreList = tcUsualScoreService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
         if (CollectionUtils.isNotEmpty(tcUsualScoreList)) {
@@ -325,7 +328,7 @@ public class TRBasicInfoController {
             List<TCUsualScoreDto> tcUsualScoreDtoList = JSONArray.parseArray(tcUsualScore.getScore(), TCUsualScoreDto.class);
             List<String> usualScoreList = tcUsualScoreDtoList.stream().map(s -> s.getName()).collect(Collectors.toList());
 
-            List<CourseWeightDto> courseWeightDtoList = trBasicInfoService.findCourseWeightDtoRmi(examId, courseCode);
+            List<CourseWeightDto> courseWeightDtoList = trBasicInfoService.findCourseWeightDtoRmi(teachCourseId);
             List<String> courseTargetList = new ArrayList<>(courseWeightDtoList.size());
             if (CollectionUtils.isNotEmpty(courseWeightDtoList)) {
                 courseWeightDtoList.stream().peek(e -> {