deason 10 сар өмнө
parent
commit
ae11befba0

+ 6 - 6
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/job/AfterHandInExamJobHandler.java

@@ -32,17 +32,16 @@ public class AfterHandInExamJobHandler {
     private ExamRecordDataService examRecordDataService;
 
     public void run(int shardTotal, int shardIndex, String jobParam) throws Exception {
-        int batchNo = 0, batchSize = 200;
-        int sumTodoSize = 0;
+        int pageNo = 0, pageSize = 200, sumTodoSize = 0;
         Long startId = 0L;
+
         while (true) {
             List<ExamRecordDataEntity> todoList = examRecordDataService.getExamRecordDataUnSyncList(
-                    shardTotal, shardIndex, batchSize, startId, ExamRecordStatus.EXAM_HAND_IN, ExamRecordStatus.EXAM_AUTO_HAND_IN);
+                    shardTotal, shardIndex, pageSize, startId, ExamRecordStatus.EXAM_HAND_IN, ExamRecordStatus.EXAM_AUTO_HAND_IN);
 
-            batchNo++;
+            pageNo++;
             sumTodoSize += todoList.size();
-            log.warn("   分片任务_STEP2_{}_{}  sumTodoSize:{}  curTodoSize:{}  batchNo:{}  startId:{}",
-                    shardTotal, shardIndex, sumTodoSize, todoList.size(), batchNo, startId);
+            log.warn("   分片任务_交卷后_{}_{} pageNo:{} 当前条数:{} 累计条数:{}", shardTotal, shardIndex, pageNo, todoList.size(), sumTodoSize);
 
             if (CollectionUtils.isEmpty(todoList)) {
                 break;
@@ -123,6 +122,7 @@ public class AfterHandInExamJobHandler {
         long hour = diffSecond / 3600;
         long minute = diffSecond / 60 - hour * 60;
         long second = diffSecond - hour * 3600 - minute * 60;
+
         StringBuilder result = new StringBuilder();
         if (hour > 0) {
             result.append(hour).append("小时");

+ 6 - 6
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/job/BeforeHandInExamJobHandler.java

@@ -50,17 +50,16 @@ public class BeforeHandInExamJobHandler {
     private RedisClient redisClient;
 
     public void run(int shardTotal, int shardIndex, String jobParam) throws Exception {
-        int batchNo = 0, batchSize = 200;
-        int sumTodoSize = 0;
+        int pageNo = 0, pageSize = 200, sumTodoSize = 0;
         Long startId = 0L;
+
         while (true) {
             List<ExamRecordDataEntity> todoList = examRecordDataService.getExamRecordDataUnSyncList(
-                    shardTotal, shardIndex, batchSize, startId, ExamRecordStatus.EXAM_ING);
+                    shardTotal, shardIndex, pageSize, startId, ExamRecordStatus.EXAM_ING);
 
-            batchNo++;
+            pageNo++;
             sumTodoSize += todoList.size();
-            log.warn("  分片任务_STEP1_{}_{}  sumTodoSize:{}  curTodoSize:{}  batchNo:{}  startId:{}",
-                    shardTotal, shardIndex, sumTodoSize, todoList.size(), batchNo, startId);
+            log.warn("  分片任务_交卷前_{}_{} pageNo:{} 当前条数:{} 累计条数:{}", shardTotal, shardIndex, pageNo, todoList.size(), sumTodoSize);
 
             if (CollectionUtils.isEmpty(todoList)) {
                 break;
@@ -182,6 +181,7 @@ public class BeforeHandInExamJobHandler {
 
             long startTime = System.currentTimeMillis();
             examRecordDataCloudService.handInExam(req);
+
             long cost = (System.currentTimeMillis() - startTime) / 1000;
             log.warn("autoHandInExam ok, examRecordDataId:{}, studentId:{}, examType:{}, cost:{}s",
                     examRecordDataCache.getId(), examRecordDataCache.getStudentId(), examRecordDataCache.getExamType(), cost);

+ 4 - 4
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/job/FaceVerifyJobHandler.java

@@ -59,7 +59,7 @@ public class FaceVerifyJobHandler {
             examRecordDataIds.addAll(moreExamRecordDataIds);
 
             if (CollectionUtils.isEmpty(examRecordDataIds)) {
-                log.warn("分片任务_FACE_{}_{} 暂无待处理记录!", shardTotal, shardIndex);
+                log.warn("分片任务_人脸比对_{}_{} 暂无待处理记录!", shardTotal, shardIndex);
                 return;
             }
         }
@@ -67,12 +67,12 @@ public class FaceVerifyJobHandler {
         Set<Long> todoIds = new HashSet<>(examRecordDataIds);
         List<ExamCaptureQueueEntity> todoQueues = examCaptureQueueRepo.findByExamRecordDataIdIn(todoIds);
         if (CollectionUtils.isEmpty(todoQueues)) {
-            log.warn("分片任务_FACE_{}_{} 暂无待处理队列记录!", shardTotal, shardIndex);
+            log.warn("分片任务_人脸比对_{}_{} 暂无待处理队列记录!", shardTotal, shardIndex);
             return;
         }
 
         long queryCost = System.currentTimeMillis() - startTime;
-        log.warn("分片任务_FACE_{}_{} 本次处理考试记录数:{} 待比对照片数:{} firstCount:{} moreCount:{} cost:{}ms",
+        log.warn("分片任务_人脸比对_{}_{} 本次处理考试记录数:{} 待比对照片数:{} firstCount:{} moreCount:{} cost:{}ms",
                 shardTotal, shardIndex, todoIds.size(), todoQueues.size(), firstCount, moreCount, queryCost);
         Map<Long, List<ExamCaptureQueueEntity>> maps = todoQueues.stream().collect(Collectors.groupingBy(ExamCaptureQueueEntity::getExamRecordDataId));
 
@@ -109,7 +109,7 @@ public class FaceVerifyJobHandler {
         }
 
         long allCost = Math.max((System.currentTimeMillis() - startTime) / 1000, 1);
-        log.warn("分片任务_FACE_{}_{} 本次处理比对照片数:{} 成功数:{} 约{}个每秒 threadNum:{} cost:{}s",
+        log.warn("分片任务_人脸比对_{}_{} 本次处理比对照片数:{} 成功数:{} 约{}个每秒 threadNum:{} cost:{}s",
                 shardTotal, shardIndex, todoQueues.size(), successCount.get(), (float) todoQueues.size() / allCost,
                 param.getMaxThreadNum(), allCost);
 

+ 5 - 6
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/job/SyncExamRecordDataJobHandler.java

@@ -62,17 +62,16 @@ public class SyncExamRecordDataJobHandler {
     private RedisClient redisClient;
 
     public void run(int shardTotal, int shardIndex, String jobParam) throws Exception {
-        int batchNo = 0, batchSize = 200;
-        int sumTodoSize = 0;
+        int pageNo = 0, pageSize = 200, sumTodoSize = 0;
         Long startId = 0L;
+
         while (true) {
             List<ExamRecordDataEntity> todoList = examRecordDataService.getExamRecordDataUnSyncList(
-                    shardTotal, shardIndex, batchSize, startId, ExamRecordStatus.EXAM_END, ExamRecordStatus.EXAM_OVERDUE);
+                    shardTotal, shardIndex, pageSize, startId, ExamRecordStatus.EXAM_END, ExamRecordStatus.EXAM_OVERDUE);
 
-            batchNo++;
+            pageNo++;
             sumTodoSize += todoList.size();
-            log.warn("分片任务_STEP3_{}_{}  sumTodoSize:{}  curTodoSize:{}  batchNo:{}  startId:{}",
-                    shardTotal, shardIndex, sumTodoSize, todoList.size(), batchNo, startId);
+            log.warn("分片任务_同步归档_{}_{} pageNo:{} 当前条数:{} 累计条数:{}", shardTotal, shardIndex, pageNo, todoList.size(), sumTodoSize);
 
             if (CollectionUtils.isEmpty(todoList)) {
                 break;