Commit 69d9b7ea by lcx

自定义提取清除历史数据

parent 725c5e5b
...@@ -324,14 +324,14 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re ...@@ -324,14 +324,14 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re
Department = t.Key.Department, Department = t.Key.Department,
Category = t.Key.Category, Category = t.Key.Category,
Value = t.Sum(group => group.Value) == 0 ? null : t.Sum(group => group.Value), Value = t.Sum(group => group.Value) == 0 ? null : t.Sum(group => group.Value),
OutDoctorAccounting = t.First().OutDoctorAccounting, OutDoctorAccounting = t.FirstOrDefault()?.OutDoctorAccounting,
OutNurseAccounting = t.First().OutNurseAccounting, OutNurseAccounting = t.FirstOrDefault()?.OutNurseAccounting,
OutTechnicAccounting = t.First().OutTechnicAccounting, OutTechnicAccounting = t.FirstOrDefault()?.OutTechnicAccounting,
InpatDoctorAccounting = t.First().InpatDoctorAccounting, InpatDoctorAccounting = t.FirstOrDefault()?.InpatDoctorAccounting,
InpatNurseAccounting = t.First().InpatNurseAccounting, InpatNurseAccounting = t.FirstOrDefault()?.InpatNurseAccounting,
InpatTechnicAccounting = t.First().InpatTechnicAccounting, InpatTechnicAccounting = t.FirstOrDefault()?.InpatTechnicAccounting,
SpecialAccounting = t.First().SpecialAccounting, SpecialAccounting = t.FirstOrDefault()?.SpecialAccounting,
EName = t.FirstOrDefault(w => !string.IsNullOrEmpty(w.EName)).EName EName = t.FirstOrDefault(w => !string.IsNullOrEmpty(w.EName))?.EName
}); });
return groupdata.ToList(); return groupdata.ToList();
......
...@@ -63,7 +63,7 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st ...@@ -63,7 +63,7 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
sheet = workbook.CreateSheet(module.ModuleName); sheet = workbook.CreateSheet(module.ModuleName);
workbook.SetSheetOrder(sheet.SheetName, workbook.NumberOfSheets - 1); workbook.SetSheetOrder(sheet.SheetName, workbook.NumberOfSheets - 1);
} }
ClearSheetData(sheet);
var exscript = exscripts.FirstOrDefault(t => t.TypeId == module.TypeId); var exscript = exscripts.FirstOrDefault(t => t.TypeId == module.TypeId);
if (exscript == null) continue; if (exscript == null) continue;
...@@ -116,5 +116,35 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st ...@@ -116,5 +116,35 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
} }
} }
} }
private void ClearSheetData(ISheet sheet)
{
try
{
for (int i = Point.DataFirstRowNum.Value; i < sheet.LastRowNum + 1; i++)
{
var row = sheet.GetRow(i);
if (row != null)
{
row.ZeroHeight = false; //取消隐藏行
int dataFirstCellRowNum = Point.DataFirstCellNum.Value;
//跳过核算单元和科室
for (int j = dataFirstCellRowNum; j < row.LastCellNum; j++)
{
var cell = row.GetCell(j);
if (cell != null && cell.CellType != CellType.Formula)
{
cell.RemoveCellComment();
row.RemoveCell(cell);
}
}
}
}
}
catch (Exception ex)
{
logger.LogError(ex.Message);
}
}
} }
} }
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