Commit 4c293338 by lcx

4.1未获取到科室信息时,读取Excel中的科室信息

parent 3e92581b
......@@ -25,25 +25,34 @@ public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetT
public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, object data, Dictionary<ExDataDict, object> exdict = null)
{
if (data != null && data is List<per_dept_dic> departments && departments.Any())
try
{
int dataFirstRowNum = point.DataFirstRowNum.Value;
if (!exdict.ContainsKey(ExDataDict.AccountingBasic))
exdict.Add(ExDataDict.AccountingBasic, new List<Account>());
var accountingUnits = departments.Select(t => new Account
var accountingUnits = new List<Account>();
if (data != null && data is List<per_dept_dic> departments && departments.Any())
{
UnitType = t.UnitType.NoBlank(),
AccountingUnit = t.AccountingUnit.NoBlank()
}).ToList();
logger.LogInformation("4.1所有系统科室: " + JsonHelper.Serialize(departments));
int dataFirstRowNum = point.DataFirstRowNum.Value;
var tuples = GetAccountingUnitDataNonexistent(sheet, point, accountingUnits);
accountingUnits = departments.Select(t => new Account
{
UnitType = t.UnitType.NoBlank(),
AccountingUnit = t.AccountingUnit.NoBlank()
}).ToList();
accountingUnits = accountingUnits.Where(t => !t.AccountingUnit.Contains("非核算"))?.ToList();
var tuples = GetAccountingUnitDataNonexistent(sheet, point, accountingUnits);
if (accountingUnits == null || !accountingUnits.Any()) return;
accountingUnits = accountingUnits.Where(t => !t.AccountingUnit.Contains("非核算"))?.ToList();
logger.LogInformation("4.1所有科室: " + JsonHelper.Serialize(accountingUnits));
if (accountingUnits != null && accountingUnits.Any())
WriteAccountingUnitDataNonexistent(sheet, point, style, accountingUnits, tuples);
}
WriteAccountingUnitDataNonexistent(sheet, point, style, accountingUnits, tuples);
logger.LogInformation("4.1所有科室: " + JsonHelper.Serialize(accountingUnits));
var accountBasic = new List<Account>();
......@@ -59,7 +68,11 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
});
}
exdict.Add(ExDataDict.AccountingBasic, accountBasic);
exdict[ExDataDict.AccountingBasic] = accountBasic;
}
catch (Exception ex)
{
logger.LogError("4.1所有科室被获取时发生异常:" + ex.ToString());
}
}
......
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