change report logic; add regions

This commit is contained in:
Zakharov_Rostislav 2024-05-26 15:22:02 +04:00
parent 449fb82fad
commit 899c490626
2 changed files with 38 additions and 14 deletions

View File

@ -1,4 +1,5 @@
using BankContracts.BusinessLogicsContracts;
using BankBusinessLogic.OfficePackage;
using BankContracts.BusinessLogicsContracts;
using BankContracts.SearchModels;
using BankContracts.StoragesContracts;
using BankContracts.ViewModels;
@ -13,34 +14,51 @@ namespace BankBusinessLogic.BusinessLogic
{
public class ReportLogic : IReportLogic
{
private readonly ILogger _logger;
private readonly ICardStorage _cardStorage;
private readonly IAccountStorage _accountStorage;
public ReportLogic(ILogger logger, ICardStorage cardStorage, IAccountStorage accountStorage)
private readonly AbstractSaveToExcel _saveToExcel;
private readonly AbstractSaveToWord _saveToWord;
private readonly AbstractSaveToPdf _saveToPdf;
public ReportLogic(
ICardStorage cardStorage,
IAccountStorage accountStorage,
AbstractSaveToExcel saveToExcel,
AbstractSaveToWord saveToWord,
AbstractSaveToPdf saveToPdf)
{
_logger = logger;
_cardStorage = cardStorage;
_accountStorage = accountStorage;
}
public List<ReportOperationsRequestsViewModel> CreateReportOperationsRequests(CardSearchModel model)
{
return _cardStorage.GetReportOperationsRequestsList(model);
}
_saveToExcel = saveToExcel;
_saveToWord = saveToWord;
_saveToPdf = saveToPdf;
}
#region//списки заявок по выбранным счетам в формате word и excel
public List<ReportRequestsViewModel> CreateReportRequests(AccountSearchModel model)
{
return _accountStorage.GetRequestsReport(model);
}
#endregion
public List<ReportTransfersViewModel> CreateReportTransfers(CardSearchModel model)
#region//списки переводов по выбранным картам в формате word и excel
public List<ReportTransfersViewModel> CreateReportTransfers(CardSearchModel model)
{
return _cardStorage.GetReportTransfersList(model);
}
#endregion
public List<ReportTransfersWithdrawalsViewModel> CreateReportTransfersWithdrawals(AccountSearchModel model)
#region//отчеты по картам за период с расшифровкой по заявкам и операциям в формате pdf
public List<ReportOperationsRequestsViewModel> CreateReportOperationsRequests(CardSearchModel model)
{
return _cardStorage.GetReportOperationsRequestsList(model);
}
#endregion
#region//отчеты по счетам за период с расшифровкой по переводам и выдачам в формате pdf
public List<ReportTransfersWithdrawalsViewModel> CreateReportTransfersWithdrawals(AccountSearchModel model)
{
return _accountStorage.GetTransfersWithdrawalsReport(model);
}
}
}
#endregion
}
}

View File

@ -1,4 +1,6 @@
using BankBusinessLogic.BusinessLogic;
using BankBusinessLogic.OfficePackage;
using BankBusinessLogic.OfficePackage.Implements;
using BankContracts.BusinessLogicsContracts;
using BankContracts.StoragesContracts;
using BankDatabaseImplement.Implements;
@ -35,6 +37,10 @@ builder.Services.AddTransient<IRequestLogic, RequestLogic>();
builder.Services.AddTransient<IWithdrawalStorage, WithdrawalStorage>();
builder.Services.AddTransient<IWithdrawalLogic, WithdrawalLogic>();
builder.Services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();
builder.Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
builder.Services.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);