工作台接口直接返回裁判计分板地址;
为裁判评分 DTO 增加 AnnotationUrl; 工作台按评分单批量查询当前 PNG 附件,并将地址随成绩列表返回,减少前端查看计分板时的二次查询
This commit is contained in:
parent
0b8ec69d02
commit
62930316f5
@ -447,6 +447,11 @@ public class WorkbenchJudgeScoreDto
|
||||
/// </summary>
|
||||
public bool HasPendingCorrection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前评分单提交的记录画板 PNG 地址
|
||||
/// </summary>
|
||||
public string? AnnotationUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 评分单的动态评分项明细快照
|
||||
/// </summary>
|
||||
|
||||
@ -24,6 +24,7 @@ public class WorkbenchController : IDynamicApiController
|
||||
private readonly ISqlSugarRepository<EventSessionEntry> _entryRepository;
|
||||
private readonly ISqlSugarRepository<EventJudgeAssignment> _assignmentRepository;
|
||||
private readonly ISqlSugarRepository<EventJudgeScoreSheet> _sheetRepository;
|
||||
private readonly ISqlSugarRepository<EventJudgeScoreAttachment> _scoreAttachmentRepository;
|
||||
private readonly ISqlSugarRepository<EventScoreCorrection> _correctionRepository;
|
||||
private readonly ISqlSugarRepository<EventResult> _resultRepository;
|
||||
private readonly ISqlSugarRepository<EventResultVersion> _resultVersionRepository;
|
||||
@ -50,6 +51,7 @@ public class WorkbenchController : IDynamicApiController
|
||||
ISqlSugarRepository<EventSessionEntry> entryRepository,
|
||||
ISqlSugarRepository<EventJudgeAssignment> assignmentRepository,
|
||||
ISqlSugarRepository<EventJudgeScoreSheet> sheetRepository,
|
||||
ISqlSugarRepository<EventJudgeScoreAttachment> scoreAttachmentRepository,
|
||||
ISqlSugarRepository<EventScoreCorrection> correctionRepository,
|
||||
ISqlSugarRepository<EventResult> resultRepository,
|
||||
ISqlSugarRepository<EventResultVersion> 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<long, string>()
|
||||
: (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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user