修正时必须回填原评分单的手工录入值。
This commit is contained in:
parent
1669913e1a
commit
a3b4b75eb8
@ -364,7 +364,7 @@ public class JudgeScoringController : IDynamicApiController
|
|||||||
var source = draft ?? submitted;
|
var source = draft ?? submitted;
|
||||||
var details = source == null
|
var details = source == null
|
||||||
? new List<EventJudgeScoreDetail>()
|
? new List<EventJudgeScoreDetail>()
|
||||||
: await _detailRepository.GetListAsync(x => x.ScoreSheetId == source.Id);
|
: await _detailRepository.GetListAsync(x => x.ScoreSheetId == source.Id && !x.DeleteMark);
|
||||||
var legacyInteraction = roleType == "T"
|
var legacyInteraction = roleType == "T"
|
||||||
&& (ctx.Config.RuleType.ToUpperInvariant() is "FREESTYLE_DOUBLE_SYNC" or "FREESTYLE_QUAD_SYNC")
|
&& (ctx.Config.RuleType.ToUpperInvariant() is "FREESTYLE_DOUBLE_SYNC" or "FREESTYLE_QUAD_SYNC")
|
||||||
? details.FirstOrDefault(x => x.ItemCode == "REQ_INTERACTION") : null;
|
? details.FirstOrDefault(x => x.ItemCode == "REQ_INTERACTION") : null;
|
||||||
@ -434,6 +434,9 @@ public class JudgeScoringController : IDynamicApiController
|
|||||||
Items = definitions.Select(definition =>
|
Items = definitions.Select(definition =>
|
||||||
{
|
{
|
||||||
var line = preview.Lines.FirstOrDefault(x => string.Equals(x.ItemCode, definition.ItemCode, StringComparison.OrdinalIgnoreCase));
|
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
|
return new JudgeScoreItemDto
|
||||||
{
|
{
|
||||||
ScoreRuleItemId = definition.Item.Id,
|
ScoreRuleItemId = definition.Item.Id,
|
||||||
@ -463,8 +466,8 @@ public class JudgeScoringController : IDynamicApiController
|
|||||||
RequiredTarget = definition.RequiredTarget,
|
RequiredTarget = definition.RequiredTarget,
|
||||||
RequiredAsCategory = definition.RequiredAsCategory,
|
RequiredAsCategory = definition.RequiredAsCategory,
|
||||||
Sort = definition.Item.Sort,
|
Sort = definition.Item.Sort,
|
||||||
InputValue = line?.InputValue,
|
InputValue = savedInput?.InputValue ?? line?.InputValue,
|
||||||
CountValue = line?.CountValue,
|
CountValue = savedInput?.CountValue ?? line?.CountValue,
|
||||||
Subtotal = line?.Subtotal ?? 0m
|
Subtotal = line?.Subtotal ?? 0m
|
||||||
};
|
};
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user