Commit 26e8081a by 李承祥

sheet数据详情,bug修改

parent 6a937c40
......@@ -147,8 +147,14 @@ private void CommonExport(int sheetID, SheetExportResponse response)
if (headList == null) return;
var dataList = _perforImDataRepository.GetEntities(t => t.SheetID == sheetID)?.OrderByDescending(t => t.AccountingUnit).ToList();
//添加系数值
var sheet = _perforImSheetRepository.GetEntity(t => t.ID == sheetID);
//添加系数值
#region 添加系数值
int merge = 4;
if (sheet.SheetType == (int)SheetType.Income && !headList.Select(t => t.CellValue).Contains("医技组"))
merge = 3;
var factorhead = new Row(0);
if (sheet.SheetType == (int)SheetType.Workload)
{
......@@ -157,13 +163,13 @@ private void CommonExport(int sheetID, SheetExportResponse response)
}
else if (sheet.SheetType == (int)SheetType.OtherIncome || sheet.SheetType == (int)SheetType.Income || sheet.SheetType == (int)SheetType.Expend)
{
factorhead.Data.Add(new Cell(0, "护理组分割比例", 1, 4, false, false));
factorhead.Data.Add(new Cell(0, "护理组分割比例", 1, merge, false, false));
response = AddFactor(response, factorhead, headList.ToList(), dataList, UnitType.护理组);
var factorhead1 = new Row(1);
factorhead1.Data.Add(new Cell(0, "医生组分割比例", 1, 4, false, false));
factorhead1.Data.Add(new Cell(0, "医生组分割比例", 1, merge, false, false));
response = AddFactor(response, factorhead1, headList.ToList(), dataList, UnitType.医生组);
var factorhead2 = new Row(2);
factorhead2.Data.Add(new Cell(0, "医技组分割比例", 1, 4, false, false));
factorhead2.Data.Add(new Cell(0, "医技组分割比例", 1, merge, false, false));
response = AddFactor(response, factorhead2, headList.ToList(), dataList, UnitType.医技组);
}
......@@ -171,18 +177,21 @@ private void CommonExport(int sheetID, SheetExportResponse response)
{
//var technicianvalue = new Row(response.Header.Count()); technicianvalue.Data.Add(new Cell(0, "医技组核算收入", 1, 4, false, false));
//response.Header.Add(technicianvalue);
var technicianhead = new Row(response.Header.Count()); technicianhead.Data.Add(new Cell(0, "医技组核算单元", 1, 4, false, false));
var technicianhead = new Row(response.Header.Count()); technicianhead.Data.Add(new Cell(0, "医技组核算单元", 1, merge, false, false));
response.Header.Add(technicianhead);
foreach (var header in headList)
{
if (new List<string> { "核算单元(医组)", "核算单元(医生组)", "核算单元(护理组)", "科室名称" }.Contains(header.CellValue)) continue;
if (new List<string> { "核算单元(医组)", "核算单元(医生组)", "核算单元(护理组)", "科室名称" }.Contains(header.CellValue)) continue;
var technician = dataList.FirstOrDefault(t => t.UnitType == 3 && t.TypeName == header.CellValue);
//technicianvalue.Data.Add(new Cell(header.PointCell.Value, technician.CellValue, header.MergeRow.Value, header.MergeCell.Value, header.IsTotal == 1, false));
technicianhead.Data.Add(new Cell(header.PointCell.Value, technician?.AccountingUnit ?? null, header.MergeRow.Value, header.MergeCell.Value, header.IsTotal == 1, false));
}
}
#endregion
//创建列头行
#region 创建列头行
var rowhead = new Row(response.Header.Count());
response.Header.Add(rowhead);
foreach (var header in headList.Where(t => !t.ParentID.HasValue || t.ParentID.Value == 0))
......@@ -204,8 +213,10 @@ private void CommonExport(int sheetID, SheetExportResponse response)
if (!headList.Any(t => t.ParentID == head.ID))
headers.Add(head);
}
#endregion
//创建数据行
#region 创建数据行
if (dataList == null || dataList.Count == 0) return;
Row rowbody = null;
foreach (var rowNumber in dataList.Select(t => t.RowNumber).Distinct()) //.OrderBy(t => t)
......@@ -259,6 +270,7 @@ private void CommonExport(int sheetID, SheetExportResponse response)
}
}
}
#endregion
}
private void AccountNurseExport(int sheetID, SheetExportResponse response)
......@@ -487,7 +499,7 @@ private SheetExportResponse AddFactor(SheetExportResponse response, Row row, Lis
}
else
{
string[] array = new string[] { "核算单元(医组)", "核算单元(医生组)", "核算单元(护理组)", "科室名称" };
string[] array = new string[] { "核算单元(医组)", "核算单元(医生组)", "核算单元(护理组)", "科室名称" };
foreach (var header in headList.Where(t => !t.ParentID.HasValue || t.ParentID.Value == 0))
{
if (!array.Contains(header.CellValue))
......
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