Commit 10efa239 by lcx

模板7、8获取数据时过滤工作量得分、考核得分、工作量绩效等动态字段

parent a9313aa8
...@@ -81,7 +81,7 @@ public ApiResponse SaveValue(int secondid, [FromBody] List<ag_fixatitem> request ...@@ -81,7 +81,7 @@ public ApiResponse SaveValue(int secondid, [FromBody] List<ag_fixatitem> request
if (unitTypeCount != 1 || request.Any(t => string.IsNullOrEmpty(t.UnitType))) if (unitTypeCount != 1 || request.Any(t => string.IsNullOrEmpty(t.UnitType)))
throw new PerformanceException("科室类型错误"); throw new PerformanceException("科室类型错误");
var repetition = request.GroupBy(t => new { t.RowNumber, t.ItemName, WorkType = t.WorkType ?? 0 }).Where(t => t.Count() > 1); var repetition = request.GroupBy(t => new { t.RowNumber, t.ItemName /*, WorkType = t.WorkType ?? 0*/ }).Where(t => t.Count() > 1);
if (repetition.Any()) if (repetition.Any())
throw new PerformanceException(string.Join(";", repetition.Select(t => $"行{t.Key.RowNumber}项‘{t.Key.ItemName}’重复录入"))); throw new PerformanceException(string.Join(";", repetition.Select(t => $"行{t.Key.RowNumber}项‘{t.Key.ItemName}’重复录入")));
......
...@@ -135,6 +135,9 @@ public List<HeadItem> GetHeadItems(int hospitalId, int tempId, ag_secondallot se ...@@ -135,6 +135,9 @@ public List<HeadItem> GetHeadItems(int hospitalId, int tempId, ag_secondallot se
// 用户自定义的工作量、单项奖励 // 用户自定义的工作量、单项奖励
var configHeaders = agworkloadRepository.GetEntities(w => w.HospitalId == hospitalId && w.Department == secondAllot.Department && w.UnitType == secondAllot.UnitType); var configHeaders = agworkloadRepository.GetEntities(w => w.HospitalId == hospitalId && w.Department == secondAllot.Department && w.UnitType == secondAllot.UnitType);
if (SecondAllotService.defaultValues != null && SecondAllotService.defaultValues.Any())
configHeaders = configHeaders.Where(w => !SecondAllotService.defaultValues.Select(t => t.Item1).Contains(w.ItemName)).ToList();
// 初始化固定列 // 初始化固定列
var headItems = Mapper.Map<List<HeadItem>>(fixedHeaders) ?? new List<HeadItem>(); var headItems = Mapper.Map<List<HeadItem>>(fixedHeaders) ?? new List<HeadItem>();
......
...@@ -1284,7 +1284,7 @@ private void CheckDefaultWorkload(int hospitalId, string department, string unit ...@@ -1284,7 +1284,7 @@ private void CheckDefaultWorkload(int hospitalId, string department, string unit
agworkloadRepository.AddRange(insertData.ToArray()); agworkloadRepository.AddRange(insertData.ToArray());
} }
private readonly List<(string, string, int)> defaultValues = new List<(string, string, int)> internal static List<(string, string, int)> defaultValues = new List<(string, string, int)>
{ {
( "工作量得分", "WorkloadScore" , 1 ), ( "工作量得分", "WorkloadScore" , 1 ),
( "考核得分", "AssessmentScore", 2 ), ( "考核得分", "AssessmentScore", 2 ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment