浏览代码

修复交卷后未发送分数获取通知接口

lideyin 5 年之前
父节点
当前提交
e1070ab5d5

+ 15 - 0
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/pipeline/SyncExamDataExecutor.java

@@ -7,8 +7,10 @@ import cn.com.qmth.examcloud.commons.helpers.pipeline.TaskContext;
 import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
 import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
 import cn.com.qmth.examcloud.commons.util.JsonUtil;
+import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreNoticeQueueCloudService;
 import cn.com.qmth.examcloud.core.oe.admin.api.SyncExamDataCloudService;
 import cn.com.qmth.examcloud.core.oe.admin.api.bean.*;
+import cn.com.qmth.examcloud.core.oe.admin.api.request.AddExamScoreNoticeQueueReq;
 import cn.com.qmth.examcloud.core.oe.admin.api.request.SyncExamDataReq;
 import cn.com.qmth.examcloud.core.oe.student.api.ExamRecordDataCloudService;
 import cn.com.qmth.examcloud.core.oe.student.api.bean.StuExamQuestionBean;
@@ -24,10 +26,12 @@ import cn.com.qmth.examcloud.core.oe.task.dao.entity.ExamSyncCaptureEntity;
 import cn.com.qmth.examcloud.core.oe.task.service.ExamBossService;
 import cn.com.qmth.examcloud.core.oe.task.service.ExamRecordDataService;
 import cn.com.qmth.examcloud.support.Constants;
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import cn.com.qmth.examcloud.support.enums.ExamRecordStatus;
 import cn.com.qmth.examcloud.support.enums.SyncStatus;
 import cn.com.qmth.examcloud.support.examing.ExamBoss;
 import cn.com.qmth.examcloud.support.examing.ExamRecordData;
+import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
 import cn.com.qmth.examcloud.support.helper.FaceBiopsyHelper;
 import cn.com.qmth.examcloud.web.helpers.SequenceLockHelper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,6 +60,8 @@ public class SyncExamDataExecutor implements NodeExecuter<Long, ExamRecordData,
     @Autowired
     private ExamRecordDataCloudService examRecordDataCloudService;
     @Autowired
+    private ExamScoreNoticeQueueCloudService examScoreNoticeQueueCloudService;
+    @Autowired
     private ExamBossService examBossService;
     private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(SyncExamDataExecutor.class);
 
@@ -170,6 +176,15 @@ public class SyncExamDataExecutor implements NodeExecuter<Long, ExamRecordData,
                 this.debugLog("T004.设置并保存考试记录的同步状态,耗时..." +
                         (System.currentTimeMillis() - startTime) + " ms", examRecordDataId);
 
+                //保存成绩通知队列
+                String isPushScore = ExamCacheTransferHelper.getCachedExamProperty(examRecordData.getExamId(),
+                        examRecordData.getStudentId(), ExamProperties.PUSH_SCORE.name()).getValue();
+                if (Constants.isTrue.equals(isPushScore)) {
+                    AddExamScoreNoticeQueueReq req = new AddExamScoreNoticeQueueReq();
+                    req.setRootOrgId(rootOrgId);
+                    examScoreNoticeQueueCloudService.addExamScoreNoticeQueue(req);
+                }
+
                 outList.add(new KeyValuePair<>(key, examRecordData));
 
                 this.debugLog("sync data and change status success...", examRecordDataId);