Commit 801e9e54 by ruyun.zhang

何明清舟山医院,忽略收入表清楚历史数据 默认关闭

parent ea5f8646
......@@ -125,7 +125,14 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
}
}
public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, SheetType sheetType)
/// <summary>
/// 清理工作表历史数据
/// </summary>
/// <param name="sheet"></param>
/// <param name="point"></param>
/// <param name="sheetType"></param>
/// <param name="ignore">何明清舟山医院,忽略收入表清楚历史数据 默认关闭</param>
public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, SheetType sheetType, bool ignore = false)
{
if (sheet == null)
return;
......@@ -142,6 +149,7 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
{
var cell = row.GetCell(j);
if (cell == null) continue;
if (ignore && sheetType == SheetType.Income) continue;
if (cell.CellType != CellType.Formula || sheetType == SheetType.Income)
{
......
using Dapper;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using NPOI.SS.UserModel;
using Performance.DtoModels;
......@@ -17,6 +18,7 @@ namespace Performance.Services.ExtractExcelService
public class ExtractService : IAutoInjection
{
private readonly ILogger logger;
private readonly IConfiguration _configuration;
private readonly DapperService service;
private readonly LogManageService logService;
private readonly QueryService queryService;
......@@ -37,6 +39,7 @@ public class ExtractService : IAutoInjection
public ExtractService(
ILogger<ExtractService> logger,
IConfiguration configuration,
DapperService service,
LogManageService logService,
QueryService queryService,
......@@ -57,6 +60,7 @@ DapperService dapperService
)
{
this.logger = logger;
_configuration = configuration;
this.service = service;
this.logService = logService;
this.queryService = queryService;
......@@ -235,7 +239,9 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
if (types.Contains(sheetType) && point != null && point.DataFirstCellNum.HasValue)
{
logger.LogInformation($"{sheetName}开始清除历史数据。point:{JsonHelper.Serialize(point)}");
ExtractHelper.ClearSheetPartialData(sheet, point, sheetType);
// 何明清舟山医院,忽略收入表清楚历史数据 默认关闭
var ignoreSheetTypeIncomeClear = _configuration.GetValue<bool>("Application:IgnoreSheetTypeIncomeClear", false);
ExtractHelper.ClearSheetPartialData(sheet, point, sheetType, ignoreSheetTypeIncomeClear);
}
var customer = factory.GetWriteData(sheetType, logger);
......
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