Commit 8baf43c4 by lcx

更换数据来源

parent 62702fe7
...@@ -18,6 +18,10 @@ public enum UnitType ...@@ -18,6 +18,10 @@ public enum UnitType
public void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType sheetType, int fixedCount, List<ExcelHeader> headers) public void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType sheetType, int fixedCount, List<ExcelHeader> headers)
{ {
if (headers == null || !headers.Any()) return;
var columns = headers.Select(t => t).ToList();
// 收入支出系数 // 收入支出系数
var nurseFactor = sheet.GetOrCreate(point.AccountingUnit.First(t => t.UnitType == UnitType.护理组.ToString()).FactorRow.Value); var nurseFactor = sheet.GetOrCreate(point.AccountingUnit.First(t => t.UnitType == UnitType.护理组.ToString()).FactorRow.Value);
var doctorFactor = sheet.GetRow(point.AccountingUnit.First(t => t.UnitType == UnitType.医生组.ToString()).FactorRow.Value); var doctorFactor = sheet.GetRow(point.AccountingUnit.First(t => t.UnitType == UnitType.医生组.ToString()).FactorRow.Value);
...@@ -36,16 +40,16 @@ public void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType sheetT ...@@ -36,16 +40,16 @@ public void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType sheetT
var column = columnHeader.GetCell(index).GetDecodeEscapes(); var column = columnHeader.GetCell(index).GetDecodeEscapes();
if (string.IsNullOrEmpty(column)) continue; if (string.IsNullOrEmpty(column)) continue;
headers.RemoveAll(t => t.ColumnName == column); columns.RemoveAll(t => t.ColumnName == column);
if (index > headerFirstCellNum) if (index > headerFirstCellNum)
headerFirstCellNum = index + 1; headerFirstCellNum = index + 1;
} }
} }
if (headers == null || !headers.Any()) return; if (columns == null || !columns.Any()) return;
// 补充excel中不存在的列 // 补充excel中不存在的列
foreach (var item in headers) foreach (var item in columns)
{ {
var columnCell = columnHeader.GetOrCreate(headerFirstCellNum); var columnCell = columnHeader.GetOrCreate(headerFirstCellNum);
columnCell.SetCellValue(item.ColumnName); columnCell.SetCellValue(item.ColumnName);
......
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