发放表其他绩效合并

parent 50c9fd62
...@@ -32,9 +32,11 @@ public class ComputeService : IAutoInjection ...@@ -32,9 +32,11 @@ public class ComputeService : IAutoInjection
private readonly PerforHospitalRepository hospitalRepository; private readonly PerforHospitalRepository hospitalRepository;
private readonly PerforPerapramountRepository perapramountRepository; private readonly PerforPerapramountRepository perapramountRepository;
private readonly PerforPeremployeeRepository perforPeremployeeRepository; private readonly PerforPeremployeeRepository perforPeremployeeRepository;
private readonly PerforPerapramounthideRepository _hideRepository;
private readonly PerforCofworkitemRepository cofworkitemRepository; private readonly PerforCofworkitemRepository cofworkitemRepository;
public ComputeService(PerforResaccountRepository perforResaccountRepository, public ComputeService(
PerforResaccountRepository perforResaccountRepository,
PerforPersheetRepository perforPerSheetRepository, PerforPersheetRepository perforPerSheetRepository,
PerforImdataRepository perforImDataRepository, PerforImdataRepository perforImDataRepository,
PerforImheaderRepository perforImheaderRepository, PerforImheaderRepository perforImheaderRepository,
...@@ -49,6 +51,7 @@ public class ComputeService : IAutoInjection ...@@ -49,6 +51,7 @@ public class ComputeService : IAutoInjection
PerforHospitalRepository hospitalRepository, PerforHospitalRepository hospitalRepository,
PerforPerapramountRepository perapramountRepository, PerforPerapramountRepository perapramountRepository,
PerforPeremployeeRepository perforPeremployeeRepository, PerforPeremployeeRepository perforPeremployeeRepository,
PerforPerapramounthideRepository hideRepository,
PerforCofworkitemRepository cofworkitemRepository) PerforCofworkitemRepository cofworkitemRepository)
{ {
this.perforResaccountRepository = perforResaccountRepository; this.perforResaccountRepository = perforResaccountRepository;
...@@ -66,6 +69,7 @@ public class ComputeService : IAutoInjection ...@@ -66,6 +69,7 @@ public class ComputeService : IAutoInjection
this.hospitalRepository = hospitalRepository; this.hospitalRepository = hospitalRepository;
this.perapramountRepository = perapramountRepository; this.perapramountRepository = perapramountRepository;
this.perforPeremployeeRepository = perforPeremployeeRepository; this.perforPeremployeeRepository = perforPeremployeeRepository;
_hideRepository = hideRepository;
this.cofworkitemRepository = cofworkitemRepository; this.cofworkitemRepository = cofworkitemRepository;
} }
...@@ -589,8 +593,8 @@ public List<DeptResponse> GetAdminPerformance(int allotId) ...@@ -589,8 +593,8 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
result.AddRange(officeResult); result.AddRange(officeResult);
// 获取各科室 医院其他绩效 // 获取各科室 医院其他绩效
var amounts = perapramountRepository.GetFullAmount(t => t.AllotId == allotId && t.Status == 3); var fullAmounts = GetTotalAmount(allotId); ;
var otherPerformances = amounts var otherPerformances = fullAmounts
?.GroupBy(t => new { t.AccountingUnit, t.UnitType }) ?.GroupBy(t => new { t.AccountingUnit, t.UnitType })
.Select(t => new view_per_total_amount .Select(t => new view_per_total_amount
{ {
...@@ -748,7 +752,7 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM ...@@ -748,7 +752,7 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
// 人员字典 // 人员字典
var employees = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId); var employees = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId);
// 获取医院其他绩效汇总结果 // 获取医院其他绩效汇总结果
var totalAmounts = GetTotalAmount(allotId); var fullAmounts = GetTotalAmount(allotId);
// 获取一次绩效结果 // 获取一次绩效结果
var one = GetAllotPerformance(allotId, hospitalId, isShowManage); var one = GetAllotPerformance(allotId, hospitalId, isShowManage);
// 获取二次绩效结果 // 获取二次绩效结果
...@@ -760,6 +764,18 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM ...@@ -760,6 +764,18 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
if (two != null) if (two != null)
response.AddRange(two); response.AddRange(two);
// 其他绩效汇总
var totalAmounts = fullAmounts
?.GroupBy(w => new { w.AccountingUnit, w.UnitType, w.PersonnelNumber })
.Select(w => new view_per_total_amount
{
AccountingUnit = w.Key.AccountingUnit,
UnitType = w.Key.UnitType,
PersonnelNumber = w.Key.PersonnelNumber,
Amount = w.Sum(t => t.Amount) ?? 0,
Use = false,
})?.ToList();
// 补充医院其他绩效 // 补充医院其他绩效
AddAprAmount(response, totalAmounts); AddAprAmount(response, totalAmounts);
...@@ -824,26 +840,24 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM ...@@ -824,26 +840,24 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
} }
/// <summary> /// <summary>
/// 获取医院其他绩效汇总结果 /// 合并医院其他绩效、不公示其他绩效
/// </summary> /// </summary>
/// <param name="allotId"></param> /// <param name="allotId"></param>
/// <returns></returns> /// <returns></returns>
private List<view_per_total_amount> GetTotalAmount(int allotId) private List<view_per_apr_amount> GetTotalAmount(int allotId)
{ {
var fullAmounts = perapramountRepository.GetFullAmount(t => t.AllotId == allotId && t.Status == 3); var fullAmounts1 = perapramountRepository.GetFullAmount(t => t.AllotId == allotId && t.Status == 3) ?? new List<view_per_apr_amount>();
var totalAmounts = fullAmounts var fullAmounts2 = _hideRepository.GetFullAmount(t => t.AllotId == allotId && t.Status == 3) ?? new List<view_per_apr_amount>();
?.GroupBy(w => new { w.AccountingUnit, w.UnitType, w.PersonnelNumber })
.Select(w => new view_per_total_amount var fullAmounts = new List<view_per_apr_amount>();
{
AccountingUnit = w.Key.AccountingUnit, if (fullAmounts1 != null && fullAmounts1.Any())
UnitType = w.Key.UnitType, fullAmounts.AddRange(fullAmounts1);
PersonnelNumber = w.Key.PersonnelNumber, if (fullAmounts2 != null && fullAmounts2.Any())
Amount = w.Sum(t => t.Amount) ?? 0, fullAmounts.AddRange(fullAmounts2);
Use = false,
});
return totalAmounts?.ToList() ?? new List<view_per_total_amount>(); return fullAmounts;
} }
/// <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