From 62930316f5d36dc61ca84d00b990a2c00518498c Mon Sep 17 00:00:00 2001
From: ltx <1006158920@qq.com>
Date: Sat, 10 Oct 2026 18:01:27 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9E=E8=A3=81=E5=88=A4=E8=AE=A1?=
=?UTF-8?q?=E5=88=86=E6=9D=BF=E5=9C=B0=E5=9D=80=EF=BC=9B=20=E4=B8=BA?=
=?UTF-8?q?=E8=A3=81=E5=88=A4=E8=AF=84=E5=88=86=20DTO=20=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=20AnnotationUrl=EF=BC=9B=20=E5=B7=A5=E4=BD=9C=E5=8F=B0?=
=?UTF-8?q?=E6=8C=89=E8=AF=84=E5=88=86=E5=8D=95=E6=89=B9=E9=87=8F=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2=E5=BD=93=E5=89=8D=20PNG=20=E9=99=84=E4=BB=B6=EF=BC=8C?=
=?UTF-8?q?=E5=B9=B6=E5=B0=86=E5=9C=B0=E5=9D=80=E9=9A=8F=E6=88=90=E7=BB=A9?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E8=BF=94=E5=9B=9E=EF=BC=8C=E5=87=8F=E5=B0=91?=
=?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=9F=A5=E7=9C=8B=E8=AE=A1=E5=88=86=E6=9D=BF?=
=?UTF-8?q?=E6=97=B6=E7=9A=84=E4=BA=8C=E6=AC=A1=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Workbench/Dtos/WorkbenchDtos.cs | 5 +++++
.../Workbench/WorkbenchController.cs | 13 +++++++++++++
2 files changed, 18 insertions(+)
diff --git a/YD_Event.Application/Workbench/Dtos/WorkbenchDtos.cs b/YD_Event.Application/Workbench/Dtos/WorkbenchDtos.cs
index 540be7d..b273328 100644
--- a/YD_Event.Application/Workbench/Dtos/WorkbenchDtos.cs
+++ b/YD_Event.Application/Workbench/Dtos/WorkbenchDtos.cs
@@ -447,6 +447,11 @@ public class WorkbenchJudgeScoreDto
///
public bool HasPendingCorrection { get; set; }
+ ///
+ /// 当前评分单提交的记录画板 PNG 地址
+ ///
+ public string? AnnotationUrl { get; set; }
+
///
/// 评分单的动态评分项明细快照
///
diff --git a/YD_Event.Application/Workbench/WorkbenchController.cs b/YD_Event.Application/Workbench/WorkbenchController.cs
index e40c5c6..99fab53 100644
--- a/YD_Event.Application/Workbench/WorkbenchController.cs
+++ b/YD_Event.Application/Workbench/WorkbenchController.cs
@@ -24,6 +24,7 @@ public class WorkbenchController : IDynamicApiController
private readonly ISqlSugarRepository _entryRepository;
private readonly ISqlSugarRepository _assignmentRepository;
private readonly ISqlSugarRepository _sheetRepository;
+ private readonly ISqlSugarRepository _scoreAttachmentRepository;
private readonly ISqlSugarRepository _correctionRepository;
private readonly ISqlSugarRepository _resultRepository;
private readonly ISqlSugarRepository _resultVersionRepository;
@@ -50,6 +51,7 @@ public class WorkbenchController : IDynamicApiController
ISqlSugarRepository entryRepository,
ISqlSugarRepository assignmentRepository,
ISqlSugarRepository sheetRepository,
+ ISqlSugarRepository scoreAttachmentRepository,
ISqlSugarRepository correctionRepository,
ISqlSugarRepository resultRepository,
ISqlSugarRepository resultVersionRepository,
@@ -75,6 +77,7 @@ public class WorkbenchController : IDynamicApiController
_entryRepository = entryRepository;
_assignmentRepository = assignmentRepository;
_sheetRepository = sheetRepository;
+ _scoreAttachmentRepository = scoreAttachmentRepository;
_correctionRepository = correctionRepository;
_resultRepository = resultRepository;
_resultVersionRepository = resultVersionRepository;
@@ -380,6 +383,15 @@ public class WorkbenchController : IDynamicApiController
// 批量查询当前评分单的动态评分项明细,按评分单分组挂到各裁判评分下
var sheetIds = sheets.Select(s => s.Id).ToList();
+ var annotationUrls = sheetIds.Count == 0
+ ? new Dictionary()
+ : (await _scoreAttachmentRepository.AsQueryable()
+ .Where(a => !a.DeleteMark && sheetIds.Contains(a.ScoreSheetId)
+ && a.IsCurrent && a.AttachmentType == "score_annotation_png")
+ .Select(a => new { a.ScoreSheetId, a.FileUrl, a.CreatedTime })
+ .ToListAsync())
+ .GroupBy(a => a.ScoreSheetId)
+ .ToDictionary(g => g.Key, g => g.OrderByDescending(a => a.CreatedTime).First().FileUrl);
var scoreItems = await _scoreDetailRepository.AsQueryable()
.Where(d => !d.DeleteMark && sheetIds.Contains(d.ScoreSheetId))
.OrderBy(d => d.Sort)
@@ -434,6 +446,7 @@ public class WorkbenchController : IDynamicApiController
IsDisqualified = sheet.IsDisqualified,
SubmittedTime = sheet.SubmittedTime,
HasPendingCorrection = pendingCorrectionSet.Contains(sheet.Id),
+ AnnotationUrl = annotationUrls.GetValueOrDefault(sheet.Id),
ScoreItems = scoreItems.Where(d => d.ScoreSheetId == sheet.Id).Select(d => new WorkbenchScoreItemDto
{
ItemCode = d.ItemCode,