YD_Event.Admin/YD_Event.Application/Client/Dtos/CompetitionClientDtos.cs

671 lines
21 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace YD_Event.Application.Client.Dtos;
/// <summary>
/// 成绩查询赛事信息DTO
/// </summary>
public class ScoreEventDto
{
public long Id { get; set; }
public string Name { get; set; } = string.Empty;
/// <summary>
/// 赛事状态:3-比赛中,4-已结束。成绩查询只开放这两种状态。
/// </summary>
public int EventStatus { get; set; }
public string EventStatusText { get; set; } = string.Empty;
}
/// <summary>
/// 成绩查询输入参数
/// </summary>
public class ScoreQueryInput
{
public long? EventId { get; set; }
/// <summary>
/// 项目筛选,对应基础项目 Project.Id。
/// </summary>
public long? ProjectId { get; set; }
/// <summary>
/// 组别筛选,成绩表按组别名称存储。
/// </summary>
public string? GroupName { get; set; }
public string? Keyword { get; set; }
}
/// <summary>
/// 成绩查询页的项目、组别下拉数据
/// </summary>
public class ScoreFilterOptionsDto
{
public long EventId { get; set; }
public string EventName { get; set; } = string.Empty;
public List<ScoreProjectFilterDto> Projects { get; set; } = new();
public List<string> GroupNames { get; set; } = new();
}
/// <summary>
/// 成绩查询项目组别筛选DTO
/// </summary>
public class ScoreProjectFilterDto
{
public long ProjectId { get; set; }
public string ProjectName { get; set; } = string.Empty;
public List<string> GroupNames { get; set; } = new();
}
/// <summary>
/// 裁判打分项DTO
/// </summary>
public class JudgeScoreDto
{
public string Label { get; set; } = string.Empty;
public string Score { get; set; } = string.Empty;
}
/// <summary>
/// 客户端成绩列表项DTO
/// </summary>
public class ClientScoreDto
{
public long Id { get; set; }
public long EventId { get; set; }
public string EventName { get; set; } = string.Empty;
public string AthleteName { get; set; } = string.Empty;
public string AthleteNo { get; set; } = string.Empty;
public long ProjectId { get; set; }
public string Category { get; set; } = string.Empty;
public string GroupName { get; set; } = string.Empty;
public string RoundName { get; set; } = "正式成绩";
public int Rank { get; set; }
public string TotalScore { get; set; } = string.Empty;
/// <summary>
/// 难度分。规定赛没有难度分,值为 0 时不进入 JudgeScores。
/// </summary>
public decimal DifficultyScore { get; set; }
/// <summary>
/// 表现分
/// </summary>
public decimal PerformanceScore { get; set; }
/// <summary>
/// 规定分
/// </summary>
public decimal RequiredScore { get; set; }
/// <summary>
/// 扣分
/// </summary>
public decimal DeductionScore { get; set; }
public bool IsDisqualified { get; set; }
public string Status { get; set; } = "成绩有效";
public List<JudgeScoreDto> JudgeScores { get; set; } = new();
}
/// <summary>
/// 成绩查询输出结果
/// </summary>
public class ScoreQueryOutput
{
public List<ClientScoreDto> Rows { get; set; } = new();
public int Total { get; set; }
/// <summary>
/// 成绩数据的最后更新时间,页面显示“数据更新:yyyy-MM-dd HH:mm:ss”。
/// </summary>
public DateTime? DataUpdatedTime { get; set; }
public string DataUpdatedText { get; set; } = string.Empty;
/// <summary>
/// 实时排名提示,成绩确认前均为参考值。
/// </summary>
public string Notice { get; set; } = "本排名实时更新,非最终成绩,仅供参考。";
}
/// <summary>
/// 裁判报名输入参数
/// </summary>
public class RefereeApplyInput
{
[Required(ErrorMessage = "赛事ID不能为空")]
public long EventId { get; set; }
}
/// <summary>
/// 裁判认证提交参数,对应小程序“裁判认证”页面。
/// </summary>
public class RefereeProfileSubmitInput
{
[Required(ErrorMessage = "姓名不能为空"), StringLength(64)]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 手机号。为空时取当前登录账号手机号
/// </summary>
[RegularExpression(@"^1[3-9]\d{9}$", ErrorMessage = "手机号格式不正确")]
public string? Mobile { get; set; }
/// <summary>
/// 短信验证码。更换手机号时必填
/// </summary>
public string? VerificationCode { get; set; }
[Required(ErrorMessage = "请选择地区")]
public string ProvinceCode { get; set; } = string.Empty;
[Required(ErrorMessage = "请选择地区")]
public string ProvinceName { get; set; } = string.Empty;
[Required(ErrorMessage = "请选择地区")]
public string CityCode { get; set; } = string.Empty;
[Required(ErrorMessage = "请选择地区")]
public string CityName { get; set; } = string.Empty;
[Required(ErrorMessage = "请选择地区")]
public string DistrictCode { get; set; } = string.Empty;
[Required(ErrorMessage = "请选择地区")]
public string DistrictName { get; set; } = string.Empty;
[Required(ErrorMessage = "请选择裁判级别")]
public RefereeLevel Level { get; set; }
[Required(ErrorMessage = "请上传裁判证件")]
public string CertificateUrl { get; set; } = string.Empty;
/// <summary>
/// 可执裁角色,位标记多选。
/// </summary>
[Range(1, int.MaxValue, ErrorMessage = "至少选择一个裁判角色")]
public RefereeRole Roles { get; set; }
}
/// <summary>
/// 裁判认证信息DTO
/// </summary>
public class RefereeProfileDto
{
public long Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Mobile { get; set; } = string.Empty;
public string ProvinceCode { get; set; } = string.Empty;
public string ProvinceName { get; set; } = string.Empty;
public string CityCode { get; set; } = string.Empty;
public string CityName { get; set; } = string.Empty;
public string DistrictCode { get; set; } = string.Empty;
public string DistrictName { get; set; } = string.Empty;
public string RegionName { get; set; } = string.Empty;
public RefereeLevel Level { get; set; }
public string LevelName { get; set; } = string.Empty;
public string CertificateUrl { get; set; } = string.Empty;
public RefereeRole Roles { get; set; }
public List<int> RoleValues { get; set; } = new();
public List<string> RoleNames { get; set; } = new();
public AuditStatus AuditStatus { get; set; }
public string AuditStatusText { get; set; } = string.Empty;
public string? AuditRemark { get; set; }
/// <summary>
/// 审核通过后才能报名执裁
/// </summary>
public bool CanApply { get; set; }
public DateTime CreatedTime { get; set; }
}
/// <summary>
/// 裁判认证页面的角色、级别下拉数据
/// </summary>
public class RefereeProfileOptionsDto
{
public List<RefereeEnumOptionDto> Levels { get; set; } = new();
public List<RefereeEnumOptionDto> Roles { get; set; } = new();
}
/// <summary>
/// 裁判枚举选项DTO
/// </summary>
public class RefereeEnumOptionDto
{
public int Value { get; set; }
public string Label { get; set; } = string.Empty;
}
/// <summary>
/// 赛事裁判报名名额状态,对应原型“裁判名额未满/已满”提示。
/// </summary>
public class RefereeQuotaDto
{
public long EventId { get; set; }
public string EventName { get; set; } = string.Empty;
/// <summary>
/// 名额上限,0 表示不限名额。
/// </summary>
public int Limit { get; set; }
public int Applied { get; set; }
public int Remaining { get; set; }
public bool IsFull { get; set; }
/// <summary>
/// 当前账号是否已报名该赛事执裁
/// </summary>
public bool Applied4Me { get; set; }
public bool CanApply { get; set; }
public string Message { get; set; } = string.Empty;
}
/// <summary>
/// 裁判执裁申请记录DTO
/// </summary>
public class RefereeApplicationDto
{
public long Id { get; set; }
public long ApplicationId { get; set; }
public long EventId { get; set; }
public string EventName { get; set; } = string.Empty;
public string? CoverImage { get; set; }
public string? Address { get; set; }
public int EventStatus { get; set; }
public int ApplicationStatus { get; set; }
public string ApplicationStatusText { get; set; } = string.Empty;
public DateTime AppliedAt { get; set; }
public DateTime MatchStartTime { get; set; }
public DateTime MatchEndTime { get; set; }
public string MatchStartText => MatchStartTime.ToString("yyyy-MM-dd HH:mm");
public string MatchEndText => MatchEndTime.ToString("yyyy-MM-dd HH:mm");
}
/// <summary>
/// 裁判执裁申请列表输出
/// </summary>
public class RefereeApplicationListOutput
{
public List<RefereeApplicationDto> Rows { get; set; } = new();
public int Total { get; set; }
}
/// <summary>
/// 检录运动员信息DTO
/// </summary>
public class CheckinAthleteDto
{
public long Id { get; set; }
public long UserId { get; set; }
public string BibNo { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string TeamName { get; set; } = string.Empty;
public bool Checked { get; set; }
public bool PreviousPassed { get; set; } = true;
public bool CanCheck { get; set; } = true;
public string LockReason { get; set; } = string.Empty;
public string OrderBookSessionName { get; set; } = string.Empty;
}
/// <summary>
/// 检录工作台上下文信息DTO
/// </summary>
public class CheckinContextDto
{
public long TaskId { get; set; }
public long EventId { get; set; }
public string EventName { get; set; } = string.Empty;
public string Venue { get; set; } = string.Empty;
public int TotalCheckins { get; set; }
public int CurrentCheckinNo { get; set; }
public string CurrentCheckinName { get; set; } = string.Empty;
public int TotalSessions { get; set; }
public int CurrentSessionOrder { get; set; }
public string CurrentSessionKey { get; set; } = string.Empty;
public string CurrentSessionName { get; set; } = string.Empty;
public string CurrentSessionVenue { get; set; } = string.Empty;
public string? NextSessionName { get; set; }
public List<CheckinSessionOptionDto> Sessions { get; set; } = new();
public long SelectedEventProjectId { get; set; }
public long SelectedGroupId { get; set; }
public List<CheckinProjectOptionDto> Projects { get; set; } = new();
public List<CheckinOrderBookUnitStatusDto> Units { get; set; } = new();
public List<CheckinOrderBookUnitStatusDto> PendingUnits { get; set; } = new();
public List<CheckinOrderBookUnitStatusDto> CheckedUnits { get; set; } = new();
public List<CheckinOrderBookUnitStatusDto> LockedUnits { get; set; } = new();
/// <summary>
/// 当前赛事是否允许检录操作(仅赛事状态为比赛中时为 true)
/// </summary>
public bool CanCheck { get; set; } = true;
/// <summary>
/// 不允许检录时的原因提示
/// </summary>
public string CheckLockReason { get; set; } = string.Empty;
/// <summary>
/// 赛事状态枚举值
/// </summary>
public int EventStatus { get; set; }
/// <summary>
/// 赛事状态文本
/// </summary>
public string EventStatusText { get; set; } = string.Empty;
// 以下字段保留给旧版小程序兼容,值映射自秩序册场次。
public int TotalRounds { get; set; }
public int CurrentRound { get; set; }
public string RoundName { get; set; } = string.Empty;
public long? CurrentGroupId { get; set; }
public string CurrentGroupName { get; set; } = string.Empty;
public int GroupOrder { get; set; }
public int TotalGroups { get; set; }
public string? NextGroupName { get; set; }
public List<CheckinRoundOptionDto> Rounds { get; set; } = new();
public List<CheckinAthleteDto> Athletes { get; set; } = new();
public List<CheckinAthleteDto> PendingAthletes { get; set; } = new();
public List<CheckinAthleteDto> CheckedAthletes { get; set; } = new();
public List<CheckinAthleteDto> LockedAthletes { get; set; } = new();
}
/// <summary>
/// 更新检录状态输入参数
/// </summary>
public class UpdateCheckinStatusInput
{
[Required(ErrorMessage = "秩序册列标识不能为空")]
public string UnitKey { get; set; } = string.Empty;
public long EventProjectId { get; set; }
public long GroupId { get; set; }
public bool Checked { get; set; }
}
/// <summary>
/// 秩序册检录列状态DTO
/// </summary>
public class CheckinOrderBookUnitStatusDto : CheckinOrderBookUnitDto
{
public bool Checked { get; set; }
public bool PreviousPassed { get; set; } = true;
public bool CanCheck { get; set; } = true;
public string LockReason { get; set; } = string.Empty;
/// <summary>
/// 是否已上场;三检通过即视为上场。
/// </summary>
public bool OnStage { get; set; }
}
/// <summary>
/// 检录员开始检录并通知报名人员的入参
/// </summary>
public class StartCheckinInput
{
[Required(ErrorMessage = "赛事项目ID不能为空")]
public long EventProjectId { get; set; }
/// <summary>兼容旧客户端;项目级检录时无需传组别。</summary>
public long? GroupId { get; set; }
}
/// <summary>
/// 开始检录后的通知结果
/// </summary>
public class StartCheckinOutput
{
public long TaskId { get; set; }
public long EventProjectId { get; set; }
public string ProjectName { get; set; } = string.Empty;
public long GroupId { get; set; }
public string GroupName { get; set; } = string.Empty;
/// <summary>
/// 本次通知覆盖的秩序册列数量
/// </summary>
public int UnitCount { get; set; }
/// <summary>
/// 应通知人数
/// </summary>
public int NoticeTotal { get; set; }
/// <summary>
/// 短信通知成功人数
/// </summary>
public int SmsSuccessCount { get; set; }
/// <summary>
/// 短信通知失败人数(手机号缺失或发送异常)
/// </summary>
public int SmsFailedCount { get; set; }
public string Message { get; set; } = string.Empty;
public CheckinContextDto Context { get; set; } = new();
}
/// <summary>
/// 扫码检录入参;扫码内容为运动员号码布编号或报名人员ID。
/// </summary>
public class ScanCheckinInput
{
[Required(ErrorMessage = "扫码内容不能为空")]
public string Code { get; set; } = string.Empty;
public long? EventProjectId { get; set; }
public long? GroupId { get; set; }
}
/// <summary>
/// 扫码检录结果
/// </summary>
public class ScanCheckinOutput
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
public string UnitKey { get; set; } = string.Empty;
public string ProjectName { get; set; } = string.Empty;
public string GroupName { get; set; } = string.Empty;
public string UnitName { get; set; } = string.Empty;
public string AthleteName { get; set; } = string.Empty;
public string BibNo { get; set; } = string.Empty;
public CheckinContextDto? Context { get; set; }
}
/// <summary>
/// 标记秩序册列上场的入参;仅三检检录员可操作。
/// </summary>
public class CheckinOnStageInput
{
[Required(ErrorMessage = "秩序册列标识不能为空")]
public string UnitKey { get; set; } = string.Empty;
public long EventProjectId { get; set; }
public long GroupId { get; set; }
}
/// <summary>
/// 面向运动员、教练的检录进度总览
/// </summary>
public class CheckinProgressOutput
{
public long EventId { get; set; }
public string EventName { get; set; } = string.Empty;
/// <summary>
/// 服务端当前时间,供小程序顶部时间展示。
/// </summary>
public DateTime ServerTime { get; set; }
public string ServerTimeText { get; set; } = string.Empty;
public string WeekDayText { get; set; } = string.Empty;
/// <summary>
/// 当前检录项目(检录中的项目组别),无进行中项目时为空。
/// </summary>
public CheckinProgressStageDto? CurrentCheckin { get; set; }
/// <summary>
/// 当前正在比赛的项目组别(三检已上场的最新一列)
/// </summary>
public CheckinProgressStageDto? CurrentCompeting { get; set; }
/// <summary>
/// 赛事检录顺序,按秩序册顺序输出三态。
/// </summary>
public List<CheckinProgressStageDto> Stages { get; set; } = new();
/// <summary>
/// 我(或我关联的运动员)在本赛事的报名检录明细
/// </summary>
public List<CheckinProgressMineDto> Mine { get; set; } = new();
}
/// <summary>
/// 检录进度中的一个项目组别阶段
/// </summary>
public class CheckinProgressStageDto
{
public long EventProjectId { get; set; }
public long? GroupId { get; set; }
public string ProjectName { get; set; } = string.Empty;
public string GroupName { get; set; } = string.Empty;
/// <summary>
/// 项目-组别拼接名称,用于页面直接展示。
/// </summary>
public string DisplayName { get; set; } = string.Empty;
public int Order { get; set; }
/// <summary>
/// 阶段状态:1-检录中,2-即将开始,3-等待中,4-已完成。
/// </summary>
public int StageStatus { get; set; }
public string StageStatusText { get; set; } = string.Empty;
public int TotalUnits { get; set; }
public int CheckedUnits { get; set; }
public int ProgressPercent { get; set; }
/// <summary>
/// 该阶段正在比赛的队伍名称
/// </summary>
public string TeamName { get; set; } = string.Empty;
/// <summary>
/// 该阶段正在比赛的单位名称
/// </summary>
public string UnitName { get; set; } = string.Empty;
/// <summary>
/// 报名类型展示文本:个人报名或团队报名
/// </summary>
public string RegistrationTypeText { get; set; } = string.Empty;
/// <summary>
/// 该阶段正在比赛的队员名称列表
/// </summary>
public List<string> AthleteNames { get; set; } = new();
}
/// <summary>
/// 我的检录明细卡片
/// </summary>
public class CheckinProgressMineDto
{
public string UnitKey { get; set; } = string.Empty;
public long EventProjectId { get; set; }
public long? GroupId { get; set; }
public string ProjectName { get; set; } = string.Empty;
public string GroupName { get; set; } = string.Empty;
public string DisplayName { get; set; } = string.Empty;
/// <summary>
/// 运动员姓名列表;教练查看时为其带训报名人员。
/// </summary>
public List<string> AthleteNames { get; set; } = new();
public string TeamName { get; set; } = string.Empty;
public string UnitName { get; set; } = string.Empty;
public int SessionIndex { get; set; }
public string VenueName { get; set; } = string.Empty;
/// <summary>
/// 我的检录状态:0-等待中,1-检录中,2-已检录,3-已上场。
/// </summary>
public int CheckinStatus { get; set; }
public string CheckinStatusText { get; set; } = string.Empty;
/// <summary>
/// 各检次通过情况明细
/// </summary>
public List<CheckinProgressRoundDto> Rounds { get; set; } = new();
/// <summary>
/// 页面提示,例如“请前往检录口”。
/// </summary>
public string Notice { get; set; } = string.Empty;
}
/// <summary>
/// 单个检次的通过情况
/// </summary>
public class CheckinProgressRoundDto
{
public int CheckinNo { get; set; }
public string CheckinName { get; set; } = string.Empty;
public bool Passed { get; set; }
public DateTime? CheckedTime { get; set; }
/// <summary>
/// 执行本次检录的检录员姓名
/// </summary>
public string CheckerName { get; set; } = string.Empty;
}
/// <summary>
/// 检录投屏数据
/// </summary>
public class CheckinScreenCastOutput
{
public long EventId { get; set; }
public string EventName { get; set; } = string.Empty;
public DateTime ServerTime { get; set; }
public string ServerTimeText { get; set; } = string.Empty;
public string WeekDayText { get; set; } = string.Empty;
public CheckinProgressStageDto? CurrentCheckin { get; set; }
public CheckinProgressStageDto? CurrentCompeting { get; set; }
public List<CheckinProgressStageDto> Stages { get; set; } = new();
/// <summary>
/// 当前检录项目下待上场的队伍明细,供大屏滚动展示。
/// </summary>
public List<CheckinScreenCastUnitDto> Units { get; set; } = new();
}
/// <summary>
/// 投屏中的一列检录对象
/// </summary>
public class CheckinScreenCastUnitDto
{
public string UnitKey { get; set; } = string.Empty;
public int Order { get; set; }
public int SessionIndex { get; set; }
public string VenueName { get; set; } = string.Empty;
public string ProjectName { get; set; } = string.Empty;
public string GroupName { get; set; } = string.Empty;
public string TeamName { get; set; } = string.Empty;
public string UnitName { get; set; } = string.Empty;
public List<string> AthleteNames { get; set; } = new();
public int CheckinStatus { get; set; }
public string CheckinStatusText { get; set; } = string.Empty;
}