Commit dec2eeff by lcx

二次绩效获取人员时,根据核算类型去除不符合人员

parent 927fbec9
...@@ -298,7 +298,7 @@ public List<BodyItem> AutoComplete(SecondEmpRequest request, int userId) ...@@ -298,7 +298,7 @@ public List<BodyItem> AutoComplete(SecondEmpRequest request, int userId)
if (second == null) if (second == null)
throw new PerformanceException("当前科室二次分配绩效信息无效"); throw new PerformanceException("当前科室二次分配绩效信息无效");
var bodyItems = GetEmployees(second.AllotId.Value, userId, headItems, request.EmployeeName, request.JobNumber); var bodyItems = GetEmployees(second.AllotId.Value, userId, headItems, second.UnitType, request.EmployeeName, request.JobNumber);
return bodyItems; return bodyItems;
} }
...@@ -351,14 +351,14 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId) ...@@ -351,14 +351,14 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId)
if (fixatList.Where(t => t.RowNumber != -1) == null || !fixatList.Where(t => t.RowNumber != -1).Any()) if (fixatList.Where(t => t.RowNumber != -1) == null || !fixatList.Where(t => t.RowNumber != -1).Any())
{ {
//更换模板时,会自动保存顶部数据 //更换模板时,会自动保存顶部数据
result.BodyItems.AddRange(GetEmployees(second.AllotId.Value, userId, headItems)); result.BodyItems.AddRange(GetEmployees(second.AllotId.Value, userId, headItems, second.UnitType));
} }
} }
else else
{ {
//无数据 根据IsBring带出历史二次绩效中需要带出的数据 //无数据 根据IsBring带出历史二次绩效中需要带出的数据
//result.BodyItems = GetBringItems(request, headItems); //result.BodyItems = GetBringItems(request, headItems);
result.BodyItems = GetEmployees(second.AllotId.Value, userId, headItems); result.BodyItems = GetEmployees(second.AllotId.Value, userId, headItems, second.UnitType);
var bodys = Mapper.Map<List<BodyItem>>(headItems.Where(t => t.Type == 1)); var bodys = Mapper.Map<List<BodyItem>>(headItems.Where(t => t.Type == 1));
if (bodys != null && bodys.Any()) if (bodys != null && bodys.Any())
...@@ -404,12 +404,14 @@ private void SupplementOtherPerfor(SecondResponse result, int allotId) ...@@ -404,12 +404,14 @@ private void SupplementOtherPerfor(SecondResponse result, int allotId)
} }
} }
private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> heads, string empName = "", string jobNumber = "") private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> heads, string unittype, string empName = "", string jobNumber = "")
{ {
var list = new List<BodyItem>(); var list = new List<BodyItem>();
var employees = personService.GetPersons(allotId, userId); var employees = personService.GetPersons(allotId, userId);
if (employees == null || !employees.Any()) return list; if (employees == null || !employees.Any(t => t.UnitType == unittype)) return list;
employees = employees.Where(t => t.UnitType == unittype).ToList();
if (!string.IsNullOrEmpty(empName)) if (!string.IsNullOrEmpty(empName))
employees = employees?.Where(w => w.DoctorName?.Trim() == empName?.Trim()).ToList(); employees = employees?.Where(w => w.DoctorName?.Trim() == empName?.Trim()).ToList();
...@@ -1410,7 +1412,8 @@ public List<ag_othersource> OtherList(int secondId, int userId) ...@@ -1410,7 +1412,8 @@ public List<ag_othersource> OtherList(int secondId, int userId)
if (second == null) throw new PerformanceException("二次绩效信息无效!"); if (second == null) throw new PerformanceException("二次绩效信息无效!");
var employees = personService.GetPersons(second.AllotId.Value, userId); var employees = personService.GetPersons(second.AllotId.Value, userId);
if (employees == null || !employees.Any()) return new List<ag_othersource>(); if (employees == null || !employees.Any(t => t.UnitType == second.UnitType)) return new List<ag_othersource>();
employees = employees.Where(t => t.UnitType == second.UnitType).ToList();
List<ag_othersource> result = null; List<ag_othersource> result = null;
var otherSecondList = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondId); var otherSecondList = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondId);
......
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