diff --git a/YD_Event.Application/Judge/JudgeScoringController.cs b/YD_Event.Application/Judge/JudgeScoringController.cs index 251d6f0..dc93f53 100644 --- a/YD_Event.Application/Judge/JudgeScoringController.cs +++ b/YD_Event.Application/Judge/JudgeScoringController.cs @@ -364,7 +364,7 @@ public class JudgeScoringController : IDynamicApiController var source = draft ?? submitted; var details = source == null ? new List() - : await _detailRepository.GetListAsync(x => x.ScoreSheetId == source.Id); + : await _detailRepository.GetListAsync(x => x.ScoreSheetId == source.Id && !x.DeleteMark); var legacyInteraction = roleType == "T" && (ctx.Config.RuleType.ToUpperInvariant() is "FREESTYLE_DOUBLE_SYNC" or "FREESTYLE_QUAD_SYNC") ? details.FirstOrDefault(x => x.ItemCode == "REQ_INTERACTION") : null; @@ -434,6 +434,9 @@ public class JudgeScoringController : IDynamicApiController Items = definitions.Select(definition => { var line = preview.Lines.FirstOrDefault(x => string.Equals(x.ItemCode, definition.ItemCode, StringComparison.OrdinalIgnoreCase)); + // 修正时必须回填原评分单的手工录入值。预览用于重算自动项,不能作为历史录入的唯一来源。 + var savedInput = definition.IsAuto ? null : details.FirstOrDefault(x => + !x.IsAutoGenerated && string.Equals(x.ItemCode, definition.ItemCode, StringComparison.OrdinalIgnoreCase)); return new JudgeScoreItemDto { ScoreRuleItemId = definition.Item.Id, @@ -463,8 +466,8 @@ public class JudgeScoringController : IDynamicApiController RequiredTarget = definition.RequiredTarget, RequiredAsCategory = definition.RequiredAsCategory, Sort = definition.Item.Sort, - InputValue = line?.InputValue, - CountValue = line?.CountValue, + InputValue = savedInput?.InputValue ?? line?.InputValue, + CountValue = savedInput?.CountValue ?? line?.CountValue, Subtotal = line?.Subtotal ?? 0m }; }).ToList(),