xiatian 2 年之前
父節點
當前提交
fe951ec3c4

+ 1 - 1
examcloud-core-oe-admin-dao/src/main/java/cn/com/qmth/examcloud/core/oe/admin/dao/enums/ExportTaskType.java

@@ -14,7 +14,7 @@ public enum ExportTaskType {
 
     AUDIT("监考已审"),
 
-    SCORE_STATISTIC("成绩统计"),
+    SCORE_STATISTIC("成绩明细"),
     
     EXAM_SCHEDULING("考试进度");
 

+ 3 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/AsyncExportServiceImpl.java

@@ -135,7 +135,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 				return;
 			}
 			examRecords = ExamStudentEntityConvert.ofExcel(examStudentInfoList);
-			fillStage(examRecords);
+			fillStage(examRecords,taskId);
 
 		} catch (ExportTaskStopException e) {
 			exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.TERMINATE);
@@ -185,11 +185,12 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 		}
 	}
 
-	private void fillStage(List<ExamStudentExcel> list) {
+	private void fillStage(List<ExamStudentExcel> list,Long taskId) {
 		if (CollectionUtils.isEmpty(list)) {
 			return;
 		}
 		for (ExamStudentExcel info : list) {
+			exportTaskService.checkStopExportTaskById(taskId);
 			if (info.getExamStageId() != null) {
 				ExamStageCacheBean stage = CacheHelper.getExamStage(info.getExamId(), info.getExamStageId());
 				info.setExamStageOrder(stage.getStageOrder());

+ 19 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamAuditServiceImpl.java

@@ -278,6 +278,7 @@ public class ExamAuditServiceImpl implements ExamAuditService {
         List<ExamAuditInfo> list = ExamAuditEntityConvert.of(resultList);
 
         for (ExamAuditInfo examAuditInfo : list) {
+        	exportTaskService.checkStopExportTaskById(query.getTaskId());
             OrgCacheBean orgBean = gainBaseDataService.getOrgBean(examAuditInfo.getOrgId());
             examAuditInfo.setOrgName(orgBean.getName());
 
@@ -301,10 +302,26 @@ public class ExamAuditServiceImpl implements ExamAuditService {
             examAuditInfo.setObjectiveScore(String.valueOf(examScore.getObjectiveScore()));
 
         }
-        fillStage(list);
+        fillStage(list,query.getTaskId());
         return list;
     }
-    
+    private void fillStage(List<ExamAuditInfo> list,Long taskId) {
+    	if(CollectionUtils.isEmpty(list)) {
+    		return;
+    	}
+    	for(ExamAuditInfo info:list) {
+    		exportTaskService.checkStopExportTaskById(taskId);
+    		if(info.getExamStageId()!=null) {
+    			ExamStageCacheBean stage=CacheHelper.getExamStage(info.getExamId(), info.getExamStageId());
+    			info.setExamStageOrder(stage.getStageOrder());
+    			info.setStartTime(stage.getStartTime());
+    			info.setEndTime(stage.getEndTime());
+    			info.setExamStage(stage.getStageOrder() + "("
+						+ DateUtil.format(stage.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + "至"
+						+ DateUtil.format(stage.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + ")");
+    		}
+    	}
+    }
     private void fillStage(List<ExamAuditInfo> list) {
     	if(CollectionUtils.isEmpty(list)) {
     		return;

+ 31 - 11
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordServiceImpl.java

@@ -376,7 +376,23 @@ public class ExamRecordServiceImpl implements ExamRecordService {
         fillStage(ret.getContent());
         return ret;
     }
-
+    private void fillStage(List<ExamRecordInfo> list,Long taskId) {
+        if (CollectionUtils.isEmpty(list)) {
+            return;
+        }
+        for (ExamRecordInfo info : list) {
+        	exportTaskService.checkStopExportTaskById(taskId);
+            if (info.getExamStageId() != null) {
+                ExamStageCacheBean stage = CacheHelper.getExamStage(info.getExamId(), info.getExamStageId());
+                info.setExamStageOrder(stage.getStageOrder());
+                info.setStageStartTime(stage.getStartTime());
+                info.setStageEndTime(stage.getEndTime());
+                info.setExamStage(stage.getStageOrder() + "("
+                        + DateUtil.format(stage.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + "至"
+                        + DateUtil.format(stage.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + ")");
+            }
+        }
+    }
     private void fillStage(List<ExamRecordInfo> list) {
         if (CollectionUtils.isEmpty(list)) {
             return;
@@ -775,15 +791,16 @@ public class ExamRecordServiceImpl implements ExamRecordService {
             return examRecordDataList;
         }
         for (ExamRecordInfo erInfo : examRecordDataList) {
+        	exportTaskService.checkStopExportTaskById(query.getTaskId());
             setInfo(erInfo, query.getExamId());
         }
-        setPhone(examRecordDataList, query.getRootOrgId());
+        setPhone(examRecordDataList, query.getRootOrgId(),query.getTaskId());
         String examType = examRecordDataList.get(0).getExamType();
         if (ExamType.ONLINE.name().equals(examType) || ExamType.ONLINE_HOMEWORK.name().equals(examType)) {
-            setVirtualCameraNames(examRecordDataList);
-            setIps(examRecordDataList);
+            setVirtualCameraNames(examRecordDataList,query.getTaskId());
+            setIps(examRecordDataList,query.getTaskId());
         }
-        fillStage(examRecordDataList);
+        fillStage(examRecordDataList,query.getTaskId());
         return examRecordDataList;
     }
 
@@ -831,11 +848,12 @@ public class ExamRecordServiceImpl implements ExamRecordService {
         }
     }
 
-    private void setPhone(List<ExamRecordInfo> examRecordDataList, Long rootOrgId) {
+    private void setPhone(List<ExamRecordInfo> examRecordDataList, Long rootOrgId,Long taskId) {
         GetStudentListByIdsReq req = new GetStudentListByIdsReq();
         BatchSetDataUtil<ExamRecordInfo> tool = new BatchSetDataUtil<ExamRecordInfo>() {
             @Override
             public void setData(List<ExamRecordInfo> dataList) {
+            	exportTaskService.checkStopExportTaskById(taskId);
                 req.setRootOrgId(rootOrgId);
                 List<Long> ids = dataList.stream().map(dto -> dto.getStudentId()).distinct().collect(Collectors.toList());
                 req.setStudentIdList(ids);
@@ -850,13 +868,14 @@ public class ExamRecordServiceImpl implements ExamRecordService {
             }
 
         };
-        tool.setDataForBatch(examRecordDataList, 100);
+        tool.setDataForBatch(examRecordDataList, 1000);
     }
 
-    private void setVirtualCameraNames(List<ExamRecordInfo> examRecordDataList) {
+    private void setVirtualCameraNames(List<ExamRecordInfo> examRecordDataList,Long taskId) {
         BatchSetDataUtil<ExamRecordInfo> tool = new BatchSetDataUtil<ExamRecordInfo>() {
             @Override
             public void setData(List<ExamRecordInfo> dataList) {
+            	exportTaskService.checkStopExportTaskById(taskId);
                 List<Long> ids = dataList.stream().map(dto -> dto.getId()).distinct().collect(Collectors.toList());
                 Map<Long, Set<String>> map = new HashMap<>();
                 List<ExamCaptureCameraInfoEntity> examCaptureList = examCaptureCameraInfoRepo.findByExamRecordDataIdInAndVirtualCamera(ids, true);
@@ -879,13 +898,14 @@ public class ExamRecordServiceImpl implements ExamRecordService {
             }
 
         };
-        tool.setDataForBatch(examRecordDataList, 100);
+        tool.setDataForBatch(examRecordDataList, 1000);
     }
 
-    private void setIps(List<ExamRecordInfo> examRecordDataList) {
+    private void setIps(List<ExamRecordInfo> examRecordDataList,Long taskId) {
         BatchSetDataUtil<ExamRecordInfo> tool = new BatchSetDataUtil<ExamRecordInfo>() {
             @Override
             public void setData(List<ExamRecordInfo> dataList) {
+            	exportTaskService.checkStopExportTaskById(taskId);
                 List<Long> ids = dataList.stream().map(dto -> dto.getId()).distinct().collect(Collectors.toList());
                 Map<Long, Set<String>> map = new HashMap<>();
                 List<ExamProcessRecordEntity> list = examProcessRecordRepo.findByExamRecordDataIdIn(ids);
@@ -908,7 +928,7 @@ public class ExamRecordServiceImpl implements ExamRecordService {
             }
 
         };
-        tool.setDataForBatch(examRecordDataList, 100);
+        tool.setDataForBatch(examRecordDataList, 1000);
     }
 
     private String getStrFromSet(Set<String> set) {

+ 20 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamScoreServiceImpl.java

@@ -145,6 +145,24 @@ public class ExamScoreServiceImpl implements ExamScoreService {
 			}
 		}
 	}
+	
+	private void fillStage(List<ExamScoreInfo> list,Long taskId) {
+		if (CollectionUtils.isEmpty(list)) {
+			return;
+		}
+		for (ExamScoreInfo info : list) {
+			exportTaskService.checkStopExportTaskById(taskId);
+			if (info.getExamStageId() != null) {
+				ExamStageCacheBean stage = CacheHelper.getExamStage(info.getExamId(), info.getExamStageId());
+				info.setExamStageOrder(stage.getStageOrder());
+				info.setStageStartTime(stage.getStartTime());
+				info.setStageEndTime(stage.getEndTime());
+				info.setExamStage(stage.getStageOrder() + "("
+						+ DateUtil.format(stage.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + "至"
+						+ DateUtil.format(stage.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + ")");
+			}
+		}
+	}
 
 	/**
 	 * 封装成绩统计结果
@@ -216,6 +234,7 @@ public class ExamScoreServiceImpl implements ExamScoreService {
 
 		// 缓存
 		for (ExamStudentEntity examStudent : examStudentList) {
+			exportTaskService.checkStopExportTaskById(query.getTaskId());
 			long courseId = examStudent.getCourseId();
 			CourseCacheBean courseBean = ExamCacheTransferHelper.getCachedCourse(courseId);
 
@@ -224,7 +243,7 @@ public class ExamScoreServiceImpl implements ExamScoreService {
 
 			examScoreInfoList.add(convertToExamScoreInfo(examStudent, courseBean, orgBean, markingType));
 		}
-		fillStage(examScoreInfoList);
+		fillStage(examScoreInfoList,query.getTaskId());
 		return examScoreInfoList;
 //        }
 	}

+ 4 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamStudentServiceImpl.java

@@ -338,6 +338,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
 			return examStudentInfoList;
 		}
 		for (ExamStudentEntity examStudentEntity : examStudentList) {
+			exportTaskService.checkStopExportTaskById(query.getTaskId());
 			ExamStudentInfo examStudentInfo = buildExamStudentInfoForExport(examStudentEntity, examBean.getExamType());
 			examStudentInfoList.add(examStudentInfo);
 			if (ExamType.ONLINE.name().equals(examBean.getExamType())
@@ -355,7 +356,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
 				countUseExamTimes(examStudentInfo, examBean.getExamType());
 			}
 		}
-		setPhone(examStudentInfoList, query.getRootOrgId());
+		setPhone(examStudentInfoList, query.getRootOrgId(),query.getTaskId());
 		return examStudentInfoList;
 	}
 
@@ -393,11 +394,12 @@ public class ExamStudentServiceImpl implements ExamStudentService {
 		return examStudentDtoList;
 	}
 
-	private void setPhone(List<ExamStudentInfo> dataList, Long rootOrgId) {
+	private void setPhone(List<ExamStudentInfo> dataList, Long rootOrgId,Long taskId) {
 		GetStudentListByIdsReq req = new GetStudentListByIdsReq();
 		BatchSetDataUtil<ExamStudentInfo> tool = new BatchSetDataUtil<ExamStudentInfo>() {
 			@Override
 			public void setData(List<ExamStudentInfo> dataList) {
+				exportTaskService.checkStopExportTaskById(taskId);
 				req.setRootOrgId(rootOrgId);
 				List<Long> ids = dataList.stream().map(dto -> dto.getStudentId()).distinct()
 						.collect(Collectors.toList());