qinchao преди 4 години
родител
ревизия
9eb2fb9b09

+ 3 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/examrecord/ExamRecordEntityConvert.java

@@ -116,7 +116,9 @@ public class ExamRecordEntityConvert {
 
         //每次考试持续时间
         if (recordData.getStartTime() != null && recordData.getEndTime() != null) {
-            info.setExamTime(recordData.getUsedExamTime() > 0 ? DateUtils.diff(recordData.getUsedExamTime()) : "");
+            if (recordData.getUsedExamTime() != null) {
+                info.setExamTime(recordData.getUsedExamTime() > 0 ? DateUtils.diff(recordData.getUsedExamTime()) : "");
+            }
         } else {
             info.setExamTime("");
         }

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

@@ -113,7 +113,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 			examRecords = ExamStudentEntityConvert.ofExcel(examStudentInfoList);
 
 		} catch (Exception e) {
-			LOG.error(e.getMessage());
+			LOG.error(e.getMessage(), e);
 			if (e instanceof StatusException) {
 				exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.ERROR,
 						((StatusException) e).getDesc());
@@ -133,7 +133,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 			tempFile.getParentFile().mkdirs();
 			tempFile.createNewFile();
 		} catch (IOException e) {
-			LOG.error(e.getMessage());
+			LOG.error(e.getMessage(), e);
 			exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.ERROR, "生成导出文件异常");
 			return;
 		}
@@ -190,7 +190,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 			}
 
 		} catch (Exception e) {
-			LOG.error(e.getMessage());
+			LOG.error(e.getMessage(),e);
 			if (e instanceof StatusException) {
 				exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.ERROR,
 						((StatusException) e).getDesc());
@@ -209,7 +209,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 			tempFile.getParentFile().mkdirs();
 			tempFile.createNewFile();
 		} catch (IOException e) {
-			LOG.error(e.getMessage());
+			LOG.error(e.getMessage(), e);
 			exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.ERROR, "生成导出文件异常");
 			return;
 		}
@@ -263,7 +263,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 				return;
 			}
 		} catch (Exception e) {
-			LOG.error(e.getMessage());
+			LOG.error(e.getMessage(), e);
 			if (e instanceof StatusException) {
 				exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.ERROR,
 						((StatusException) e).getDesc());
@@ -282,7 +282,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 			tempFile.getParentFile().mkdirs();
 			tempFile.createNewFile();
 		} catch (IOException e) {
-			LOG.error(e.getMessage());
+			LOG.error(e.getMessage(), e);
 			exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.ERROR, "生成导出文件异常");
 			return;
 		}
@@ -321,7 +321,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 			}
 
 		} catch (Exception e) {
-			LOG.error(e.getMessage());
+			LOG.error(e.getMessage(), e);
 			if (e instanceof StatusException) {
 				exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.ERROR,
 						((StatusException) e).getDesc());
@@ -340,7 +340,7 @@ public class AsyncExportServiceImpl implements AsyncExportService {
 			tempFile.getParentFile().mkdirs();
 			tempFile.createNewFile();
 		} catch (IOException e) {
-			LOG.error(e.getMessage());
+			LOG.error(e.getMessage(), e);
 			exportTaskService.updateExportTaskStatus(taskId, ExportTaskStatus.ERROR, "生成导出文件异常");
 			return;
 		}

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

@@ -8,6 +8,7 @@
 package cn.com.qmth.examcloud.core.oe.admin.service.impl;
 
 import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamCaptureRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamScoreRepo;
@@ -41,6 +42,7 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.StringJoiner;
 
 /**
  * 考试抓拍检测相关接口

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

@@ -866,7 +866,9 @@ public class ExamRecordServiceImpl implements ExamRecordService {
 
         //每次考试持续时间
         if (info.getStartTime() != null && info.getEndTime() != null) {
-            info.setExamTime(info.getUsedExamTime() > 0 ? DateUtils.diff(info.getUsedExamTime()) : "");
+            if (info.getUsedExamTime() != null) {
+                info.setExamTime(info.getUsedExamTime() > 0 ? DateUtils.diff(info.getUsedExamTime()) : "");
+            }
         } else {
             info.setExamTime("");
         }