赛事记录更换队员筛选
This commit is contained in:
parent
ef8f268179
commit
f285c439a8
@ -1137,6 +1137,11 @@ public class RegistrationLimitCheckInput
|
||||
/// 组别ID列表 (旧结构,向后兼容)
|
||||
/// </summary>
|
||||
public List<long> GroupIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 要排除的报名ID(更换队员时使用,排除当前正在更新的报名记录)
|
||||
/// </summary>
|
||||
public long? ExcludeRegistrationId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -1125,7 +1125,7 @@ public class UnifiedRegistrationService : ITransient
|
||||
/// <summary>
|
||||
/// 检查报名限制
|
||||
/// </summary>
|
||||
public async Task<RegistrationLimitCheckOutput> CheckRegistrationLimitAsync(UnifiedRegistrationInput input)
|
||||
public async Task<RegistrationLimitCheckOutput> CheckRegistrationLimitAsync(UnifiedRegistrationInput input, long? excludeRegistrationId = null)
|
||||
{
|
||||
var result = new RegistrationLimitCheckOutput
|
||||
{
|
||||
@ -1144,13 +1144,21 @@ public class UnifiedRegistrationService : ITransient
|
||||
// 先获取所有报名信息,供后续检查使用
|
||||
// 线上支付类型的报名记录,仅统计PaymentStatus == 1(已支付)的记录
|
||||
// 线下支付类型的报名记录,同时统计PaymentStatus == 1(已支付)和PaymentStatus == 0(未支付)的记录
|
||||
var eventRegistrations = await _registrationRepository.GetListAsync(x =>
|
||||
var eventRegistrationsQuery = _registrationRepository.AsQueryable().Where(x =>
|
||||
x.EventId == input.EventId && !x.DeleteMark &&
|
||||
(
|
||||
(x.PaymentMethod == 2 && x.PaymentStatus == 1) ||
|
||||
(x.PaymentMethod == 1 && x.PaymentStatus == 1) ||
|
||||
(x.PaymentMethod == 1 && x.PaymentStatus == 0)
|
||||
));
|
||||
|
||||
// 如果指定了要排除的报名ID,则排除该记录
|
||||
if (excludeRegistrationId.HasValue)
|
||||
{
|
||||
eventRegistrationsQuery = eventRegistrationsQuery.Where(x => x.Id != excludeRegistrationId.Value);
|
||||
}
|
||||
|
||||
var eventRegistrations = await eventRegistrationsQuery.ToListAsync();
|
||||
var eventRegistrationIds = eventRegistrations.Select(r => r.Id).ToList();
|
||||
var registrationPersons = await _registrationPersonRepository.GetListAsync(x =>
|
||||
eventRegistrationIds.Contains(x.RegistrationId) && !x.DeleteMark);
|
||||
|
||||
@ -907,6 +907,6 @@ public class UserEventRecordService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
// 调用统一的限制检查方法
|
||||
return await _unifiedRegistrationService.CheckRegistrationLimitAsync(unifiedInput);
|
||||
return await _unifiedRegistrationService.CheckRegistrationLimitAsync(unifiedInput, input.ExcludeRegistrationId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7491,6 +7491,11 @@
|
||||
组别ID列表 (旧结构,向后兼容)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Event.Dtos.RegistrationLimitCheckInput.ExcludeRegistrationId">
|
||||
<summary>
|
||||
要排除的报名ID(更换队员时使用,排除当前正在更新的报名记录)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Event.Dtos.RegistrationLimitDetail">
|
||||
<summary>
|
||||
报名限制详情
|
||||
@ -8208,7 +8213,7 @@
|
||||
处理线下支付
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:YD_Event.Application.Event.UnifiedRegistrationService.CheckRegistrationLimitAsync(YD_Event.Application.Event.Dtos.UnifiedRegistrationInput)">
|
||||
<member name="M:YD_Event.Application.Event.UnifiedRegistrationService.CheckRegistrationLimitAsync(YD_Event.Application.Event.Dtos.UnifiedRegistrationInput,System.Nullable{System.Int64})">
|
||||
<summary>
|
||||
检查报名限制
|
||||
</summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user