预报名查询筛选
This commit is contained in:
parent
e054865d27
commit
12562f962c
@ -913,6 +913,9 @@ public class EventClientController : IDynamicApiController
|
|||||||
|
|
||||||
if (reg == null) throw Oops.Bah("报名记录不存在");
|
if (reg == null) throw Oops.Bah("报名记录不存在");
|
||||||
|
|
||||||
|
// 预报名记录不可见
|
||||||
|
if (reg.PaymentStatus == 5) throw Oops.Bah("报名记录不存在");
|
||||||
|
|
||||||
// 计算 EventStatus
|
// 计算 EventStatus
|
||||||
EventStatus status = EventStatus.Enrolling;
|
EventStatus status = EventStatus.Enrolling;
|
||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
|
|||||||
@ -605,7 +605,7 @@ public class MyController : IDynamicApiController
|
|||||||
|
|
||||||
// 1. 先分页查询报名记录
|
// 1. 先分页查询报名记录
|
||||||
var regQuery = _registrationRepository.AsQueryable()
|
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);
|
.OrderByDescending(r => r.RegistrationTime);
|
||||||
|
|
||||||
var pagedRegs = await regQuery.ToPagedListAsync(input);
|
var pagedRegs = await regQuery.ToPagedListAsync(input);
|
||||||
|
|||||||
@ -107,7 +107,7 @@ namespace YD_Event.Application.Event;
|
|||||||
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
||||||
.Where((p, r) => r.EventId == eventId
|
.Where((p, r) => r.EventId == eventId
|
||||||
&& r.PaymentStatus != 4 && r.PaymentStatus != 3 // 排除已取消的报名
|
&& r.PaymentStatus != 4 && r.PaymentStatus != 3 // 排除已取消的报名
|
||||||
&& r.PaymentStatus != 3 // 排除已退款的报名
|
&& r.PaymentStatus != 5 // 排除预报名记录
|
||||||
&& !p.DeleteMark // 排除已删除的人员
|
&& !p.DeleteMark // 排除已删除的人员
|
||||||
&& p.PersonType == PersonType.Athlete) // 只统计运动员
|
&& p.PersonType == PersonType.Athlete) // 只统计运动员
|
||||||
.GroupBy((p, r) => new { p.ProjectId, p.GroupName })
|
.GroupBy((p, r) => new { p.ProjectId, p.GroupName })
|
||||||
@ -119,6 +119,7 @@ namespace YD_Event.Application.Event;
|
|||||||
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
||||||
.Where((p, r) => r.EventId == eventId
|
.Where((p, r) => r.EventId == eventId
|
||||||
&& r.PaymentStatus != 4 && r.PaymentStatus != 3
|
&& r.PaymentStatus != 4 && r.PaymentStatus != 3
|
||||||
|
&& r.PaymentStatus != 5 // 排除预报名记录
|
||||||
&& !p.DeleteMark
|
&& !p.DeleteMark
|
||||||
&& p.PersonType == PersonType.Athlete
|
&& p.PersonType == PersonType.Athlete
|
||||||
&& r.TeamName != null)
|
&& r.TeamName != null)
|
||||||
@ -284,6 +285,7 @@ namespace YD_Event.Application.Event;
|
|||||||
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
||||||
.Where((p, r) => r.EventId == eventId
|
.Where((p, r) => r.EventId == eventId
|
||||||
&& r.PaymentStatus != 4 && r.PaymentStatus != 3
|
&& r.PaymentStatus != 4 && r.PaymentStatus != 3
|
||||||
|
&& r.PaymentStatus != 5 // 排除预报名记录
|
||||||
&& !p.DeleteMark
|
&& !p.DeleteMark
|
||||||
&& p.PersonType == PersonType.Athlete)
|
&& p.PersonType == PersonType.Athlete)
|
||||||
.GroupBy((p, r) => new { p.ProjectId, p.GroupName })
|
.GroupBy((p, r) => new { p.ProjectId, p.GroupName })
|
||||||
@ -295,6 +297,7 @@ namespace YD_Event.Application.Event;
|
|||||||
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
||||||
.Where((p, r) => r.EventId == eventId
|
.Where((p, r) => r.EventId == eventId
|
||||||
&& r.PaymentStatus != 4 && r.PaymentStatus != 3
|
&& r.PaymentStatus != 4 && r.PaymentStatus != 3
|
||||||
|
&& r.PaymentStatus != 5 // 排除预报名记录
|
||||||
&& !p.DeleteMark
|
&& !p.DeleteMark
|
||||||
&& p.PersonType == PersonType.Athlete
|
&& p.PersonType == PersonType.Athlete
|
||||||
&& r.TeamName != null)
|
&& r.TeamName != null)
|
||||||
@ -325,6 +328,7 @@ namespace YD_Event.Application.Event;
|
|||||||
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
||||||
.Where((p, r) => p.ProjectId == eventProj.Id
|
.Where((p, r) => p.ProjectId == eventProj.Id
|
||||||
&& r.PaymentStatus != 4 && r.PaymentStatus != 3
|
&& r.PaymentStatus != 4 && r.PaymentStatus != 3
|
||||||
|
&& r.PaymentStatus != 5 // 排除预报名记录
|
||||||
&& !p.DeleteMark
|
&& !p.DeleteMark
|
||||||
&& p.PersonType == PersonType.Athlete)
|
&& p.PersonType == PersonType.Athlete)
|
||||||
.OrderBy(p => p.GroupName)
|
.OrderBy(p => p.GroupName)
|
||||||
|
|||||||
@ -86,6 +86,7 @@ public class EventRecordService : BaseService<EventRegistration>, ITransient
|
|||||||
.LeftJoin<AppUserEntity>((r, e, u) => r.CreatedUserId == u.Id)
|
.LeftJoin<AppUserEntity>((r, e, u) => r.CreatedUserId == u.Id)
|
||||||
.LeftJoin<SysUserEntity>((r, e, u, s) => r.CreatedUserId == s.Id)
|
.LeftJoin<SysUserEntity>((r, e, u, s) => r.CreatedUserId == s.Id)
|
||||||
.LeftJoin<MerchantEntity>((r, e, u, s, m) => r.CreatedUserId == m.CreatedUserId)
|
.LeftJoin<MerchantEntity>((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(!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.StartTime.HasValue, (r, e, u, s, m) => e.MatchStartTime >= input.StartTime)
|
||||||
.WhereIF(input.EndTime.HasValue, (r, e, u, s, m) => e.MatchStartTime <= input.EndTime)
|
.WhereIF(input.EndTime.HasValue, (r, e, u, s, m) => e.MatchStartTime <= input.EndTime)
|
||||||
|
|||||||
@ -66,7 +66,7 @@ public class EventRegistrationService : BaseService<EventRegistration>, ITransie
|
|||||||
public async Task<PageResult<RegistrationListOutput>> Page(RegistrationQueryInput input)
|
public async Task<PageResult<RegistrationListOutput>> Page(RegistrationQueryInput input)
|
||||||
{
|
{
|
||||||
var query = _repository.AsQueryable()
|
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.EventId.HasValue, x => x.EventId == input.EventId)
|
||||||
.WhereIF(input.RegistrationMode.HasValue, x => x.RegistrationMode == input.RegistrationMode)
|
.WhereIF(input.RegistrationMode.HasValue, x => x.RegistrationMode == input.RegistrationMode)
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.UnitName), x => x.TeamName.Contains(input.UnitName))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.UnitName), x => x.TeamName.Contains(input.UnitName))
|
||||||
@ -490,7 +490,7 @@ public class EventRegistrationService : BaseService<EventRegistration>, ITransie
|
|||||||
public async Task<byte[]> Export(RegistrationQueryInput input)
|
public async Task<byte[]> Export(RegistrationQueryInput input)
|
||||||
{
|
{
|
||||||
var registrations = await _repository.AsQueryable()
|
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.EventId.HasValue, x => x.EventId == input.EventId)
|
||||||
.WhereIF(input.RegistrationMode.HasValue, x => x.RegistrationMode == input.RegistrationMode)
|
.WhereIF(input.RegistrationMode.HasValue, x => x.RegistrationMode == input.RegistrationMode)
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.UnitName), x => x.TeamName.Contains(input.UnitName))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.UnitName), x => x.TeamName.Contains(input.UnitName))
|
||||||
|
|||||||
@ -133,6 +133,7 @@ public class EventScoreService : BaseService<EventResult>, ITransient
|
|||||||
.Where((p, r, res, c) => r.EventId == input.EventId
|
.Where((p, r, res, c) => r.EventId == input.EventId
|
||||||
&& r.PaymentStatus != 3 // 排除已退款的报名
|
&& r.PaymentStatus != 3 // 排除已退款的报名
|
||||||
&& r.PaymentStatus != 4 // 排除已取消的报名
|
&& r.PaymentStatus != 4 // 排除已取消的报名
|
||||||
|
&& r.PaymentStatus != 5 // 排除预报名记录
|
||||||
&& (p.PersonType == PersonType.Athlete || p.PersonType == PersonType.User));
|
&& (p.PersonType == PersonType.Athlete || p.PersonType == PersonType.User));
|
||||||
|
|
||||||
// 应用筛选条件
|
// 应用筛选条件
|
||||||
@ -338,7 +339,9 @@ public class EventScoreService : BaseService<EventResult>, ITransient
|
|||||||
// 步骤1:获取该赛事的所有运动员的 UserId
|
// 步骤1:获取该赛事的所有运动员的 UserId
|
||||||
var athleteUserIds = await _personRepository.AsQueryable()
|
var athleteUserIds = await _personRepository.AsQueryable()
|
||||||
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
.InnerJoin<EventRegistration>((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)
|
.Select(p => p.UserId)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
@ -378,7 +381,9 @@ public class EventScoreService : BaseService<EventResult>, ITransient
|
|||||||
// 这样可以获取到 EventRegistrationPerson.Id 用于证书发放
|
// 这样可以获取到 EventRegistrationPerson.Id 用于证书发放
|
||||||
var existingPersons = await _personRepository.AsQueryable()
|
var existingPersons = await _personRepository.AsQueryable()
|
||||||
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
.InnerJoin<EventRegistration>((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<YD_Event.Core.Entities.AppUser>((p, r, u) => p.UserId == u.Id)
|
.LeftJoin<YD_Event.Core.Entities.AppUser>((p, r, u) => p.UserId == u.Id)
|
||||||
.Select((p, r, u) => new
|
.Select((p, r, u) => new
|
||||||
{
|
{
|
||||||
@ -893,7 +898,9 @@ public class EventScoreService : BaseService<EventResult>, ITransient
|
|||||||
var relatedAthleteRegistrations = await _personRepository.AsQueryable()
|
var relatedAthleteRegistrations = await _personRepository.AsQueryable()
|
||||||
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
.InnerJoin<EventRegistration>((p, r) => p.RegistrationId == r.Id)
|
||||||
.InnerJoin<TeamMember>((p, r, tm) => p.UserId == tm.UserId)
|
.InnerJoin<TeamMember>((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)
|
.Select((p, r) => r)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|||||||
@ -179,7 +179,7 @@ public class UnifiedRegistrationService : ITransient
|
|||||||
registration.TeamName = input.RegistrationMode == 2 ? input.TeamName : null;
|
registration.TeamName = input.RegistrationMode == 2 ? input.TeamName : null;
|
||||||
registration.ContactName = input.ContactName;
|
registration.ContactName = input.ContactName;
|
||||||
registration.ContactPhone = input.ContactPhone;
|
registration.ContactPhone = input.ContactPhone;
|
||||||
registration.PaymentStatus = 0;
|
registration.PaymentStatus = 5; // 5=待支付确认,不占用正式名额
|
||||||
registration.OrderNo = string.Empty; // 清空旧的订单号,确保重新生成新订单
|
registration.OrderNo = string.Empty; // 清空旧的订单号,确保重新生成新订单
|
||||||
registration.UpdatedTime = DateTime.Now;
|
registration.UpdatedTime = DateTime.Now;
|
||||||
registration.UpdatedUserId = input.CreatedUserId;
|
registration.UpdatedUserId = input.CreatedUserId;
|
||||||
|
|||||||
@ -109,9 +109,11 @@ public class UserEventRecordService : IDynamicApiController, ITransient
|
|||||||
// - 免费赛事:直接显示
|
// - 免费赛事:直接显示
|
||||||
// - 线下支付时:显示未支付(0)和已支付(1)状态的数据
|
// - 线下支付时:显示未支付(0)和已支付(1)状态的数据
|
||||||
// - 线上支付时:仅显示已支付(1)状态的数据
|
// - 线上支付时:仅显示已支付(1)状态的数据
|
||||||
|
// - 排除预报名记录(5),仅在支付成功后才可见
|
||||||
.Where((r, e, fc) =>
|
.Where((r, e, fc) =>
|
||||||
r.PaymentStatus != 3 && // 排除已退款的报名
|
r.PaymentStatus != 3 && // 排除已退款的报名
|
||||||
r.PaymentStatus != 4 && // 排除已取消的报名
|
r.PaymentStatus != 4 && // 排除已取消的报名
|
||||||
|
r.PaymentStatus != 5 && // 排除预报名记录
|
||||||
((e.ChargeMode == ChargeMode.Free) ||
|
((e.ChargeMode == ChargeMode.Free) ||
|
||||||
(r.PaymentMethod == 1 && (r.PaymentStatus == 0 || r.PaymentStatus == 1)) ||
|
(r.PaymentMethod == 1 && (r.PaymentStatus == 0 || r.PaymentStatus == 1)) ||
|
||||||
(r.PaymentMethod == 2 && r.PaymentStatus == 1)))
|
(r.PaymentMethod == 2 && r.PaymentStatus == 1)))
|
||||||
@ -646,6 +648,9 @@ public class UserEventRecordService : IDynamicApiController, ITransient
|
|||||||
var userId = _authManager.UserId;
|
var userId = _authManager.UserId;
|
||||||
var registration = await _registrationRepository.GetFirstAsync(x => x.Id == registrationId && x.CreatedUserId == userId);
|
var registration = await _registrationRepository.GetFirstAsync(x => x.Id == registrationId && x.CreatedUserId == userId);
|
||||||
if (registration == null) throw Oops.Bah("报名记录不存在");
|
if (registration == null) throw Oops.Bah("报名记录不存在");
|
||||||
|
|
||||||
|
// 预报名记录不可见
|
||||||
|
if (registration.PaymentStatus == 5) throw Oops.Bah("报名记录不存在");
|
||||||
|
|
||||||
// 获取赛事信息
|
// 获取赛事信息
|
||||||
var eventInfo = await _eventRepository.GetByIdAsync(registration.EventId);
|
var eventInfo = await _eventRepository.GetByIdAsync(registration.EventId);
|
||||||
|
|||||||
@ -2792,9 +2792,19 @@
|
|||||||
退款原因
|
退款原因
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:YD_Event.Application.Client.Dtos.CancelRegistrationRefundInput.CancelItemIds">
|
<member name="P:YD_Event.Application.Client.Dtos.CancelRegistrationRefundInput.CancelType">
|
||||||
<summary>
|
<summary>
|
||||||
取消的项目ID列表(可选,用于部分取消)
|
取消类型:0-全部取消,1-部分取消
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:YD_Event.Application.Client.Dtos.CancelRegistrationRefundInput.PersonIds">
|
||||||
|
<summary>
|
||||||
|
取消的人员ID列表(部分取消时使用)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:YD_Event.Application.Client.Dtos.CancelRegistrationRefundInput.CancelTeams">
|
||||||
|
<summary>
|
||||||
|
取消的团队Key列表(部分取消时使用)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:YD_Event.Application.Client.Dtos.MiniProgramLoginInput">
|
<member name="T:YD_Event.Application.Client.Dtos.MiniProgramLoginInput">
|
||||||
@ -3701,6 +3711,11 @@
|
|||||||
<param name="input">上传素材输入参数</param>
|
<param name="input">上传素材输入参数</param>
|
||||||
<returns>操作是否成功</returns>
|
<returns>操作是否成功</returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:YD_Event.Application.Client.EventClientController.CalculateRefundAmount(YD_Event.Application.Event.Dtos.CalculateRefundAmountInput)">
|
||||||
|
<summary>
|
||||||
|
计算退款金额
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:YD_Event.Application.Client.EventClientController.CancelRegistrationRefund(YD_Event.Application.Client.Dtos.CancelRegistrationRefundInput)">
|
<member name="M:YD_Event.Application.Client.EventClientController.CancelRegistrationRefund(YD_Event.Application.Client.Dtos.CancelRegistrationRefundInput)">
|
||||||
<summary>
|
<summary>
|
||||||
取消报名并申请退款
|
取消报名并申请退款
|
||||||
@ -8719,7 +8734,7 @@
|
|||||||
<member name="T:YD_Event.Application.Event.EventStatusUpdateService">
|
<member name="T:YD_Event.Application.Event.EventStatusUpdateService">
|
||||||
<summary>
|
<summary>
|
||||||
赛事状态自动更新后台服务
|
赛事状态自动更新后台服务
|
||||||
每5分钟执行一次,自动更新赛事状态
|
每10秒执行一次,自动更新赛事状态
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:YD_Event.Application.Event.EventStatusUpdateService.CalculateEventStatus(YD_Event.Core.Entities.EventInfo,System.DateTime)">
|
<member name="M:YD_Event.Application.Event.EventStatusUpdateService.CalculateEventStatus(YD_Event.Core.Entities.EventInfo,System.DateTime)">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user