From dd8c769984294f114525f7e8441fca4871f2781b Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Fri, 19 May 2023 20:40:03 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B0=D1=8F=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ReportCashierLogic.cs | 24 ++++++++++++++++++- .../BindingModels/ReportBindingModel.cs | 2 ++ .../Controllers/ReportController.cs | 6 ++--- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/BankYouBankrupt/BankYouBankruptBusinessLogic/BusinessLogics/ReportCashierLogic.cs b/BankYouBankrupt/BankYouBankruptBusinessLogic/BusinessLogics/ReportCashierLogic.cs index 7c86c2b..16d7839 100644 --- a/BankYouBankrupt/BankYouBankruptBusinessLogic/BusinessLogics/ReportCashierLogic.cs +++ b/BankYouBankrupt/BankYouBankruptBusinessLogic/BusinessLogics/ReportCashierLogic.cs @@ -71,6 +71,21 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics .ToList(); } + //формирование списка выдаци наличных со счёта за период + public List? GetMoneyTransfers(ReportBindingModel model) + { + return _moneyTransferStorage.GetFilteredList(new MoneyTransferSearchModel { ClientId = model.ClientId, DateFrom = model.DateFrom, DateTo = model.DateTo }) + .Select(x => new ReportCashierViewModel + { + OperationId = x.Id, + DateComplite = x.DateOperation, + AccountPayeeNumber = x.AccountPayeeNumber, + AccountSenderNumber = x.AccountSenderNumber, + SumOperation = x.Sum + }) + .ToList(); + } + //формирование полного имени клиента для отчёта public string GetFullName(ReportBindingModel model) { @@ -91,7 +106,14 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics //Сохранение заготовок с указаеним изделий в файл-Excel public void SaveAccountsToExcelFile(ReportBindingModel model) { - throw new NotImplementedException(); + _saveToExcel.CreateReport(new ExcelInfo + { + FileName = model.FileName, + + Title = "Заявки на счёт", + + Debiting = + }); } //Сохранение заказов в файл-Pdf diff --git a/BankYouBankrupt/BankYouBankruptContracts/BindingModels/ReportBindingModel.cs b/BankYouBankrupt/BankYouBankruptContracts/BindingModels/ReportBindingModel.cs index 6800288..57e07a6 100644 --- a/BankYouBankrupt/BankYouBankruptContracts/BindingModels/ReportBindingModel.cs +++ b/BankYouBankrupt/BankYouBankruptContracts/BindingModels/ReportBindingModel.cs @@ -13,6 +13,8 @@ namespace BankYouBankruptContracts.BindingModels public int? ClientId { get; set; } + public int? AccountId { get; set; } + public List? CardList { get; set; } public string? ClientFullName { get; set; } = string.Empty; diff --git a/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/ReportController.cs b/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/ReportController.cs index adda4d6..e1f641d 100644 --- a/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/ReportController.cs +++ b/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/ReportController.cs @@ -158,11 +158,11 @@ namespace BankYouBankruptRestAPI.Controllers { try { - _reportCashierLogic.SaveToExcelFile(new ReportBindingModel + _reportCashierLogic.SaveAccountsToExcelFile(new ReportBindingModel { FileName = "Отчёт по переводам.xls", - CardList = model.CardList - }, ExcelOperationEnum.Между_cчетами); + AccountId = model.AccountId + }); } catch (Exception ex) {