二次分配填报模板带出问题

parent b5ed0ee5
......@@ -295,8 +295,8 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
}
else
{
var workloadTypes = _agworkloadtypeRepository
.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department && t.UnitType == second.UnitType) ?? new List<ag_workload_type>();
var allWorkloadTypes = _agworkloadtypeRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department) ?? new List<ag_workload_type>();
var workloadTypes = allWorkloadTypes.Where(t => UnitTypeUtil.Is(t.UnitType, second.UnitType)) ?? new List<ag_workload_type>();
foreach (var item in workloadTypes.OrderBy(t => t.Id))
{
maps.Add(new SecondColumnDictionary($"{item.TypeName}占比", $"Workload_Ratio_{item.Id}", true, 1, "Top", isNumber: true));
......@@ -384,7 +384,8 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
else
{
var bodyDynamic = _agworkloadsourceRepository.GetEntities(t => loadEmployees.Select(w => w.Id).Contains(t.BodyId));
var workloads = _agworkloadRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department && t.UnitType == second.UnitType);
var allworkload = _agworkloadRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department) ?? new List<ag_workload>();
var workloads = allworkload.Where(w => UnitTypeUtil.Is(w.UnitType, second.UnitType)) ?? new List<ag_workload>();
if (workloads != null && workloads.Any())
{
......@@ -455,7 +456,8 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
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 tempEmpolyee = _imemployeeclinicRepository.GetEntities(w => w.AllotID == allot.ID && w.AccountingUnit == second.Department);
var empolyee = tempEmpolyee.FirstOrDefault(w => UnitTypeUtil.Is(w.UnitType, second.UnitType));
var rescompute = _resaccountRepository.GetEntity(w => w.AllotID == allot.ID && w.AccountingUnit == second.Department && w.UnitType == (int)unittype);
var avg = (empolyee != null && empolyee.FitPeopleValue.HasValue) ? empolyee.FitPeopleValue : rescompute?.Avg ?? 0;
refAvg = avg ?? 0;
......@@ -495,8 +497,9 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
else
{
List<decimal> ratios = new List<decimal>();
var workloadTypes = _agworkloadtypeRepository
.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department && t.UnitType == second.UnitType) ?? new List<ag_workload_type>();
var tempWorkloadTypes = _agworkloadtypeRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department) ?? new List<ag_workload_type>();
var workloadTypes = tempWorkloadTypes.Where(t => UnitTypeUtil.Is(t.UnitType, second.UnitType));
foreach (var workitem in workloadTypes)
{
var name = $"Workload_Ratio_{workitem.Id}";
......@@ -694,7 +697,7 @@ private List<ag_bodysource> LoadEmployees_PrevSecondAllot(per_allot allot, ag_se
private List<string> LoadEmployees_EmployeeDict(ag_secondallot second, List<per_employee> dicEmployees)
{
var employees = dicEmployees
?.Where(w => w.UnitType == second.UnitType && w.AccountingUnit == second.Department)
?.Where(w => UnitTypeUtil.Is(w.UnitType, second.UnitType) && w.AccountingUnit == second.Department)
.Select(emp => emp.PersonnelNumber?.Trim())
.Distinct().ToList() ?? new List<string>();
return employees;
......@@ -785,7 +788,8 @@ private List<string> LoadEmployees_OfficeExcel(ag_secondallot second)
}
else
{
var workloads = _agworkloadRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department && t.UnitType == second.UnitType) ?? new List<ag_workload>();
var tempWorkloads = _agworkloadRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department) ?? new List<ag_workload>();
var workloads = tempWorkloads.Where(t => UnitTypeUtil.Is(t.UnitType, second.UnitType)) ?? new List<ag_workload>();
var loads = workloads
.OrderBy(t => t.WorkTypeId).ThenBy(t => t.Sort)
.Select(t => new TitleValue<string, decimal?> { Title = t.ItemId, Value = t.ItemName, State = t.FactorValue })
......@@ -952,7 +956,7 @@ public void SupplementOtherPerfor(ag_secondallot second, List<Dictionary<string,
// 补充字典中该科室不存在,但有其它绩效的人员信息
var groupDatas = perapramounts
.Where(t => t.UnitType == second.UnitType && t.AccountingUnit == second.Department)
.Where(t => UnitTypeUtil.Is(t.UnitType, second.UnitType) && t.AccountingUnit == second.Department)
.GroupBy(w => new { PersonnelNumber = w.PersonnelNumber, DoctorName = w.DoctorName, AccountingUnit = w.AccountingUnit, UnitType = w.UnitType, });
foreach (var item in groupDatas)
{
......
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