Commit f2081032 by 钟博

修改材料考核,其他医院统计表bug

parent 56b80856
......@@ -404,8 +404,6 @@ public ApiResponse<res_baiscnorm> EditHospitalAvg([FromBody] ComputerAvgRequest
public ApiResponse OtherPerStats(int allotId)
{
var employee = _employeeService.GetAprList(allotId, _claim.GetUserId());
if (employee==null)
return new ApiResponse(ResponseType.OK,null);
var relust= _computeService.GetOtherPerStats(employee);
return new ApiResponse(ResponseType.OK,relust);
......
......@@ -1454,31 +1454,36 @@ public res_baiscnorm EditHospitalAvg(ComputerAvgRequest request)
public List<Dictionary<string, string>> GetOtherPerStats(List<per_apr_amount> employees)
{
var perForType = employees.Select(t => t.PerforType).Distinct();
var doctor = employees.Select(t => t.DoctorName.Trim()).Distinct();
var others = new List<Dictionary<string, string>>();
foreach (var name in doctor)
if (employees==null)
return others;
var perForType = employees.Where(c=>c.Status==3).Select(t => t.PerforType).Distinct();
var doctorNum = employees.Where(c=>c.Status==3).Select(t => t.PersonnelNumber).Distinct().ToList();
if (!doctorNum.Any())
return others;
foreach (var num in doctorNum)
{
var dicData = new Dictionary<string, string>();
var amount = employees.First(t => t.DoctorName == name);
var unitype = perforPeremployeeRepository.GetEntity(t =>
t.DoctorName == name && t.JobNumber == amount.PersonnelNumber)?.UnitType;
dicData.Add("核算单元组别",unitype??"/");
var amount = employees.Find(t => t.PersonnelNumber == num);
if (amount == null)
continue;
dicData.Add("核算单元",amount?.AccountingUnit??"");
dicData.Add("工号",amount?.PersonnelNumber??"");
dicData.Add("人员姓名",amount?.DoctorName??"");
foreach (var type in perForType)
{
var emp = employees.Where(t => t.PerforType == type && t.DoctorName == name)?.ToList();
var emp = employees.Where(t => t.PerforType == type && t.PersonnelNumber == num)?.ToList();
if (!emp.Any())
dicData.Add(type,"0");
else
dicData.Add(type,Math.Round(Convert.ToDecimal(emp?.First()?.Amount),0).ToString());
}
var sum = employees.Where(c=>c.DoctorName==name)?.Sum(t => t.Amount);
var sum = employees.Where(c=>c.PersonnelNumber==num)?.Sum(t => t.Amount);
dicData.Add("合计",Math.Round(Convert.ToDecimal(sum),0).ToString());
others.Add(dicData);
}
......
......@@ -643,56 +643,48 @@ public List<TitleValue> GetPerforTypeDict(int allotId)
#region 科室考核
public List<string[]> GetDeptAssessment(int allotId)
public List<Dictionary<string, string>> GetDeptAssessment(int allotId)
{
var sheet = perforPersheetRepository.GetEntity(t => t.AllotID == allotId && t.SheetName == "5.4 科室材料考核2");
if (sheet == null)
return new List<string[]>();
var data = perforImdataRepository.GetEntities(t => t.AllotID == allotId && t.SheetID == sheet.ID);
var dataNum = data?.Select(t => t.RowNumber)?.OrderBy(c=>c.Value).Distinct();
var rowData = new List<string[]>();
if (dataNum != null)
foreach (var num in dataNum)
return new List<Dictionary<string, string>>();
var imData = perforImdataRepository.GetEntities(t => t.AllotID == allotId && t.SheetID == sheet.ID);
var headers = imData.OrderByDescending(c=>c.IsTotal).Select(t => t.TypeName).Distinct();
var dataNum = imData.Select(t => t.RowNumber)?.OrderBy(c => c.Value).Distinct().ToList();
if (!dataNum.Any())
return new List<Dictionary<string, string>>();
var rowData = new List<Dictionary<string, string>>();
foreach (var num in dataNum)
{
var dicData = new Dictionary<string, string>();
var fisHeader = false;
foreach (var header in headers)
{
var deptData = new string[7];
var row = data.Where(t => t.RowNumber == num);
deptData[2] = row.First()?.AccountingUnit;
if((int)row.First()?.UnitType==(int)UnitType.医生组)
deptData[1] = "医生组";
else if((int)row.First()?.UnitType==(int)UnitType.医技组)
deptData[1] = "医技组";
else if ((int)row.First()?.UnitType == (int)UnitType.护理组)
deptData[1] = "护理组";
foreach (var imData in row)
var headData = imData.Find(t => t.RowNumber == num && t.TypeName == header)?.CellValue;
dicData.Add(header, Math.Round((decimal)headData * 100) + "%");
if (!fisHeader)
{
if (imData.TypeName == "考核得分合计")
{
if (imData.CellValue != null)
deptData[0] = Math.Round((decimal) imData.CellValue * 100) + "%";
}
else if(imData.TypeName == "考核1")
var data = imData?.First(t => t.RowNumber == num);
switch (data.UnitType)
{
if (imData.CellValue != null)
deptData[3] = Math.Round((decimal) imData.CellValue * 100) + "%";
case (int)UnitType.医技组:
dicData.Add("核算单元类型", "医技组");
break;
case (int)UnitType.医生组:
dicData.Add("核算单元类型", "医生组");
break;
case (int)UnitType.护理组:
dicData.Add("核算单元类型", "护理组");
break;
}
else if (imData.TypeName == "考核2")
{
if (imData.CellValue != null)
deptData[4] = Math.Round((decimal) imData.CellValue * 100) + "%";
}
else if (imData.TypeName == "考核三")
{
if (imData.CellValue != null)
deptData[5] = Math.Round((decimal) imData.CellValue * 100) + "%";
}
else if (imData.TypeName == "考核四")
if (imData.CellValue != null)
deptData[6] = Math.Round((decimal) imData.CellValue * 100) + "%";
dicData.Add("核算单元", data.AccountingUnit);
fisHeader = true;
}
rowData.Add(deptData);
}
rowData.Add(dicData);
}
return rowData;
}
......
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