From 0316d317bfe6b6c119cdd6f94e1c7bc4febfd843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A2=93=E5=BD=AD?= Date: Fri, 9 Oct 2026 09:15:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BD=AE=E8=B7=B3=E8=8A=B1=E6=A0=B7?= =?UTF-8?q?=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scoring/ScoreSheetCalculationService.cs | 19 +++++++++++++++++++ .../Workbench/Dtos/WorkbenchDtos.cs | 10 ++++++++++ .../Workbench/WorkbenchController.cs | 4 ++++ 3 files changed, 33 insertions(+) diff --git a/YD_Event.Application/Scoring/ScoreSheetCalculationService.cs b/YD_Event.Application/Scoring/ScoreSheetCalculationService.cs index 0a3cb5b..bf18017 100644 --- a/YD_Event.Application/Scoring/ScoreSheetCalculationService.cs +++ b/YD_Event.Application/Scoring/ScoreSheetCalculationService.cs @@ -353,6 +353,25 @@ public static class ScoreSheetCalculationService : Math.Clamp(Math.Round(raw, 0, MidpointRounding.AwayFromZero), dimension.MinValue, dimension.MaxValue); weighted += value * dimension.DimensionWeight!.Value; + if (performanceFailureCount > 0m) + { + result.Lines.Add(new ScoreSheetLine + { + ScoreRuleItemId = dimension.Item.Id, + ItemCode = $"{dimension.DimensionCode}_FAILURE_MINUS", + ItemName = $"{dimension.Item.ItemName}(失误联动减数量)", + ItemType = dimension.Item.ItemType, + ScoreDimension = dimension.Item.ScoreDimension, + CountValue = performanceFailureCount, + UnitValue = dimension.Item.UnitValue ?? 1m, + Subtotal = -performanceFailureCount * (dimension.Item.UnitValue ?? 1m), + Sort = dimension.Item.Sort, + IsAutoGenerated = true, + ParentItemCode = failure?.ItemCode, + SubjectCode = dimension.SubjectCode + }); + } + result.Lines.Add(new ScoreSheetLine { ScoreRuleItemId = dimension.Item.Id, ItemCode = dimension.ItemCode, ItemName = dimension.Item.ItemName, diff --git a/YD_Event.Application/Workbench/Dtos/WorkbenchDtos.cs b/YD_Event.Application/Workbench/Dtos/WorkbenchDtos.cs index 0918c73..9669812 100644 --- a/YD_Event.Application/Workbench/Dtos/WorkbenchDtos.cs +++ b/YD_Event.Application/Workbench/Dtos/WorkbenchDtos.cs @@ -611,6 +611,16 @@ public class WorkbenchScoreItemDto /// public decimal Subtotal { get; set; } + /// + /// 是否由服务端联动生成 + /// + public bool IsAutoGenerated { get; set; } + + /// + /// 联动来源评分项编码 + /// + public string? ParentItemCode { get; set; } + /// /// 排序号 /// diff --git a/YD_Event.Application/Workbench/WorkbenchController.cs b/YD_Event.Application/Workbench/WorkbenchController.cs index f1af823..54e42e2 100644 --- a/YD_Event.Application/Workbench/WorkbenchController.cs +++ b/YD_Event.Application/Workbench/WorkbenchController.cs @@ -395,6 +395,8 @@ public class WorkbenchController : IDynamicApiController d.CountValue, d.InputValue, d.Subtotal, + d.IsAutoGenerated, + d.ParentItemCode, d.Sort }).ToListAsync(); @@ -445,6 +447,8 @@ public class WorkbenchController : IDynamicApiController CountValue = d.CountValue, InputValue = d.InputValue, Subtotal = d.Subtotal, + IsAutoGenerated = d.IsAutoGenerated, + ParentItemCode = d.ParentItemCode, Sort = d.Sort }).ToList() };