From 3bee51671ad3beee606bbe7e9ed695dbfe3175da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A2=93=E5=BD=AD?= Date: Mon, 11 May 2026 15:52:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=BB=B7=EF=BC=88=E8=B5=9B=E4=BA=8B?= =?UTF-8?q?=EF=BC=89=E5=85=A8=E9=83=A8=E5=8F=96=E6=B6=88=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Event/UnifiedRegistrationService.cs | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) 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("定价赛事部分取消(未取消所有人员),个人取消不退款");