Commit 90b1cef8 by lcx

二次绩效列表返回isshowmanagebutton字段

parent 4b8c9a31
...@@ -21,5 +21,10 @@ public class SecondListResponse : ag_secondallot ...@@ -21,5 +21,10 @@ public class SecondListResponse : ag_secondallot
/// 0 不显示 1 显示 /// 0 不显示 1 显示
/// </summary> /// </summary>
public int ShowFormula { get; set; } public int ShowFormula { get; set; }
/// <summary>
/// 行政后勤是否显示管理绩效按钮 1 是 2 否
/// </summary>
public Nullable<int> IsShowManageButton { get; set; }
} }
} }
\ No newline at end of file
...@@ -130,10 +130,10 @@ public List<SecondListResponse> GetSecondList(int userId) ...@@ -130,10 +130,10 @@ public List<SecondListResponse> GetSecondList(int userId)
throw new NotImplementedException("人员ID无效"); throw new NotImplementedException("人员ID无效");
var userrole = userroleRepository.GetEntity(t => t.UserID == userId); var userrole = userroleRepository.GetEntity(t => t.UserID == userId);
var role = roleRepository.GetEntity(t => t.ID == userrole.RoleID); var role = roleRepository.GetEntity(t => t.ID == userrole.RoleID);
var hospital = userhospitalRepository.GetEntity(t => t.UserID == userId); var userhospital = userhospitalRepository.GetEntity(t => t.UserID == userId);
if (hospital == null) if (userhospital == null)
throw new NotImplementedException("人员未选择医院"); throw new NotImplementedException("人员未选择医院");
var allotList = perallotRepository.GetEntities(t => t.HospitalId == hospital.HospitalID && new List<int> { 6, 8, 10 }.Contains(t.States)); var allotList = perallotRepository.GetEntities(t => t.HospitalId == userhospital.HospitalID && new List<int> { 6, 8, 10 }.Contains(t.States));
if (allotList == null || allotList.Count == 0) if (allotList == null || allotList.Count == 0)
return new List<SecondListResponse>(); return new List<SecondListResponse>();
...@@ -150,6 +150,7 @@ public List<SecondListResponse> GetSecondList(int userId) ...@@ -150,6 +150,7 @@ public List<SecondListResponse> GetSecondList(int userId)
var secondList = agsecondallotRepository.GetEntities(exp); var secondList = agsecondallotRepository.GetEntities(exp);
var list = Mapper.Map<List<SecondListResponse>>(secondList); var list = Mapper.Map<List<SecondListResponse>>(secondList);
var hospital = hospitalRepository.GetEntity(t => t.ID == userhospital.HospitalID);
list?.ForEach(t => list?.ForEach(t =>
{ {
var allot = allotList.FirstOrDefault(a => a.ID == t.AllotId); var allot = allotList.FirstOrDefault(a => a.ID == t.AllotId);
...@@ -159,19 +160,20 @@ public List<SecondListResponse> GetSecondList(int userId) ...@@ -159,19 +160,20 @@ public List<SecondListResponse> GetSecondList(int userId)
t.States = allot.States; t.States = allot.States;
t.ShowFormula = allot.ShowFormula; t.ShowFormula = allot.ShowFormula;
} }
t.IsShowManageButton = hospital?.IsShowManageButton ?? (int)States.Disabled;
}); });
if (secondList != null && secondList.Any()) if (secondList != null && secondList.Any())
{ {
// 暂时在加载列表时补充信息 // 暂时在加载列表时补充信息
var worktypes = agworkloadtypeRepository.GetEntities(t => t.HospitalId == hospital.HospitalID && t.Department == secondList.First().Department && t.UnitType == secondList.First().UnitType); var worktypes = agworkloadtypeRepository.GetEntities(t => t.HospitalId == userhospital.HospitalID && t.Department == secondList.First().Department && t.UnitType == secondList.First().UnitType);
if (worktypes != null && worktypes.Any()) if (worktypes != null && worktypes.Any())
{ {
worktypes.ForEach(t => AddWorkTypeDefaultValues(t)); worktypes.ForEach(t => AddWorkTypeDefaultValues(t));
} }
// 补充默认工作量项 // 补充默认工作量项
CheckDefaultWorkload(hospital.HospitalID ?? 0, secondList.First().Department, secondList.First().UnitType); CheckDefaultWorkload(userhospital.HospitalID ?? 0, secondList.First().Department, secondList.First().UnitType);
} }
return list; return list;
......
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