Commit 06455d09 by lcx

二次绩效重新载入规则修改

parent 3c20253c
...@@ -95,9 +95,6 @@ public SecondResponse GetSecondDetails(int userId, int secondId, int hospitalId, ...@@ -95,9 +95,6 @@ public SecondResponse GetSecondDetails(int userId, int secondId, int hospitalId,
if (tempId == (int)Temp.other) return new SecondResponse(); if (tempId == (int)Temp.other) return new SecondResponse();
if (isArchive == 1 || new List<int> { (int)SecondAllotStatus.WaitReview, (int)SecondAllotStatus.PassAudit }.Contains(secondAllot.Status ?? (int)SecondAllotStatus.Uncommitted))
employeeSource = (int)EmployeeSource.Initial;
// 历史保存过的数据,groupby取最后的一条记录,避免重复数据,在同一rownumber中itemname重复会导致数据丢失 // 历史保存过的数据,groupby取最后的一条记录,避免重复数据,在同一rownumber中itemname重复会导致数据丢失
var savedDataList = agfixatitemRepository.GetEntities(w => w.SecondId == secondAllot.Id); var savedDataList = agfixatitemRepository.GetEntities(w => w.SecondId == secondAllot.Id);
if (savedDataList != null && savedDataList.Any()) if (savedDataList != null && savedDataList.Any())
...@@ -108,7 +105,7 @@ public SecondResponse GetSecondDetails(int userId, int secondId, int hospitalId, ...@@ -108,7 +105,7 @@ public SecondResponse GetSecondDetails(int userId, int secondId, int hospitalId,
var header = GetHeadItems(hospitalId, tempId, secondAllot); var header = GetHeadItems(hospitalId, tempId, secondAllot);
var body = GetBodyItems(userId, employeeSource, secondAllot, prevSecondAllot, header, savedDataList); var body = GetBodyItems(userId, employeeSource, secondAllot, prevSecondAllot, header, savedDataList, isArchive);
var result = new SecondResponse { HeadItems = header, BodyItems = body }; var result = new SecondResponse { HeadItems = header, BodyItems = body };
...@@ -171,7 +168,7 @@ public List<HeadItem> GetHeadItems(int hospitalId, int tempId, ag_secondallot se ...@@ -171,7 +168,7 @@ public List<HeadItem> GetHeadItems(int hospitalId, int tempId, ag_secondallot se
/// <param name="prevSecondAllot"></param> /// <param name="prevSecondAllot"></param>
/// <param name="headItems"></param> /// <param name="headItems"></param>
/// <returns></returns> /// <returns></returns>
public List<BodyItem> GetBodyItems(int userId, int employeeSource, ag_secondallot secondAllot, ag_secondallot prevSecondAllot, List<HeadItem> headItems, List<ag_fixatitem> savedDataList) public List<BodyItem> GetBodyItems(int userId, int employeeSource, ag_secondallot secondAllot, ag_secondallot prevSecondAllot, List<HeadItem> headItems, List<ag_fixatitem> savedDataList, int isArchive)
{ {
var bodyItems = new List<BodyItem>(); var bodyItems = new List<BodyItem>();
...@@ -188,6 +185,9 @@ public List<BodyItem> GetBodyItems(int userId, int employeeSource, ag_secondallo ...@@ -188,6 +185,9 @@ public List<BodyItem> GetBodyItems(int userId, int employeeSource, ag_secondallo
} }
} }
if (isArchive == 1 || new List<int> { (int)SecondAllotStatus.WaitReview, (int)SecondAllotStatus.PassAudit }.Contains(secondAllot.Status ?? (int)SecondAllotStatus.Uncommitted))
employeeSource = (int)EmployeeSource.Initial;
var topFixedColumns = headItems.Where(w => w.Type == (int)TempColumnType.TopFixedColumns)?.ToList(); var topFixedColumns = headItems.Where(w => w.Type == (int)TempColumnType.TopFixedColumns)?.ToList();
if (topFixedColumns != null) if (topFixedColumns != null)
{ {
......
...@@ -64,15 +64,16 @@ public SecondAllotResponse GetSecondSavedData(int userId, int secondId, int empl ...@@ -64,15 +64,16 @@ public SecondAllotResponse GetSecondSavedData(int userId, int secondId, int empl
} }
result.Head = jObject; result.Head = jObject;
if (detail.IsArchive == 1 || new List<int> { (int)SecondAllotStatus.WaitReview, (int)SecondAllotStatus.PassAudit }.Contains(second.Status ?? (int)SecondAllotStatus.Uncommitted))
employeeSource = (int)EmployeeSource.Initial;
var prevSecond = GetPreviousSecondAllot(allot.HospitalId, second); var prevSecond = GetPreviousSecondAllot(allot.HospitalId, second);
// 保存过数据,从保存的数据中心带出信息 // 保存过数据,从保存的数据中心带出信息
// 未保存过数据,带入初始数据(首次填写二次绩效,人员信息来自人员字典,有历史二次绩效记录时,人员信息来自上次二次绩效填写记录) // 未保存过数据,带入初始数据(首次填写二次绩效,人员信息来自人员字典,有历史二次绩效记录时,人员信息来自上次二次绩效填写记录)
if (head.Id == 0) if (head.Id == 0 && employeeSource == (int)EmployeeSource.Initial)
employeeSource = prevSecond == null ? (int)EmployeeSource.EmployeeDict : (int)EmployeeSource.PrevSecondAllot; employeeSource = prevSecond == null ? (int)EmployeeSource.EmployeeDict : (int)EmployeeSource.PrevSecondAllot;
if (detail.IsArchive == 1 || new List<int> { (int)SecondAllotStatus.WaitReview, (int)SecondAllotStatus.PassAudit }.Contains(second.Status ?? (int)SecondAllotStatus.Uncommitted))
employeeSource = (int)EmployeeSource.Initial;
result.Body = GetBodyItemsByEmployeeSource(userId, employeeSource, second, prevSecond, allot); result.Body = GetBodyItemsByEmployeeSource(userId, employeeSource, second, prevSecond, allot);
return result; return result;
...@@ -146,7 +147,6 @@ public List<ag_bodysource> GetEmployeeFromEmployeeDict(List<per_employee> employ ...@@ -146,7 +147,6 @@ public List<ag_bodysource> GetEmployeeFromEmployeeDict(List<per_employee> employ
} }
return bodysources; return bodysources;
} }
/// <summary> /// <summary>
/// 从上一次的保存信息中获取人员信息 /// 从上一次的保存信息中获取人员信息
/// </summary> /// </summary>
......
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