|
@@ -129,7 +129,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
|
|
|
|
|
private void logReceivedPayload(ReportType reportType, String mode, JsonNode payload) {
|
|
private void logReceivedPayload(ReportType reportType, String mode, JsonNode payload) {
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_payload_received reportType={} mode={} payload={}",
|
|
|
|
|
|
|
+ "临考报告请求载荷已接收 reportType={} mode={} payload={}",
|
|
|
reportType,
|
|
reportType,
|
|
|
mode,
|
|
mode,
|
|
|
summarizePayloadForLog(payload));
|
|
summarizePayloadForLog(payload));
|
|
@@ -208,7 +208,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
now.plus(properties.getRetention()));
|
|
now.plus(properties.getRetention()));
|
|
|
repository.save(report);
|
|
repository.save(report);
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_submitted reportId={} reportType={} generationStatus={} expiresAt={} mode=async",
|
|
|
|
|
|
|
+ "临考报告生成任务已提交 reportId={} reportType={} generationStatus={} expiresAt={} mode=async",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus(),
|
|
report.generationStatus(),
|
|
@@ -216,13 +216,13 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
try {
|
|
try {
|
|
|
dispatcher.dispatch(report.reportId());
|
|
dispatcher.dispatch(report.reportId());
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_dispatched reportId={} reportType={} mode=async",
|
|
|
|
|
|
|
+ "临考报告生成任务已派发 reportId={} reportType={} mode=async",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType());
|
|
report.reportType());
|
|
|
} catch (RuntimeException exception) {
|
|
} catch (RuntimeException exception) {
|
|
|
report = repository.save(report.failed(now, dispatchFailureReason(exception)));
|
|
report = repository.save(report.failed(now, dispatchFailureReason(exception)));
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_dispatch_failed reportId={} reportType={} failureReason={} exceptionType={}",
|
|
|
|
|
|
|
+ "临考报告生成任务派发失败 reportId={} reportType={} failureReason={} exceptionType={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.failureReason(),
|
|
report.failureReason(),
|
|
@@ -249,7 +249,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
now.plus(properties.getRetention()));
|
|
now.plus(properties.getRetention()));
|
|
|
repository.save(report);
|
|
repository.save(report);
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_sync_generation_started reportId={} reportType={} generationStatus={} expiresAt={}",
|
|
|
|
|
|
|
+ "临考报告同步生成已开始 reportId={} reportType={} generationStatus={} expiresAt={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus(),
|
|
report.generationStatus(),
|
|
@@ -258,7 +258,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
Optional<ExamSprintReport> generatedReportOption = pipeline.generate(report.reportId());
|
|
Optional<ExamSprintReport> generatedReportOption = pipeline.generate(report.reportId());
|
|
|
if (generatedReportOption.isEmpty()) {
|
|
if (generatedReportOption.isEmpty()) {
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_sync_generation_unavailable reportId={} reportType={} reason=pipeline_empty durationMs={}",
|
|
|
|
|
|
|
+ "临考报告同步生成不可用 reportId={} reportType={} reason=pipeline_empty durationMs={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
elapsedMillis(startedNanos));
|
|
elapsedMillis(startedNanos));
|
|
@@ -269,7 +269,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
if (generatedReport.generationStatus() != ReportGenerationStatus.SUCCESS
|
|
if (generatedReport.generationStatus() != ReportGenerationStatus.SUCCESS
|
|
|
|| generatedReport.storageObjectKey() == null) {
|
|
|| generatedReport.storageObjectKey() == null) {
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_sync_generation_unavailable reportId={} reportType={} generationStatus={} storageObjectKeyPresent={} durationMs={}",
|
|
|
|
|
|
|
+ "临考报告同步生成不可用 reportId={} reportType={} generationStatus={} storageObjectKeyPresent={} durationMs={}",
|
|
|
generatedReport.reportId(),
|
|
generatedReport.reportId(),
|
|
|
generatedReport.reportType(),
|
|
generatedReport.reportType(),
|
|
|
generatedReport.generationStatus(),
|
|
generatedReport.generationStatus(),
|
|
@@ -285,7 +285,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
properties.getDownloadExpiry()).toString();
|
|
properties.getDownloadExpiry()).toString();
|
|
|
} catch (RuntimeException exception) {
|
|
} catch (RuntimeException exception) {
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_sync_generation_unavailable reportId={} reportType={} generationStatus={} reason=download_url_generation_failed exceptionType={} durationMs={}",
|
|
|
|
|
|
|
+ "临考报告同步生成不可用 reportId={} reportType={} generationStatus={} reason=download_url_generation_failed exceptionType={} durationMs={}",
|
|
|
generatedReport.reportId(),
|
|
generatedReport.reportId(),
|
|
|
generatedReport.reportType(),
|
|
generatedReport.reportType(),
|
|
|
generatedReport.generationStatus(),
|
|
generatedReport.generationStatus(),
|
|
@@ -294,7 +294,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
throw new BusinessException(ErrorCode.EXAM_SPRINT_REPORT_DOWNLOAD_UNAVAILABLE);
|
|
throw new BusinessException(ErrorCode.EXAM_SPRINT_REPORT_DOWNLOAD_UNAVAILABLE);
|
|
|
}
|
|
}
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_sync_generation_succeeded reportId={} reportType={} generationStatus={} durationMs={} storageObjectKey={}",
|
|
|
|
|
|
|
+ "临考报告同步生成成功 reportId={} reportType={} generationStatus={} durationMs={} storageObjectKey={}",
|
|
|
generatedReport.reportId(),
|
|
generatedReport.reportId(),
|
|
|
generatedReport.reportType(),
|
|
generatedReport.reportType(),
|
|
|
generatedReport.generationStatus(),
|
|
generatedReport.generationStatus(),
|
|
@@ -335,7 +335,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
|
|
|
|
|
private void logCompleted() {
|
|
private void logCompleted() {
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_sync_stage_completed reportType={} stage=prepare_content durationMs={} payloadSummaryDurationMs={} validationDurationMs={} contentMappingDurationMs={}",
|
|
|
|
|
|
|
+ "临考报告同步准备阶段完成 reportType={} stage=prepare_content durationMs={} payloadSummaryDurationMs={} validationDurationMs={} contentMappingDurationMs={}",
|
|
|
reportType,
|
|
reportType,
|
|
|
elapsedMillis(startedNanos),
|
|
elapsedMillis(startedNanos),
|
|
|
payloadSummaryDurationMs,
|
|
payloadSummaryDurationMs,
|
|
@@ -351,7 +351,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
if (report.isExpiredAt(now) && report.generationStatus() != ReportGenerationStatus.EXPIRED) {
|
|
if (report.isExpiredAt(now) && report.generationStatus() != ReportGenerationStatus.EXPIRED) {
|
|
|
report = repository.save(report.expired(now));
|
|
report = repository.save(report.expired(now));
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_marked_expired_on_query reportId={} reportType={} generationStatus={} expiresAt={}",
|
|
|
|
|
|
|
+ "临考报告查询时已标记过期 reportId={} reportType={} generationStatus={} expiresAt={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus(),
|
|
report.generationStatus(),
|
|
@@ -366,7 +366,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
downloadUrl = storage.generateDownloadUrl(report.storageObjectKey(), properties.getDownloadExpiry()).toString();
|
|
downloadUrl = storage.generateDownloadUrl(report.storageObjectKey(), properties.getDownloadExpiry()).toString();
|
|
|
} catch (RuntimeException exception) {
|
|
} catch (RuntimeException exception) {
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_download_url_generation_failed reportId={} reportType={} generationStatus={} storageObjectKey={} exceptionType={}",
|
|
|
|
|
|
|
+ "临考报告下载地址生成失败 reportId={} reportType={} generationStatus={} storageObjectKey={} exceptionType={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus(),
|
|
report.generationStatus(),
|
|
@@ -377,7 +377,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
|
|
|
|
|
boolean downloadUrlIncluded = downloadUrl != null;
|
|
boolean downloadUrlIncluded = downloadUrl != null;
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_query_completed reportId={} reportType={} generationStatus={} downloadUrlIncluded={} storageObjectKeyPresent={}",
|
|
|
|
|
|
|
+ "临考报告查询完成 reportId={} reportType={} generationStatus={} downloadUrlIncluded={} storageObjectKeyPresent={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus(),
|
|
report.generationStatus(),
|
|
@@ -400,7 +400,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
Instant now = clock.instant();
|
|
Instant now = clock.instant();
|
|
|
ExamSprintReport report = requireReport(reportId);
|
|
ExamSprintReport report = requireReport(reportId);
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_download_started reportId={} reportType={} generationStatus={}",
|
|
|
|
|
|
|
+ "临考报告下载已开始 reportId={} reportType={} generationStatus={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus());
|
|
report.generationStatus());
|
|
@@ -409,7 +409,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
report = repository.save(report.expired(now));
|
|
report = repository.save(report.expired(now));
|
|
|
}
|
|
}
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_download_unavailable reportId={} reportType={} generationStatus={} reason=expired",
|
|
|
|
|
|
|
+ "临考报告下载不可用 reportId={} reportType={} generationStatus={} reason=expired",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus());
|
|
report.generationStatus());
|
|
@@ -417,7 +417,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
}
|
|
}
|
|
|
if (report.generationStatus() != ReportGenerationStatus.SUCCESS) {
|
|
if (report.generationStatus() != ReportGenerationStatus.SUCCESS) {
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_download_unavailable reportId={} reportType={} generationStatus={} reason=not_success",
|
|
|
|
|
|
|
+ "临考报告下载不可用 reportId={} reportType={} generationStatus={} reason=not_success",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus());
|
|
report.generationStatus());
|
|
@@ -425,7 +425,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
}
|
|
}
|
|
|
if (report.storageObjectKey() == null) {
|
|
if (report.storageObjectKey() == null) {
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_download_unavailable reportId={} reportType={} generationStatus={} reason=missing_storage_key",
|
|
|
|
|
|
|
+ "临考报告下载不可用 reportId={} reportType={} generationStatus={} reason=missing_storage_key",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus());
|
|
report.generationStatus());
|
|
@@ -437,7 +437,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
content = storage.download(report.storageObjectKey());
|
|
content = storage.download(report.storageObjectKey());
|
|
|
} catch (RuntimeException exception) {
|
|
} catch (RuntimeException exception) {
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_download_unavailable reportId={} reportType={} generationStatus={} reason=storage_download_failed storageObjectKey={} exceptionType={}",
|
|
|
|
|
|
|
+ "临考报告下载不可用 reportId={} reportType={} generationStatus={} reason=storage_download_failed storageObjectKey={} exceptionType={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus(),
|
|
report.generationStatus(),
|
|
@@ -447,7 +447,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
}
|
|
}
|
|
|
if (content.isEmpty()) {
|
|
if (content.isEmpty()) {
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_download_missing_storage_content reportId={} reportType={} storageObjectKey={}",
|
|
|
|
|
|
|
+ "临考报告下载缺少存储内容 reportId={} reportType={} storageObjectKey={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.storageObjectKey());
|
|
report.storageObjectKey());
|
|
@@ -460,7 +460,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
storedContent.contentType()))
|
|
storedContent.contentType()))
|
|
|
.orElseThrow();
|
|
.orElseThrow();
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_download_succeeded reportId={} reportType={} storageObjectKey={} fileName={} byteLength={}",
|
|
|
|
|
|
|
+ "临考报告下载成功 reportId={} reportType={} storageObjectKey={} fileName={} byteLength={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.storageObjectKey(),
|
|
report.storageObjectKey(),
|
|
@@ -488,7 +488,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
} catch (RuntimeException exception) {
|
|
} catch (RuntimeException exception) {
|
|
|
failedCount++;
|
|
failedCount++;
|
|
|
log.warn(
|
|
log.warn(
|
|
|
- "exam_sprint_report_cleanup_item_failed reportId={} reportType={} generationStatus={} storageObjectKey={} exceptionType={}",
|
|
|
|
|
|
|
+ "临考报告清理单项失败 reportId={} reportType={} generationStatus={} storageObjectKey={} exceptionType={}",
|
|
|
report.reportId(),
|
|
report.reportId(),
|
|
|
report.reportType(),
|
|
report.reportType(),
|
|
|
report.generationStatus(),
|
|
report.generationStatus(),
|
|
@@ -498,7 +498,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_cleanup_completed scannedCount={} storageClearedCount={} markedExpiredCount={} failedCount={}",
|
|
|
|
|
|
|
+ "临考报告清理完成 scannedCount={} storageClearedCount={} markedExpiredCount={} failedCount={}",
|
|
|
expiredReports.size(),
|
|
expiredReports.size(),
|
|
|
storageClearedCount,
|
|
storageClearedCount,
|
|
|
markedExpiredCount,
|
|
markedExpiredCount,
|
|
@@ -539,7 +539,7 @@ public class DefaultExamSprintReportApplicationService implements ExamSprintRepo
|
|
|
- shapeDurationMs
|
|
- shapeDurationMs
|
|
|
- deserializationDurationMs;
|
|
- deserializationDurationMs;
|
|
|
log.info(
|
|
log.info(
|
|
|
- "exam_sprint_report_validation_stage_completed reportType={} stage=validate_payload durationMs={} studentNameDurationMs={} shapeDurationMs={} deserializationDurationMs={} beanValidationDurationMs={}",
|
|
|
|
|
|
|
+ "临考报告参数校验阶段完成 reportType={} stage=validate_payload durationMs={} studentNameDurationMs={} shapeDurationMs={} deserializationDurationMs={} beanValidationDurationMs={}",
|
|
|
ReportType.OUTLOOK,
|
|
ReportType.OUTLOOK,
|
|
|
elapsedMillis(startedNanos),
|
|
elapsedMillis(startedNanos),
|
|
|
studentNameDurationMs,
|
|
studentNameDurationMs,
|