diff --git a/YD_Event.Application/Client/EventClientController.cs b/YD_Event.Application/Client/EventClientController.cs index c44cd9b..57b5ccb 100644 --- a/YD_Event.Application/Client/EventClientController.cs +++ b/YD_Event.Application/Client/EventClientController.cs @@ -913,6 +913,9 @@ public class EventClientController : IDynamicApiController if (reg == null) throw Oops.Bah("报名记录不存在"); + // 预报名记录不可见 + if (reg.PaymentStatus == 5) throw Oops.Bah("报名记录不存在"); + // 计算 EventStatus EventStatus status = EventStatus.Enrolling; var now = DateTime.Now; diff --git a/YD_Event.Application/Client/MyController.cs b/YD_Event.Application/Client/MyController.cs index 1c91865..4e222d2 100644 --- a/YD_Event.Application/Client/MyController.cs +++ b/YD_Event.Application/Client/MyController.cs @@ -605,7 +605,7 @@ public class MyController : IDynamicApiController // 1. 先分页查询报名记录 var regQuery = _registrationRepository.AsQueryable() - .Where(r => r.CreatedUserId == userId && !r.DeleteMark && r.PaymentStatus != 3 && r.PaymentStatus != 4) + .Where(r => r.CreatedUserId == userId && !r.DeleteMark && r.PaymentStatus != 3 && r.PaymentStatus != 4 && r.PaymentStatus != 5) .OrderByDescending(r => r.RegistrationTime); var pagedRegs = await regQuery.ToPagedListAsync(input); diff --git a/YD_Event.Application/Event/EventArrangementService.cs b/YD_Event.Application/Event/EventArrangementService.cs index 8c431b3..62b8492 100644 --- a/YD_Event.Application/Event/EventArrangementService.cs +++ b/YD_Event.Application/Event/EventArrangementService.cs @@ -107,7 +107,7 @@ namespace YD_Event.Application.Event; .InnerJoin((p, r) => p.RegistrationId == r.Id) .Where((p, r) => r.EventId == eventId && r.PaymentStatus != 4 && r.PaymentStatus != 3 // 排除已取消的报名 - && r.PaymentStatus != 3 // 排除已退款的报名 + && r.PaymentStatus != 5 // 排除预报名记录 && !p.DeleteMark // 排除已删除的人员 && p.PersonType == PersonType.Athlete) // 只统计运动员 .GroupBy((p, r) => new { p.ProjectId, p.GroupName }) @@ -119,6 +119,7 @@ namespace YD_Event.Application.Event; .InnerJoin((p, r) => p.RegistrationId == r.Id) .Where((p, r) => r.EventId == eventId && r.PaymentStatus != 4 && r.PaymentStatus != 3 + && r.PaymentStatus != 5 // 排除预报名记录 && !p.DeleteMark && p.PersonType == PersonType.Athlete && r.TeamName != null) @@ -284,6 +285,7 @@ namespace YD_Event.Application.Event; .InnerJoin((p, r) => p.RegistrationId == r.Id) .Where((p, r) => r.EventId == eventId && r.PaymentStatus != 4 && r.PaymentStatus != 3 + && r.PaymentStatus != 5 // 排除预报名记录 && !p.DeleteMark && p.PersonType == PersonType.Athlete) .GroupBy((p, r) => new { p.ProjectId, p.GroupName }) @@ -295,6 +297,7 @@ namespace YD_Event.Application.Event; .InnerJoin((p, r) => p.RegistrationId == r.Id) .Where((p, r) => r.EventId == eventId && r.PaymentStatus != 4 && r.PaymentStatus != 3 + && r.PaymentStatus != 5 // 排除预报名记录 && !p.DeleteMark && p.PersonType == PersonType.Athlete && r.TeamName != null) @@ -325,6 +328,7 @@ namespace YD_Event.Application.Event; .InnerJoin((p, r) => p.RegistrationId == r.Id) .Where((p, r) => p.ProjectId == eventProj.Id && r.PaymentStatus != 4 && r.PaymentStatus != 3 + && r.PaymentStatus != 5 // 排除预报名记录 && !p.DeleteMark && p.PersonType == PersonType.Athlete) .OrderBy(p => p.GroupName) diff --git a/YD_Event.Application/Event/EventRecordService.cs b/YD_Event.Application/Event/EventRecordService.cs index 42da748..30f9bd0 100644 --- a/YD_Event.Application/Event/EventRecordService.cs +++ b/YD_Event.Application/Event/EventRecordService.cs @@ -86,6 +86,7 @@ public class EventRecordService : BaseService, ITransient .LeftJoin((r, e, u) => r.CreatedUserId == u.Id) .LeftJoin((r, e, u, s) => r.CreatedUserId == s.Id) .LeftJoin((r, e, u, s, m) => r.CreatedUserId == m.CreatedUserId) + .Where((r, e, u, s, m) => r.PaymentStatus != 5) // 排除预报名记录 .WhereIF(!string.IsNullOrWhiteSpace(input.EventName), (r, e, u, s, m) => e.EventName.Contains(input.EventName)) .WhereIF(input.StartTime.HasValue, (r, e, u, s, m) => e.MatchStartTime >= input.StartTime) .WhereIF(input.EndTime.HasValue, (r, e, u, s, m) => e.MatchStartTime <= input.EndTime) diff --git a/YD_Event.Application/Event/EventRegistrationService.cs b/YD_Event.Application/Event/EventRegistrationService.cs index 4d9f5ff..47bfa52 100644 --- a/YD_Event.Application/Event/EventRegistrationService.cs +++ b/YD_Event.Application/Event/EventRegistrationService.cs @@ -66,7 +66,7 @@ public class EventRegistrationService : BaseService, ITransie public async Task> Page(RegistrationQueryInput input) { var query = _repository.AsQueryable() - .Where(x => x.PaymentStatus != 4 && x.PaymentStatus != 3) // 过滤掉已取消和已退款的报名记录 + .Where(x => x.PaymentStatus != 4 && x.PaymentStatus != 3 && x.PaymentStatus != 5) // 过滤掉已取消、已退款和预报名的记录 .WhereIF(input.EventId.HasValue, x => x.EventId == input.EventId) .WhereIF(input.RegistrationMode.HasValue, x => x.RegistrationMode == input.RegistrationMode) .WhereIF(!string.IsNullOrWhiteSpace(input.UnitName), x => x.TeamName.Contains(input.UnitName)) @@ -490,7 +490,7 @@ public class EventRegistrationService : BaseService, ITransie public async Task Export(RegistrationQueryInput input) { var registrations = await _repository.AsQueryable() - .Where(x => x.PaymentStatus != 4 && x.PaymentStatus != 3) // 过滤掉已取消和已退款的报名记录 + .Where(x => x.PaymentStatus != 4 && x.PaymentStatus != 3 && x.PaymentStatus != 5) // 过滤掉已取消、已退款和预报名的记录 .WhereIF(input.EventId.HasValue, x => x.EventId == input.EventId) .WhereIF(input.RegistrationMode.HasValue, x => x.RegistrationMode == input.RegistrationMode) .WhereIF(!string.IsNullOrWhiteSpace(input.UnitName), x => x.TeamName.Contains(input.UnitName)) diff --git a/YD_Event.Application/Event/EventScoreService.cs b/YD_Event.Application/Event/EventScoreService.cs index 346c2ba..ec544cc 100644 --- a/YD_Event.Application/Event/EventScoreService.cs +++ b/YD_Event.Application/Event/EventScoreService.cs @@ -133,6 +133,7 @@ public class EventScoreService : BaseService, ITransient .Where((p, r, res, c) => r.EventId == input.EventId && r.PaymentStatus != 3 // 排除已退款的报名 && r.PaymentStatus != 4 // 排除已取消的报名 + && r.PaymentStatus != 5 // 排除预报名记录 && (p.PersonType == PersonType.Athlete || p.PersonType == PersonType.User)); // 应用筛选条件 @@ -338,7 +339,9 @@ public class EventScoreService : BaseService, ITransient // 步骤1:获取该赛事的所有运动员的 UserId var athleteUserIds = await _personRepository.AsQueryable() .InnerJoin((p, r) => p.RegistrationId == r.Id) - .Where((p, r) => r.EventId == input.EventId && p.PersonType == PersonType.Athlete && !p.DeleteMark) + .Where((p, r) => r.EventId == input.EventId + && r.PaymentStatus != 5 // 排除预报名记录 + && p.PersonType == PersonType.Athlete && !p.DeleteMark) .Select(p => p.UserId) .ToListAsync(); @@ -378,7 +381,9 @@ public class EventScoreService : BaseService, ITransient // 这样可以获取到 EventRegistrationPerson.Id 用于证书发放 var existingPersons = await _personRepository.AsQueryable() .InnerJoin((p, r) => p.RegistrationId == r.Id) - .Where((p, r) => r.EventId == input.EventId && coachLeaderUserIds.Contains(p.UserId) && p.PersonType == input.PersonType && !p.DeleteMark) + .Where((p, r) => r.EventId == input.EventId + && r.PaymentStatus != 5 // 排除预报名记录 + && coachLeaderUserIds.Contains(p.UserId) && p.PersonType == input.PersonType && !p.DeleteMark) .LeftJoin((p, r, u) => p.UserId == u.Id) .Select((p, r, u) => new { @@ -893,7 +898,9 @@ public class EventScoreService : BaseService, ITransient var relatedAthleteRegistrations = await _personRepository.AsQueryable() .InnerJoin((p, r) => p.RegistrationId == r.Id) .InnerJoin((p, r, tm) => p.UserId == tm.UserId) - .Where((p, r, tm) => r.EventId == input.EventId && teamIds.Contains(tm.TeamId) && !p.DeleteMark) + .Where((p, r, tm) => r.EventId == input.EventId + && r.PaymentStatus != 5 // 排除预报名记录 + && teamIds.Contains(tm.TeamId) && !p.DeleteMark) .Select((p, r) => r) .ToListAsync(); diff --git a/YD_Event.Application/Event/UnifiedRegistrationService.cs b/YD_Event.Application/Event/UnifiedRegistrationService.cs index fd8c782..485bea6 100644 --- a/YD_Event.Application/Event/UnifiedRegistrationService.cs +++ b/YD_Event.Application/Event/UnifiedRegistrationService.cs @@ -179,7 +179,7 @@ public class UnifiedRegistrationService : ITransient registration.TeamName = input.RegistrationMode == 2 ? input.TeamName : null; registration.ContactName = input.ContactName; registration.ContactPhone = input.ContactPhone; - registration.PaymentStatus = 0; + registration.PaymentStatus = 5; // 5=待支付确认,不占用正式名额 registration.OrderNo = string.Empty; // 清空旧的订单号,确保重新生成新订单 registration.UpdatedTime = DateTime.Now; registration.UpdatedUserId = input.CreatedUserId; diff --git a/YD_Event.Application/Event/UserEventRecordService.cs b/YD_Event.Application/Event/UserEventRecordService.cs index 5731e5a..0ae117f 100644 --- a/YD_Event.Application/Event/UserEventRecordService.cs +++ b/YD_Event.Application/Event/UserEventRecordService.cs @@ -109,9 +109,11 @@ public class UserEventRecordService : IDynamicApiController, ITransient // - 免费赛事:直接显示 // - 线下支付时:显示未支付(0)和已支付(1)状态的数据 // - 线上支付时:仅显示已支付(1)状态的数据 + // - 排除预报名记录(5),仅在支付成功后才可见 .Where((r, e, fc) => r.PaymentStatus != 3 && // 排除已退款的报名 r.PaymentStatus != 4 && // 排除已取消的报名 + r.PaymentStatus != 5 && // 排除预报名记录 ((e.ChargeMode == ChargeMode.Free) || (r.PaymentMethod == 1 && (r.PaymentStatus == 0 || r.PaymentStatus == 1)) || (r.PaymentMethod == 2 && r.PaymentStatus == 1))) @@ -646,6 +648,9 @@ public class UserEventRecordService : IDynamicApiController, ITransient var userId = _authManager.UserId; var registration = await _registrationRepository.GetFirstAsync(x => x.Id == registrationId && x.CreatedUserId == userId); if (registration == null) throw Oops.Bah("报名记录不存在"); + + // 预报名记录不可见 + if (registration.PaymentStatus == 5) throw Oops.Bah("报名记录不存在"); // 获取赛事信息 var eventInfo = await _eventRepository.GetByIdAsync(registration.EventId); diff --git a/YD_Event.Application/YD_Event.Application.xml b/YD_Event.Application/YD_Event.Application.xml index dcfbebc..8f0cc52 100644 --- a/YD_Event.Application/YD_Event.Application.xml +++ b/YD_Event.Application/YD_Event.Application.xml @@ -2792,9 +2792,19 @@ 退款原因 - + - 取消的项目ID列表(可选,用于部分取消) + 取消类型:0-全部取消,1-部分取消 + + + + + 取消的人员ID列表(部分取消时使用) + + + + + 取消的团队Key列表(部分取消时使用) @@ -3701,6 +3711,11 @@ 上传素材输入参数 操作是否成功 + + + 计算退款金额 + + 取消报名并申请退款 @@ -8719,7 +8734,7 @@ 赛事状态自动更新后台服务 - 每5分钟执行一次,自动更新赛事状态 + 每10秒执行一次,自动更新赛事状态