参考人均

parent c67df993
......@@ -38,6 +38,7 @@ public class RedistributionService : IAutoInjection
private readonly PerforAgworkloadRepository _agworkloadRepository;
private readonly PerforAgworkloadsourceRepository _agworkloadsourceRepository;
private readonly PerforAgworkloadtypeRepository _agworkloadtypeRepository;
private readonly PerforImemployeeclinicRepository _imemployeeclinicRepository;
private readonly PerforImemployeelogisticsRepository _imemployeelogisticsRepository;
public RedistributionService(
......@@ -57,6 +58,7 @@ public class RedistributionService : IAutoInjection
PerforAgworkloadRepository agworkloadRepository,
PerforAgworkloadsourceRepository agworkloadsourceRepository,
PerforAgworkloadtypeRepository agworkloadtypeRepository,
PerforImemployeeclinicRepository imemployeeclinicRepository,
PerforImemployeelogisticsRepository imemployeelogisticsRepository)
{
_logger = logger;
......@@ -75,6 +77,7 @@ public class RedistributionService : IAutoInjection
_agworkloadRepository = agworkloadRepository;
_agworkloadsourceRepository = agworkloadsourceRepository;
_agworkloadtypeRepository = agworkloadtypeRepository;
_imemployeeclinicRepository = imemployeeclinicRepository;
_imemployeelogisticsRepository = imemployeelogisticsRepository;
}
#endregion
......@@ -378,7 +381,10 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
var refAvg = 0m;
if (Enum.TryParse(typeof(UnitType), second.UnitType, true, out object unittype))
{
// 优先取 业务中层实际人均绩效 否则 取 科室人均
var empolyee = _imemployeeclinicRepository.GetEntity(w => w.AllotID == allot.ID && w.AccountingUnit == second.Department && w.UnitType == second.UnitType);
var rescompute = _resaccountRepository.GetEntity(w => w.AllotID == allot.ID && w.AccountingUnit == second.Department && w.UnitType == (int)((UnitType)unittype));
var avg = (empolyee != null && empolyee.FitPeopleValue.HasValue) ? empolyee.FitPeopleValue : rescompute?.Avg ?? 0;
refAvg = rescompute?.Avg ?? 0;
}
head.AddOrUpdate("RefAvg", Math.Round(refAvg, 0, MidpointRounding.AwayFromZero));
......
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