Browse Source

3.2.4 归档问题修复

xiaofei 2 years ago
parent
commit
11ea9bbf8b

+ 16 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TSyncExamLog.java

@@ -36,10 +36,14 @@ public class TSyncExamLog implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     private Long schoolId;
     private Long schoolId;
 
 
-    @ApiModelProperty(value = "云阅卷考试id")
+    @ApiModelProperty(value = "考试id")
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     private Long examId;
     private Long examId;
 
 
+    @ApiModelProperty(value = "云阅卷考试id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long thirdRelateId;
+
     @ApiModelProperty(value = "学期id")
     @ApiModelProperty(value = "学期id")
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     private Long semesterId;
     private Long semesterId;
@@ -104,11 +108,12 @@ public class TSyncExamLog implements Serializable {
     public TSyncExamLog() {
     public TSyncExamLog() {
     }
     }
 
 
-    public TSyncExamLog(Long id, Long schoolId, Long examId, Long semesterId, String examName, TaskStatusEnum status, Long createId, Long createTime) {
-        this.id = id;
+    public TSyncExamLog(Long schoolId, Long semesterId, Long examId, Long thirdRelateId, String examName, TaskStatusEnum status, Long createId, Long createTime) {
+        this.id = SystemConstant.getDbUuid();
         this.schoolId = schoolId;
         this.schoolId = schoolId;
         this.examId = examId;
         this.examId = examId;
         this.semesterId = semesterId;
         this.semesterId = semesterId;
+        this.thirdRelateId = thirdRelateId;
         this.examName = examName;
         this.examName = examName;
         this.status = status;
         this.status = status;
         this.createId = createId;
         this.createId = createId;
@@ -147,6 +152,14 @@ public class TSyncExamLog implements Serializable {
         this.examId = examId;
         this.examId = examId;
     }
     }
 
 
+    public Long getThirdRelateId() {
+        return thirdRelateId;
+    }
+
+    public void setThirdRelateId(Long thirdRelateId) {
+        this.thirdRelateId = thirdRelateId;
+    }
+
     public String getExamName() {
     public String getExamName() {
         return examName;
         return examName;
     }
     }

+ 6 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TSyncExamStudentScore.java

@@ -45,10 +45,14 @@ public class TSyncExamStudentScore implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     private Long semesterId;
     private Long semesterId;
 
 
-    @ApiModelProperty(value = "云阅卷考试id")
+    @ApiModelProperty(value = "考试id")
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     private Long examId;
     private Long examId;
 
 
+    @ApiModelProperty(value = "云阅卷考试id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long thirdRelateId;
+
     @ApiModelProperty(value = "云阅卷考试标识")
     @ApiModelProperty(value = "云阅卷考试标识")
     private String examCode;
     private String examCode;
 
 
@@ -146,6 +150,7 @@ public class TSyncExamStudentScore implements Serializable {
         this.majorName = String.valueOf(map.get("majorName"));
         this.majorName = String.valueOf(map.get("majorName"));
         this.clazzId = (Long) map.get("clazzId");
         this.clazzId = (Long) map.get("clazzId");
         this.examId = Long.parseLong(String.valueOf(map.get("examId")));
         this.examId = Long.parseLong(String.valueOf(map.get("examId")));
+        this.thirdRelateId = Long.parseLong(String.valueOf(map.get("thirdRelateId")));
         this.examCode = (String) map.get("examCode");
         this.examCode = (String) map.get("examCode");
         this.examNumber = (String) map.get("examNumber");
         this.examNumber = (String) map.get("examNumber");
         this.studentCode = (String) map.get("studentCode");
         this.studentCode = (String) map.get("studentCode");

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

@@ -14,7 +14,7 @@ public interface TSyncExamLogService extends IService<TSyncExamLog> {
 
 
     IPage<TSyncExamLog> list(Page<TSyncExamLog> iPage, Long semesterId, Long examId);
     IPage<TSyncExamLog> list(Page<TSyncExamLog> iPage, Long semesterId, Long examId);
 
 
-    void syncStudentScore(Long semesterId, Long examId);
+    void syncStudentScore(Long semesterId, Long examId, Long thirdRelateId);
 
 
     TSyncExamLog selectBySchoolIdAndSemesterIdAndExamId(Long schoolId, Long semesterId, Long examId);
     TSyncExamLog selectBySchoolIdAndSemesterIdAndExamId(Long schoolId, Long semesterId, Long examId);
 }
 }

+ 22 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java

@@ -1158,7 +1158,7 @@ public class PrintCommonServiceImpl implements PrintCommonService {
             String prefix = convertUtil.randomNumberPrefix(examShortCode, courseShortCode, map.get(String.valueOf(basicClazzId)), basicCardRule == null ? null : basicCardRule.getExamNumberDigit());
             String prefix = convertUtil.randomNumberPrefix(examShortCode, courseShortCode, map.get(String.valueOf(basicClazzId)), basicCardRule == null ? null : basicCardRule.getExamNumberDigit());
             StringJoiner stringJoiner = new StringJoiner("-");
             StringJoiner stringJoiner = new StringJoiner("-");
             stringJoiner.add("ticketNumber").add(schoolId.toString()).add(semesterId);
             stringJoiner.add("ticketNumber").add(schoolId.toString()).add(semesterId);
-            SerialNumberParams ticketNumberParams = new SerialNumberParams(SystemConstant.NUMBER_CACHE + stringJoiner , prefix, StringUtils.isBlank(prefix) ? 8 : basicCardRule.getExamNumberDigit() - prefix.length());
+            SerialNumberParams ticketNumberParams = new SerialNumberParams(SystemConstant.NUMBER_CACHE + stringJoiner, prefix, StringUtils.isBlank(prefix) ? 8 : basicCardRule.getExamNumberDigit() - prefix.length());
             examStudent.setTicketNumber(createTicketNumber(ticketNumberParams));
             examStudent.setTicketNumber(createTicketNumber(ticketNumberParams));
             examStudent.setSiteNumber(String.valueOf(atomicInteger.getAndIncrement()));
             examStudent.setSiteNumber(String.valueOf(atomicInteger.getAndIncrement()));
             examStudent.setExtendFields(extendFields);
             examStudent.setExtendFields(extendFields);
@@ -1237,34 +1237,42 @@ public class PrintCommonServiceImpl implements PrintCommonService {
 
 
     @Override
     @Override
     public String createCourseSequence(Long schoolId, String courseCode) {
     public String createCourseSequence(Long schoolId, String courseCode) {
-        String sequence = commonCacheService.addExamTaskSequence(schoolId, courseCode);
-        if ("0".equals(sequence)) {
-            QueryWrapper<ExamTask> queryWrapper = new QueryWrapper<>();
-            queryWrapper.lambda().eq(ExamTask::getSchoolId, schoolId).eq(ExamTask::getCourseCode, courseCode);
-            List<ExamTask> examTasks = examTaskService.list(queryWrapper);
-            if (examTasks != null && examTasks.size() > 0) {
-                String maxSequence = examTasks.stream().max(Comparator.comparing(ExamTask::getSequence)).get().getSequence();
-                if (StringUtils.isNotBlank(maxSequence)) {
-                    sequence = maxSequence;
+        boolean lock = redisUtil.lock(SystemConstant.REDIS_LOCK_COURSE_CODE_SEQUENCE_PREFIX + schoolId + "-" + courseCode, SystemConstant.REDIS_LOCK_PAPER_NUMBER_TIME_OUT);
+        if (!lock) {
+            throw ExceptionResultEnum.ERROR.exception("正在生成课程编号中,请稍候再试!");
+        }
+        try {
+            String sequence = commonCacheService.addExamTaskSequence(schoolId, courseCode);
+            if ("0".equals(sequence)) {
+                QueryWrapper<ExamTask> queryWrapper = new QueryWrapper<>();
+                queryWrapper.lambda().eq(ExamTask::getSchoolId, schoolId).eq(ExamTask::getCourseCode, courseCode);
+                List<ExamTask> examTasks = examTaskService.list(queryWrapper);
+                if (examTasks != null && examTasks.size() > 0) {
+                    String maxSequence = examTasks.stream().max(Comparator.comparing(ExamTask::getSequence)).get().getSequence();
+                    if (StringUtils.isNotBlank(maxSequence)) {
+                        sequence = maxSequence;
+                    }
                 }
                 }
             }
             }
+            return commonCacheService.updateExamTaskSequence(schoolId, courseCode, sequence);
+        } finally {
+            redisUtil.releaseLock(SystemConstant.REDIS_LOCK_COURSE_CODE_SEQUENCE_PREFIX + schoolId + "-" + courseCode);
         }
         }
-        return commonCacheService.updateExamTaskSequence(schoolId, courseCode, sequence);
     }
     }
 
 
     @Override
     @Override
-    public void updateGradeBatchStatus(Long schoolId,Long examId, String paperNumber, String paperType) {
+    public void updateGradeBatchStatus(Long schoolId, Long examId, String paperNumber, String paperType) {
         QueryWrapper<GradeBatchPaper> gradeBatchPaperQueryWrapper = new QueryWrapper<>();
         QueryWrapper<GradeBatchPaper> gradeBatchPaperQueryWrapper = new QueryWrapper<>();
         gradeBatchPaperQueryWrapper.lambda()
         gradeBatchPaperQueryWrapper.lambda()
                 .eq(GradeBatchPaper::getSchoolId, schoolId)
                 .eq(GradeBatchPaper::getSchoolId, schoolId)
-                .eq(GradeBatchPaper::getExamId,examId)
+                .eq(GradeBatchPaper::getExamId, examId)
                 .eq(GradeBatchPaper::getPaperNumber, paperNumber)
                 .eq(GradeBatchPaper::getPaperNumber, paperNumber)
                 .eq(GradeBatchPaper::getPaperType, paperType);
                 .eq(GradeBatchPaper::getPaperType, paperType);
         List<GradeBatchPaper> gradeBatchPaperList = gradeBatchPaperService.list(gradeBatchPaperQueryWrapper);
         List<GradeBatchPaper> gradeBatchPaperList = gradeBatchPaperService.list(gradeBatchPaperQueryWrapper);
         if (!gradeBatchPaperList.isEmpty()) {
         if (!gradeBatchPaperList.isEmpty()) {
             for (GradeBatchPaper gradeBatchPaper : gradeBatchPaperList) {
             for (GradeBatchPaper gradeBatchPaper : gradeBatchPaperList) {
                 QueryWrapper<GradeBatchPaper> queryWrapperList = new QueryWrapper<>();
                 QueryWrapper<GradeBatchPaper> queryWrapperList = new QueryWrapper<>();
-                queryWrapperList.lambda().eq(GradeBatchPaper::getBatchId, gradeBatchPaper.getBatchId()).eq(GradeBatchPaper::getExamId,examId);
+                queryWrapperList.lambda().eq(GradeBatchPaper::getBatchId, gradeBatchPaper.getBatchId()).eq(GradeBatchPaper::getExamId, examId);
                 List<GradeBatchPaper> gradeBatchPaperAll = gradeBatchPaperService.list(queryWrapperList);
                 List<GradeBatchPaper> gradeBatchPaperAll = gradeBatchPaperService.list(queryWrapperList);
                 if (!gradeBatchPaperAll.isEmpty()) {
                 if (!gradeBatchPaperAll.isEmpty()) {
                     long count = gradeBatchPaperAll.stream().filter(m -> !GradeAnalyzePaperStatusEnum.READY_TO_CALCULATE.equals(m.getStatus())).count();
                     long count = gradeBatchPaperAll.stream().filter(m -> !GradeAnalyzePaperStatusEnum.READY_TO_CALCULATE.equals(m.getStatus())).count();

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

@@ -67,7 +67,7 @@ public class TSyncExamLogServiceImpl extends ServiceImpl<TSyncExamLogMapper, TSy
     }
     }
 
 
     @Override
     @Override
-    public void syncStudentScore(Long semesterId, Long examId) {
+    public void syncStudentScore(Long semesterId, Long examId, Long thirdRelateId) {
         if (semesterId == null) {
         if (semesterId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择学期");
             throw ExceptionResultEnum.ERROR.exception("请选择学期");
         }
         }
@@ -80,7 +80,8 @@ public class TSyncExamLogServiceImpl extends ServiceImpl<TSyncExamLogMapper, TSy
         // 校验任务是否进行中
         // 校验任务是否进行中
         QueryWrapper<TSyncExamLog> queryWrapper = new QueryWrapper<>();
         QueryWrapper<TSyncExamLog> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(TSyncExamLog::getSemesterId, semesterId)
         queryWrapper.lambda().eq(TSyncExamLog::getSemesterId, semesterId)
-                .eq(TSyncExamLog::getExamId, examId);
+                .eq(TSyncExamLog::getExamId, examId)
+                .eq(TSyncExamLog::getThirdRelateId, thirdRelateId);
         List<TSyncExamLog> tSyncExamLogList = this.list(queryWrapper);
         List<TSyncExamLog> tSyncExamLogList = this.list(queryWrapper);
         if (!tSyncExamLogList.isEmpty()) {
         if (!tSyncExamLogList.isEmpty()) {
             List<TSyncExamLog> notFinishTsyncExamLogList = tSyncExamLogList.stream().filter(m -> !TaskStatusEnum.FINISH.equals(m.getStatus())).collect(Collectors.toList());
             List<TSyncExamLog> notFinishTsyncExamLogList = tSyncExamLogList.stream().filter(m -> !TaskStatusEnum.FINISH.equals(m.getStatus())).collect(Collectors.toList());
@@ -94,14 +95,15 @@ public class TSyncExamLogServiceImpl extends ServiceImpl<TSyncExamLogMapper, TSy
                 UpdateWrapper<TSyncExamLog> updateWrapper = new UpdateWrapper<>();
                 UpdateWrapper<TSyncExamLog> updateWrapper = new UpdateWrapper<>();
                 updateWrapper.lambda().eq(TSyncExamLog::getSchoolId, sysUser.getSchoolId())
                 updateWrapper.lambda().eq(TSyncExamLog::getSchoolId, sysUser.getSchoolId())
                         .eq(TSyncExamLog::getSemesterId, semesterId)
                         .eq(TSyncExamLog::getSemesterId, semesterId)
-                        .eq(TSyncExamLog::getExamId, examId);
+                        .eq(TSyncExamLog::getExamId, examId)
+                        .eq(TSyncExamLog::getThirdRelateId, thirdRelateId);
                 this.remove(updateWrapper);
                 this.remove(updateWrapper);
             }
             }
         }
         }
 
 
         TSyncStmmsExam tSyncStmmsExam = tSyncStmmsExamService.getBySchoolIdAndExamId(sysUser.getSchoolId(), null, examId);
         TSyncStmmsExam tSyncStmmsExam = tSyncStmmsExamService.getBySchoolIdAndExamId(sysUser.getSchoolId(), null, examId);
         String examName = tSyncStmmsExam == null ? null : tSyncStmmsExam.getExamName();
         String examName = tSyncStmmsExam == null ? null : tSyncStmmsExam.getExamName();
-        TSyncExamLog tSyncExamLog = new TSyncExamLog(SystemConstant.getDbUuid(), sysUser.getSchoolId(), examId, semesterId, examName, TaskStatusEnum.INIT, sysUser.getId(), System.currentTimeMillis());
+        TSyncExamLog tSyncExamLog = new TSyncExamLog(sysUser.getSchoolId(), semesterId, examId, thirdRelateId, examName, TaskStatusEnum.INIT, sysUser.getId(), System.currentTimeMillis());
         boolean isSave = this.save(tSyncExamLog);
         boolean isSave = this.save(tSyncExamLog);
         if (!isSave) {
         if (!isSave) {
             throw ExceptionResultEnum.ERROR.exception("创建同步任务失败,请联系管理员");
             throw ExceptionResultEnum.ERROR.exception("创建同步任务失败,请联系管理员");

+ 5 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PushLogicServiceImpl.java

@@ -47,19 +47,20 @@ public class PushLogicServiceImpl implements PushLogicService {
         Long schoolId = tSyncExamLog.getSchoolId();
         Long schoolId = tSyncExamLog.getSchoolId();
         Long semesterId = tSyncExamLog.getSemesterId();
         Long semesterId = tSyncExamLog.getSemesterId();
         Integer examId = Math.toIntExact(tSyncExamLog.getExamId());
         Integer examId = Math.toIntExact(tSyncExamLog.getExamId());
+        Integer thirdRelateId = Math.toIntExact(tSyncExamLog.getThirdRelateId());
         List<TSyncExamStudentScore> tSyncExamStudentScoreList = new ArrayList<>();
         List<TSyncExamStudentScore> tSyncExamStudentScoreList = new ArrayList<>();
         List<String> errorTSyncExamStudentScoreList = new ArrayList<>();
         List<String> errorTSyncExamStudentScoreList = new ArrayList<>();
         Set<String> courseList = new HashSet<>();
         Set<String> courseList = new HashSet<>();
         Map<String, Object> map = new HashMap<>();
         Map<String, Object> map = new HashMap<>();
         try {
         try {
-            int totalCount = cloudMarkingTaskUtils.getStudentCount(schoolId, examId, null, null, null, null, null, null, null);
+            int totalCount = cloudMarkingTaskUtils.getStudentCount(schoolId, thirdRelateId, null, null, null, null, null, null, null);
             log.info("云阅卷:考试成绩考生数量查询接口调用,返回数量:{}", totalCount);
             log.info("云阅卷:考试成绩考生数量查询接口调用,返回数量:{}", totalCount);
             if (totalCount > 0) {
             if (totalCount > 0) {
                 int pageSize = cloudMarkingTaskUtils.getDefaultPageSize();
                 int pageSize = cloudMarkingTaskUtils.getDefaultPageSize();
                 int mod = totalCount % pageSize;
                 int mod = totalCount % pageSize;
                 int pageNos = mod == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
                 int pageNos = mod == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
                 for (int i = 1; i <= pageNos; i++) {
                 for (int i = 1; i <= pageNos; i++) {
-                    List<Map> students = cloudMarkingTaskUtils.getStudentScore(schoolId, examId, null, null, null, null, null, null, null, true, i, pageSize);
+                    List<Map> students = cloudMarkingTaskUtils.getStudentScore(schoolId, thirdRelateId, null, null, null, null, null, null, null, true, i, pageSize);
                     for (Map student : students) {
                     for (Map student : students) {
                         try {
                         try {
                             Long orgId = null, clazzId = null;
                             Long orgId = null, clazzId = null;
@@ -93,6 +94,8 @@ public class PushLogicServiceImpl implements PushLogicService {
 
 
                             student.put(SystemConstant.SCHOOL_ID, schoolId);
                             student.put(SystemConstant.SCHOOL_ID, schoolId);
                             student.put("semesterId", semesterId);
                             student.put("semesterId", semesterId);
+                            student.put("examId", examId);
+                            student.put("thirdRelateId", thirdRelateId);
                             student.put("orgId", orgId);
                             student.put("orgId", orgId);
                             student.put("userId", tSyncExamLog.getCreateId());
                             student.put("userId", tSyncExamLog.getCreateId());
                             // 成功数据
                             // 成功数据

+ 3 - 2
distributed-print-business/src/main/resources/mapper/TSyncExamLogMapper.xml

@@ -29,12 +29,12 @@
 
 
     <select id="list" resultType="com.qmth.distributed.print.business.entity.TSyncExamLog">
     <select id="list" resultType="com.qmth.distributed.print.business.entity.TSyncExamLog">
         SELECT DISTINCT
         SELECT DISTINCT
-            ets.third_relate_id examId,
+            ets.third_relate_id thirdRelateId,
             tsse.exam_name examName
             tsse.exam_name examName
         FROM
         FROM
             exam_task_sync ets
             exam_task_sync ets
                 LEFT JOIN
                 LEFT JOIN
-            t_sync_stmms_exam tsse ON ets.third_relate_id = tsse.exam_id
+            t_sync_stmms_exam tsse ON ets.exam_id = tsse.exam_id and ets.third_relate_id = tsse.exam_id
         WHERE
         WHERE
             ets.sync_status = 'FINISH'
             ets.sync_status = 'FINISH'
           AND ets.third_relate_id IS NOT NULL
           AND ets.third_relate_id IS NOT NULL
@@ -47,6 +47,7 @@
                               AND et.exam_id = be.id
                               AND et.exam_id = be.id
                       WHERE
                       WHERE
                           ets.school_id = et.school_id
                           ets.school_id = et.school_id
+                        AND ets.exam_id = et.exam_id
                         AND ets.paper_number = et.paper_number
                         AND ets.paper_number = et.paper_number
                         AND be.semester_id = #{semesterId}
                         AND be.semester_id = #{semesterId}
                         AND be.id = #{examId})
                         AND be.id = #{examId})

+ 5 - 17
distributed-print-business/src/main/resources/mapper/TSyncExamStudentScoreMapper.xml

@@ -5,9 +5,6 @@
     <sql id="headCommonSql">
     <sql id="headCommonSql">
          select
          select
             distinct tsess.id,
             distinct tsess.id,
-            bs.id as semesterId,
-            bs.name as semesterName,
-            be.name examName,
             tsess.exam_id as examId,
             tsess.exam_id as examId,
             tsess.exam_code as examCode,
             tsess.exam_code as examCode,
             tsess.name,
             tsess.name,
@@ -17,7 +14,7 @@
             tsess.college as orgName,
             tsess.college as orgName,
             tsess.clazz_name as clazzName,
             tsess.clazz_name as clazzName,
             tsess.subject_code as courseCode,
             tsess.subject_code as courseCode,
-            edc.course_name as courseName,
+            et.course_name as courseName,
             tsess.total_score as totalScore,
             tsess.total_score as totalScore,
             tsess.objective_score as objectiveScore,
             tsess.objective_score as objectiveScore,
             tsess.subjective_score as subjectiveScore,
             tsess.subjective_score as subjectiveScore,
@@ -28,18 +25,9 @@
     </sql>
     </sql>
 
 
     <sql id="middleCommonSql">
     <sql id="middleCommonSql">
-        join basic_semester bs on
-            bs.id = tsess.semester_id
-        join basic_student bs2 on
-            bs2.school_id = tsess.school_id and bs2.student_code = tsess.student_code
-        join exam_student es on
-            es.school_id = tsess.school_id and es.ticket_number = tsess.exam_number and es.student_code = tsess.student_code
-        join exam_detail_course edc on
-            edc.id = es.exam_detail_course_id
+        join exam_task_sync ets on tsess.school_id = ets.school_id and tsess.exam_id = ets.exam_id and tsess.paper_number = ets.paper_number
         join exam_task et on
         join exam_task et on
-            bs.school_id = et.school_id and es.exam_id = et.exam_id and edc.course_code = et.course_code and edc.paper_number = et.paper_number
-        join basic_exam be on
-            et.exam_id = be.id
+            ets.school_id = et.school_id and ets.exam_id = et.exam_id and ets.paper_number = et.paper_number
         join sys_user su on
         join sys_user su on
             et.user_id = su.id
             et.user_id = su.id
     </sql>
     </sql>
@@ -59,10 +47,10 @@
                 and tsess.clazz_id = #{clazzId}
                 and tsess.clazz_id = #{clazzId}
             </if>
             </if>
             <if test="courseCode != null and courseCode != ''">
             <if test="courseCode != null and courseCode != ''">
-                and edc.course_code = #{courseCode}
+                and et.course_code = #{courseCode}
             </if>
             </if>
             <if test="(courseCode == null or courseCode == '') and basicCourses.size > 0">
             <if test="(courseCode == null or courseCode == '') and basicCourses.size > 0">
-                and edc.course_code in
+                and et.course_code in
                 <foreach collection="basicCourses" item="item" index="index" open="(" separator="," close=")">
                 <foreach collection="basicCourses" item="item" index="index" open="(" separator="," close=")">
                     #{item.code}
                     #{item.code}
                 </foreach>
                 </foreach>

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

@@ -49,8 +49,9 @@ public class TSyncExamLogController {
     @ApiResponses({@ApiResponse(code = 200, message = "同步异步任务信息", response = TSyncExamLog.class)})
     @ApiResponses({@ApiResponse(code = 200, message = "同步异步任务信息", response = TSyncExamLog.class)})
     @RequestMapping(value = "/log/sync", method = RequestMethod.POST)
     @RequestMapping(value = "/log/sync", method = RequestMethod.POST)
     public Result sync(@ApiParam(value = "学期ID", required = true) @RequestParam Long semesterId,
     public Result sync(@ApiParam(value = "学期ID", required = true) @RequestParam Long semesterId,
-                       @ApiParam(value = "考试ID", required = true) @RequestParam Long examId) {
-        tSyncExamLogService.syncStudentScore(semesterId, examId);
+                       @ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
+                       @ApiParam(value = "云阅卷考试ID", required = true) @RequestParam Long thirdRelateId) {
+        tSyncExamLogService.syncStudentScore(semesterId, examId, thirdRelateId);
         return ResultUtil.ok();
         return ResultUtil.ok();
     }
     }
 }
 }

+ 1 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -440,6 +440,7 @@ public class SystemConstant {
     public static final String REDIS_LOCK_FLOW_TASK_PREFIX = "redis:lock:flow:task:";//流程节点锁
     public static final String REDIS_LOCK_FLOW_TASK_PREFIX = "redis:lock:flow:task:";//流程节点锁
     public static final String REDIS_LOCK_EXAM_TASK_FLOW_PREFIX = "redis:lock:exam:task:flow:";//考试任务流程节点锁
     public static final String REDIS_LOCK_EXAM_TASK_FLOW_PREFIX = "redis:lock:exam:task:flow:";//考试任务流程节点锁
     public static final String REDIS_LOCK_PAPER_NUMBER_PREFIX = "redis:lock:paper:number:";//试卷编号锁
     public static final String REDIS_LOCK_PAPER_NUMBER_PREFIX = "redis:lock:paper:number:";//试卷编号锁
+    public static final String REDIS_LOCK_COURSE_CODE_SEQUENCE_PREFIX = "redis:lock:courseCode:sequence:";//课程序号锁
     public static final long REDIS_LOCK_FLOW_TASK_TIME_OUT = 60L * 2;
     public static final long REDIS_LOCK_FLOW_TASK_TIME_OUT = 60L * 2;
     public static final long REDIS_LOCK_EXAM_TASK_FLOW_TIME_OUT = 60L * 2;
     public static final long REDIS_LOCK_EXAM_TASK_FLOW_TIME_OUT = 60L * 2;
     public static final String REDIS_LOCK_FLOW_PREFIX = "redis:lock:flow:";//流程锁
     public static final String REDIS_LOCK_FLOW_PREFIX = "redis:lock:flow:";//流程锁