合并冲突

parent 97a487e5
......@@ -77,6 +77,7 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
// }
//}
var sheetNames = workbook.GetAllNames().Select(w => w.SheetName);
foreach (var module in modulesList.Where(t => new int[] { (int)SheetType.Income, (int)SheetType.OtherIncome }.Contains(t.SheetType.Value))?.OrderBy(t => t.ModuleName))
{
var no = module.ModuleName.GetNo();
......
......@@ -157,15 +157,12 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
if (row == null) continue;
string department = row.GetOrCreate(dataFirstCellNum - 1).GetDecodeEscapes();
if (string.IsNullOrEmpty(department)) continue;
if (rowIndex >= dataFirstRowNum) dataFirstRowNum = rowIndex + 1;
var deptData = data.Where(t => t.Department.NoBlank() == department);
if (deptData == null || !deptData.Any(t => t.Value.HasValue && t.Value != 0)) continue;
if (rowIndex > dataFirstRowNum) dataFirstRowNum = rowIndex + 1;
#region 写入数据
if (sheetType == SheetType.Income)
if (sheetType == SheetType.Income && !string.IsNullOrEmpty(department))
{
if (!incomes.Any(t => t.Department == department))
incomes.Add(GetIncomeRowMessage(row, dataFirstCellNum, department, rowIndex));
......@@ -178,13 +175,22 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
var cell = row.GetOrCreate(cellIndex);
if (string.IsNullOrEmpty(column)) continue;
var value = deptData.FirstOrDefault(t => t.Category.NoBlank() == column)?.Value;
decimal? value = 0m;
if (!string.IsNullOrEmpty(department))
{
var deptData = data.Where(t => t.Department.NoBlank() == department);
if (deptData != null && deptData.Any(t => t.Value.HasValue && t.Value != 0))
value = deptData.FirstOrDefault(t => t.Category.NoBlank() == column)?.Value;
}
//数据为空,且单元格值不为空,不写入数据(保留原始值)
// 22.3.29 ry 只要是提取的列头全部覆盖数据
if (headers != null && headers.Contains(column) && value.HasValue && value != 0)
{
cell.SetCellValue<decimal>(value);
cell.CellStyle = cellStyle;
}
}
#endregion
......@@ -270,14 +276,14 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
{
{ 1, item.Department },
{ 2, (sheet.SheetName.Contains("门诊")
? deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.OutNurseAccounting))?.OutNurseAccounting
: deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.InpatNurseAccounting))?.InpatNurseAccounting) ?? item.NurseAccount },
? deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.OutNurseAccounting))?.OutNurseAccounting
: deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.InpatNurseAccounting))?.InpatNurseAccounting) ?? item.NurseAccount },
{ 3, (sheet.SheetName.Contains("门诊")
? deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.OutDoctorAccounting))?.OutDoctorAccounting
: deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.InpatDoctorAccounting))?.InpatDoctorAccounting) ?? item.DoctorAccount },
? deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.OutDoctorAccounting))?.OutDoctorAccounting
: deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.InpatDoctorAccounting))?.InpatDoctorAccounting) ?? item.DoctorAccount },
{ 4, (sheet.SheetName.Contains("门诊")
? deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.OutTechnicAccounting))?.OutTechnicAccounting
: deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.InpatTechnicAccounting))?.InpatTechnicAccounting) ?? item.TechnicAccounting },
? deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.OutTechnicAccounting))?.OutTechnicAccounting
: deptData.FirstOrDefault(t => !string.IsNullOrEmpty(t.InpatTechnicAccounting))?.InpatTechnicAccounting) ?? item.TechnicAccounting },
};
foreach (var content in deptContents)
......
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