From 686a76fb695abc24c0281c94559033ada70e922b Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Fri, 19 May 2023 20:32:27 +0400 Subject: [PATCH] . --- .../BusinessLogics/ReportClientLogic.cs | 2 +- .../OfficePackage/AbstractSaveToExcel.cs | 2 +- .../Controllers/HomeController.cs | 20 ++++++++- .../Views/Home/ReportWithAccounts.cshtml | 3 ++ .../Controllers/HomeController.cs | 16 +++++++ .../Views/Home/ReportWithCards.cshtml | 7 +++- .../ReportSupportBindingModel.cs | 2 + .../Controllers/ReportController.cs | 39 ++++++++++++++++++ .../Отчёт по снятиям.xls | Bin 0 -> 3440 bytes 9 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 BankYouBankrupt/BankYouBankruptRestAPI/Отчёт по снятиям.xls diff --git a/BankYouBankrupt/BankYouBankruptBusinessLogic/BusinessLogics/ReportClientLogic.cs b/BankYouBankrupt/BankYouBankruptBusinessLogic/BusinessLogics/ReportClientLogic.cs index 192548e..de204e4 100644 --- a/BankYouBankrupt/BankYouBankruptBusinessLogic/BusinessLogics/ReportClientLogic.cs +++ b/BankYouBankrupt/BankYouBankruptBusinessLogic/BusinessLogics/ReportClientLogic.cs @@ -164,7 +164,7 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics { FileName = model.FileName, Title = "Отчёт по снятиям денежных средств", - Crediting = GetExcelCrediting(model) + Debiting = GetExcelDebiting(model) }, operationEnum); } } diff --git a/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 019b92d..77e765a 100644 --- a/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -360,7 +360,7 @@ namespace BankYouBankruptBusinessLogic.OfficePackage { ColumnName = "C", RowIndex = rowIndex, - Text = info.Crediting.Sum(x => x.Sum).ToString(), + Text = info.Debiting.Sum(x => x.Sum).ToString(), StyleInfo = ExcelStyleInfoType.Text }); diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs index fc5fb2c..f49eeb3 100644 --- a/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs @@ -3,6 +3,7 @@ using BankYouBankruptContracts.BindingModels; using BankYouBankruptContracts.ViewModels; using BankYouBankruptContracts.ViewModels.Client.Default; using BankYouBankruptContracts.ViewModels.Client.Diagram; +using BankYouBankruptContracts.ViewModels.Client.Reports; using BankYouBankruptDataModels.Enums; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; @@ -464,7 +465,24 @@ namespace BankYouBankruptCashierApp.Controllers return View(new List()); } - [HttpPost] + //создание excel отчёта у касира + [HttpPost] + public IActionResult CreateCashierExcelReport(string accountId) + { + if (APICashier.Cashier == null) + { + throw new Exception("Не авторизованы"); + } + + APICashier.PostRequest("api/Report/CreateExcelCashier", new ReportSupportBindingModel() + { + AccountId = int.Parse(accountId) + }); + + return Redirect("~/Home/Enter"); + } + + [HttpPost] public IActionResult ReportWithAccounts(string accountId) { if (APICashier.Cashier == null) diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/ReportWithAccounts.cshtml b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/ReportWithAccounts.cshtml index d226875..3b54dbe 100644 --- a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/ReportWithAccounts.cshtml +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/ReportWithAccounts.cshtml @@ -22,6 +22,9 @@
+
+ +
diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs index e452238..65b119d 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs @@ -311,6 +311,22 @@ namespace BankYouBankruptClientApp.Controllers return Redirect("~/Home/Enter"); } + [HttpPost] + public IActionResult CreateDebitingExcelReport(List cards) + { + if (APIClient.Client == null) + { + throw new Exception("Не авторизованы"); + } + + APIClient.PostRequest("api/Report/CreateExcelDebiting", new ReportSupportBindingModel() + { + CardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList() + }); + + return Redirect("~/Home/Enter"); + } + #endregion #region Получение отчета по картам diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportWithCards.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportWithCards.cshtml index 33f0065..005d70a 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportWithCards.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportWithCards.cshtml @@ -28,12 +28,15 @@
-
+
-
+
+
+ +
diff --git a/BankYouBankrupt/BankYouBankruptContracts/BindingModels/ReportSupportBindingModel.cs b/BankYouBankrupt/BankYouBankruptContracts/BindingModels/ReportSupportBindingModel.cs index 82bf093..744c0f1 100644 --- a/BankYouBankrupt/BankYouBankruptContracts/BindingModels/ReportSupportBindingModel.cs +++ b/BankYouBankrupt/BankYouBankruptContracts/BindingModels/ReportSupportBindingModel.cs @@ -12,6 +12,8 @@ namespace BankYouBankruptContracts.BindingModels { public int ClientId { get; set; } + public int AccountId { get; set; } + public DateTime DateFrom { get; set; } public DateTime DateTo { get; set; } diff --git a/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/ReportController.cs b/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/ReportController.cs index f6da290..adda4d6 100644 --- a/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/ReportController.cs +++ b/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/ReportController.cs @@ -132,5 +132,44 @@ namespace BankYouBankruptRestAPI.Controllers throw; } } + + //отчёт клиента Excel по выдаче денег + [HttpPost] + public void CreateExcelDebiting(ReportSupportBindingModel model) + { + try + { + _reportClientLogic.SaveToExcelFile(new ReportBindingModel + { + FileName = "Отчёт по снятиям.xls", + CardList = model.CardList + }, ExcelOperationEnum.Cнятие_с_карты); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка входа в систему"); + throw; + } + } + + //отчёт клиента Excel по переводу денег + [HttpPost] + public void CreateExcelCashier(ReportSupportBindingModel model) + { + try + { + _reportCashierLogic.SaveToExcelFile(new ReportBindingModel + { + FileName = "Отчёт по переводам.xls", + CardList = model.CardList + }, ExcelOperationEnum.Между_cчетами); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка входа в систему"); + throw; + } + } + } } diff --git a/BankYouBankrupt/BankYouBankruptRestAPI/Отчёт по снятиям.xls b/BankYouBankrupt/BankYouBankruptRestAPI/Отчёт по снятиям.xls new file mode 100644 index 0000000000000000000000000000000000000000..47f51008471a686bccd00dbdd2ca1129338af9b5 GIT binary patch literal 3440 zcma)92{@Ep8y;jEA=@Zf##pkCU1G>KMOm}UFfoQK!_3&%Y^Ab@m-F1`I?s9T`+1JV35GqqAP@@+h?z{WHSy(% zdj$f4BZ@9-HoDTwV)4 zF_LY4)Lj0wS@w^G=@pKNEFDeMW2j=3*4D+P8*jcY z=TI)CaL;liK?qr^gW}&2EhZ>*O~-meS={63fT&NHa_xP@I)me3XPLbz3QNIO>JIyB zMmQ`#=g%=Iso4?q3akz8v-cvQ_SInrCD4LKlr;VJh-7<$q*KLkxFkV$v4KOpvb|9y z>J1oiyYO4M0%9RPb;xQitLyu%Vb$TlI*-{tpTC(~+Je!60o4D63ckD=1(P^glyx1g`#~%Zt?w$uT7U|dZxP?1f z{4_SYBT(1q&`@g9dkyl6U9OY2syK&qvk}s8_XgedL_uP((} zZH3^CTR&hEV*UmFkw2pKwv$>t?p+wiXeVA+ zyjY4IGLGlF^>PGXEd#L>blxEPk|e-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