diff --git a/YD_Event.Application/Event/UnifiedRegistrationService.cs b/YD_Event.Application/Event/UnifiedRegistrationService.cs index 2460e4e..52455a3 100644 --- a/YD_Event.Application/Event/UnifiedRegistrationService.cs +++ b/YD_Event.Application/Event/UnifiedRegistrationService.cs @@ -3141,23 +3141,9 @@ public class UnifiedRegistrationService : ITransient } else { - // 定价赛事模式:需要检查是否所有人都取消了 - var allPersonsCanceled = true; - var remainingPersons = persons.Where(p => !p.DeleteMark).ToList(); - if (remainingPersons.Count > 0) - { - // 如果还有未删除的人,说明不是全部取消 - allPersonsCanceled = false; - } - - if (!allPersonsCanceled) - { - // 没有取消所有队员,个人取消不退款 - _logger.LogInformation("定价赛事部分取消(未取消所有人员),个人取消不退款"); - return 0; - } - - // 定价赛事模式:使用剩余的原始金额 + // 定价赛事模式:全部取消,直接使用剩余原始金额 + // 注意:这里不需要检查是否所有人取消,因为CancelType=0本身就表示全部取消 + _logger.LogInformation("定价赛事全部取消,使用剩余原始金额计算退款"); remainingOriginalTotal = remainingOriginalAmount; } @@ -3197,10 +3183,13 @@ public class UnifiedRegistrationService : ITransient _logger.LogInformation("定价(赛事)退款:开始计算"); - // 检查是否取消了所有队员(所有项目取消) - var allPersonsCanceled = allCancelIds.Count == persons.Count; + // 获取当前未被软删除的所有人员(仅考虑有效报名的人员) + var activePersons = persons.Where(p => !p.DeleteMark).ToList(); - if (!allPersonsCanceled) + // 检查是否取消了所有有效队员 + var allActivePersonsCanceled = allCancelIds.Count == activePersons.Count; + + if (!allActivePersonsCanceled) { // 没有取消所有队员,个人取消不退款 _logger.LogInformation("定价赛事部分取消(未取消所有人员),个人取消不退款");