修复赛事项目组别匹配问题
This commit is contained in:
parent
9f93b742ef
commit
5a42d6ce4c
@ -16,7 +16,7 @@ namespace YD_Event.Application.Event;
|
|||||||
{
|
{
|
||||||
private readonly ISqlSugarRepository<EventProject> _eventProjectRepository;
|
private readonly ISqlSugarRepository<EventProject> _eventProjectRepository;
|
||||||
private readonly ISqlSugarRepository<YD_Event.Core.Entities.Project> _projectRepository;
|
private readonly ISqlSugarRepository<YD_Event.Core.Entities.Project> _projectRepository;
|
||||||
private readonly ISqlSugarRepository<ProjectGroup> _groupRepository;
|
private readonly ISqlSugarRepository<EventProjectGroup> _eventProjectGroupRepository;
|
||||||
private readonly ISqlSugarRepository<EventRegistrationPerson> _personRepository;
|
private readonly ISqlSugarRepository<EventRegistrationPerson> _personRepository;
|
||||||
private readonly ISqlSugarRepository<EventRegistration> _registrationRepository;
|
private readonly ISqlSugarRepository<EventRegistration> _registrationRepository;
|
||||||
private readonly ISqlSugarRepository<EventInfo> _eventInfoRepository;
|
private readonly ISqlSugarRepository<EventInfo> _eventInfoRepository;
|
||||||
@ -33,7 +33,7 @@ namespace YD_Event.Application.Event;
|
|||||||
public EventArrangementService(
|
public EventArrangementService(
|
||||||
ISqlSugarRepository<EventProject> eventProjectRepository,
|
ISqlSugarRepository<EventProject> eventProjectRepository,
|
||||||
ISqlSugarRepository<YD_Event.Core.Entities.Project> projectRepository,
|
ISqlSugarRepository<YD_Event.Core.Entities.Project> projectRepository,
|
||||||
ISqlSugarRepository<ProjectGroup> groupRepository,
|
ISqlSugarRepository<EventProjectGroup> eventProjectGroupRepository,
|
||||||
ISqlSugarRepository<EventRegistrationPerson> personRepository,
|
ISqlSugarRepository<EventRegistrationPerson> personRepository,
|
||||||
ISqlSugarRepository<EventRegistration> registrationRepository,
|
ISqlSugarRepository<EventRegistration> registrationRepository,
|
||||||
ISqlSugarRepository<EventInfo> eventInfoRepository,
|
ISqlSugarRepository<EventInfo> eventInfoRepository,
|
||||||
@ -49,7 +49,7 @@ namespace YD_Event.Application.Event;
|
|||||||
{
|
{
|
||||||
_eventProjectRepository = eventProjectRepository;
|
_eventProjectRepository = eventProjectRepository;
|
||||||
_projectRepository = projectRepository;
|
_projectRepository = projectRepository;
|
||||||
_groupRepository = groupRepository;
|
_eventProjectGroupRepository = eventProjectGroupRepository;
|
||||||
_personRepository = personRepository;
|
_personRepository = personRepository;
|
||||||
_registrationRepository = registrationRepository;
|
_registrationRepository = registrationRepository;
|
||||||
_eventInfoRepository = eventInfoRepository;
|
_eventInfoRepository = eventInfoRepository;
|
||||||
@ -120,7 +120,8 @@ namespace YD_Event.Application.Event;
|
|||||||
// 按照 SortIndex 对 projects 排序
|
// 按照 SortIndex 对 projects 排序
|
||||||
var sortedProjects = projects.OrderBy(x => x.SortIndex).ThenBy(x => x.Id).ToList();
|
var sortedProjects = projects.OrderBy(x => x.SortIndex).ThenBy(x => x.Id).ToList();
|
||||||
|
|
||||||
var groups = await _groupRepository.GetListAsync(x => projectIds.Contains(x.ProjectId));
|
var groups = await _eventProjectGroupRepository.GetListAsync(x =>
|
||||||
|
x.EventId == eventId && projectIds.Contains(x.ProjectId) && !x.DeleteMark);
|
||||||
|
|
||||||
// 统计各组别报名人数(统计所有非取消状态的报名,并且只统计运动员
|
// 统计各组别报名人数(统计所有非取消状态的报名,并且只统计运动员
|
||||||
var counts = await _personRepository.AsQueryable()
|
var counts = await _personRepository.AsQueryable()
|
||||||
@ -322,7 +323,8 @@ namespace YD_Event.Application.Event;
|
|||||||
|
|
||||||
// 按照 SortIndex 对 projects 排序
|
// 按照 SortIndex 对 projects 排序
|
||||||
var sortedProjects = projects.OrderBy(x => x.SortIndex).ThenBy(x => x.Id).ToList();
|
var sortedProjects = projects.OrderBy(x => x.SortIndex).ThenBy(x => x.Id).ToList();
|
||||||
var groups = await _groupRepository.GetListAsync(x => projectIds.Contains(x.ProjectId));
|
var groups = await _eventProjectGroupRepository.GetListAsync(x =>
|
||||||
|
x.EventId == eventId && projectIds.Contains(x.ProjectId) && !x.DeleteMark);
|
||||||
|
|
||||||
// 统计各组别报名人数
|
// 统计各组别报名人数
|
||||||
var counts = await _personRepository.AsQueryable()
|
var counts = await _personRepository.AsQueryable()
|
||||||
@ -637,7 +639,7 @@ namespace YD_Event.Application.Event;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private static void AssignFreestyleVenues(
|
private static void AssignFreestyleVenues(
|
||||||
List<ArrangementPreviewOutput> entries,
|
List<ArrangementPreviewOutput> entries,
|
||||||
IReadOnlyCollection<ProjectGroup> projectGroups,
|
IReadOnlyCollection<EventProjectGroup> projectGroups,
|
||||||
int venueCount,
|
int venueCount,
|
||||||
int firstSessionIndex)
|
int firstSessionIndex)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -109,10 +109,8 @@ public partial class WorkbenchController : IDynamicApiController
|
|||||||
.Where(e => !e.DeleteMark)
|
.Where(e => !e.DeleteMark)
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.EventName), e => e.EventName.Contains(input.EventName!.Trim()));
|
.WhereIF(!string.IsNullOrWhiteSpace(input.EventName), e => e.EventName.Contains(input.EventName!.Trim()));
|
||||||
|
|
||||||
// 报名平台入口只展示进行中/已结束的赛事;秩序册入口不限制赛事状态
|
// 两种数据来源均展示全部未删除赛事,仅校验来源参数是否合法
|
||||||
if (mode == "registration")
|
if (mode != "registration" && mode != "orderbook")
|
||||||
query = query.Where(e => e.EventStatus == Core.Enum.EventStatus.Ongoing || e.EventStatus == Core.Enum.EventStatus.Ended);
|
|
||||||
else if (mode != "orderbook")
|
|
||||||
throw Oops.Bah("数据来源只能为registration或orderbook");
|
throw Oops.Bah("数据来源只能为registration或orderbook");
|
||||||
|
|
||||||
return await query.OrderByDescending(e => e.MatchStartTime)
|
return await query.OrderByDescending(e => e.MatchStartTime)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user