Commit f2081032 by 钟博

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

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