Commit 9f7e193b by lcx

绩效抽取时,没有科室字典也进行数据分组求和

parent f4ed88dc
...@@ -209,14 +209,12 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re ...@@ -209,14 +209,12 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re
var dict = personService.GetDepartments(hospitalId)?.ToList(); var dict = personService.GetDepartments(hospitalId)?.ToList();
if (dict == null || !dict.Any()) if (dict == null || !dict.Any())
return results.Select(t => new ExtractTransDto return results.GroupBy(t => new { t.Department, t.Category, t.Source }).Select(t => new ExtractTransDto
{ {
SheetName = t.Source, SheetName = t.Key.Source,
DoctorName = t.DoctorName, Department = t.Key.Department,
PersonnelNumber = t.PersonnelNumber, Category = t.Key.Category,
Department = t.Department, Value = t.Sum(group => group.Fee) == 0 ? null : t.Sum(group => group.Fee),
Category = t.Category,
Value = t.Fee ?? 0
}).ToList(); }).ToList();
dict.ForEach(t => dict.ForEach(t =>
...@@ -244,7 +242,7 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re ...@@ -244,7 +242,7 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re
InpatTechnicAccounting = t.inner.FirstOrDefault(f => f.Department == dept)?.InpatTechnicAccounting?.AccountingUnit, InpatTechnicAccounting = t.inner.FirstOrDefault(f => f.Department == dept)?.InpatTechnicAccounting?.AccountingUnit,
}; };
}); });
logger.LogInformation("************抽取结果1***************: " + JsonHelper.Serialize(data.Where(t => t.Department == "一病区(外科一)" && t.Category == "CT费")));
var groupdata = data.GroupBy(t => new { t.Department, t.Category, t.SheetName }).Select(t => new ExtractTransDto var groupdata = data.GroupBy(t => new { t.Department, t.Category, t.SheetName }).Select(t => new ExtractTransDto
{ {
SheetName = t.Key.SheetName, SheetName = t.Key.SheetName,
...@@ -258,6 +256,7 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re ...@@ -258,6 +256,7 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re
InpatNurseAccounting = t.First().InpatNurseAccounting, InpatNurseAccounting = t.First().InpatNurseAccounting,
InpatTechnicAccounting = t.First().InpatTechnicAccounting, InpatTechnicAccounting = t.First().InpatTechnicAccounting,
}); });
logger.LogInformation("************抽取结果2***************: " + JsonHelper.Serialize(groupdata.Where(t => t.Department == "一病区(外科一)" && t.Category == "CT费")));
return groupdata.ToList(); return groupdata.ToList();
} }
......
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