This commit is contained in:
shadowik 2023-05-19 20:37:35 +04:00
commit 3ed0568644
9 changed files with 86 additions and 5 deletions

View File

@ -164,7 +164,7 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
{ {
FileName = model.FileName, FileName = model.FileName,
Title = "Отчёт по снятиям денежных средств", Title = "Отчёт по снятиям денежных средств",
Crediting = GetExcelCrediting(model) Debiting = GetExcelDebiting(model)
}, operationEnum); }, operationEnum);
} }
} }

View File

@ -360,7 +360,7 @@ namespace BankYouBankruptBusinessLogic.OfficePackage
{ {
ColumnName = "C", ColumnName = "C",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = info.Crediting.Sum(x => x.Sum).ToString(), Text = info.Debiting.Sum(x => x.Sum).ToString(),
StyleInfo = ExcelStyleInfoType.Text StyleInfo = ExcelStyleInfoType.Text
}); });

View File

@ -3,6 +3,7 @@ using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels; using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default; using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptContracts.ViewModels.Client.Diagram; using BankYouBankruptContracts.ViewModels.Client.Diagram;
using BankYouBankruptContracts.ViewModels.Client.Reports;
using BankYouBankruptDataModels.Enums; using BankYouBankruptDataModels.Enums;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Diagnostics; using System.Diagnostics;
@ -488,7 +489,24 @@ namespace BankYouBankruptCashierApp.Controllers
return View(new List<ReportCashierAccountsViewModel>()); return View(new List<ReportCashierAccountsViewModel>());
} }
[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) public IActionResult ReportWithAccounts(string accountId)
{ {
if (APICashier.Cashier == null) if (APICashier.Cashier == null)

View File

@ -22,6 +22,9 @@
<div> <div>
<input class="btn btn-primary mt-3" type="submit" value="Submit" /> <input class="btn btn-primary mt-3" type="submit" value="Submit" />
</div> </div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateCashierExcelReport">Создать отчёт по заявкам снятия</button>
</div>
</form> </form>
</div> </div>
</div> </div>

View File

@ -311,6 +311,22 @@ namespace BankYouBankruptClientApp.Controllers
return Redirect("~/Home/Enter"); return Redirect("~/Home/Enter");
} }
[HttpPost]
public IActionResult CreateDebitingExcelReport(List<CheckboxViewModel> 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 #endregion
#region Получение отчета по картам #region Получение отчета по картам

View File

@ -28,12 +28,15 @@
<div class="mb-2"> <div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="ReportWithCards">Создать отчёт</button> <button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="ReportWithCards">Создать отчёт</button>
</div> </div>
<div> <div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateExcelReport">Создать отчёт по переводам</button> <button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateExcelReport">Создать отчёт по переводам</button>
</div> </div>
<div> <div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateCreditingExcelReport">Создать отчёт по пополнениям</button> <button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateCreditingExcelReport">Создать отчёт по пополнениям</button>
</div> </div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateDebitingExcelReport">Создать отчёт по снятиям</button>
</div>
</form> </form>
</div> </div>
</div> </div>

View File

@ -12,6 +12,8 @@ namespace BankYouBankruptContracts.BindingModels
{ {
public int ClientId { get; set; } public int ClientId { get; set; }
public int AccountId { get; set; }
public DateTime DateFrom { get; set; } public DateTime DateFrom { get; set; }
public DateTime DateTo { get; set; } public DateTime DateTo { get; set; }

View File

@ -132,5 +132,44 @@ namespace BankYouBankruptRestAPI.Controllers
throw; 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;
}
}
} }
} }