CashierReportAccounts
This commit is contained in:
parent
eb8a5172d5
commit
4c40714bf0
@ -54,8 +54,8 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
|||||||
|
|
||||||
public List<CashWithdrawalViewModel>? ReadList(CashWithdrawalSearchModel? model)
|
public List<CashWithdrawalViewModel>? ReadList(CashWithdrawalSearchModel? model)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("ReadElement. AccountId:{AccountId}. Sum:{Sum}. DateOperation:{DateOperation}. Id:{Id}",
|
_logger.LogInformation("ReadElement. AccountId:{AccountId}. Sum:{Sum}. DateOperation:{DateOperation}. Id:{Id}",
|
||||||
model.AccountId, model.Sum, model.DateTo, model?.Id);
|
model?.AccountId, model?.Sum, model?.DateTo, model?.Id);
|
||||||
|
|
||||||
//list хранит весь список в случае, если model пришло со значением null на вход метода
|
//list хранит весь список в случае, если model пришло со значением null на вход метода
|
||||||
var list = model == null ? _cashWithdrawalStorage.GetFullList() : _cashWithdrawalStorage.GetFilteredList(model);
|
var list = model == null ? _cashWithdrawalStorage.GetFullList() : _cashWithdrawalStorage.GetFilteredList(model);
|
||||||
|
@ -55,7 +55,7 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
|||||||
public List<MoneyTransferViewModel>? ReadList(MoneyTransferSearchModel? model)
|
public List<MoneyTransferViewModel>? ReadList(MoneyTransferSearchModel? model)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("ReadElement. AccountSenderId:{AccountSenderId}. AccountPayeeId:{AccountPayeeId}. Sum:{Sum}. Id:{Id}",
|
_logger.LogInformation("ReadElement. AccountSenderId:{AccountSenderId}. AccountPayeeId:{AccountPayeeId}. Sum:{Sum}. Id:{Id}",
|
||||||
model.AccountSenderId, model.AccountPayeeId, model.Sum, model?.Id);
|
model?.AccountSenderId, model?.AccountPayeeId, model?.Sum, model?.Id);
|
||||||
|
|
||||||
//list хранит весь список в случае, если model пришло со значением null на вход метода
|
//list хранит весь список в случае, если model пришло со значением null на вход метода
|
||||||
var list = model == null ? _moneyTransferStorage.GetFullList() : _moneyTransferStorage.GetFilteredList(model);
|
var list = model == null ? _moneyTransferStorage.GetFullList() : _moneyTransferStorage.GetFilteredList(model);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using BankYouBankruptCashierApp.Models;
|
using BankYouBankruptCashierApp.Models;
|
||||||
using BankYouBankruptContracts.BindingModels;
|
using BankYouBankruptContracts.BindingModels;
|
||||||
using BankYouBankruptContracts.ViewModels;
|
using BankYouBankruptContracts.ViewModels;
|
||||||
|
using BankYouBankruptDataModels.Enums;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
@ -420,12 +421,44 @@ namespace BankYouBankruptCashierApp.Controllers
|
|||||||
|
|
||||||
ViewBag.Accounts = APICashier.GetRequest<List<AccountViewModel>>("/api/Account/GetAllAccounts");
|
ViewBag.Accounts = APICashier.GetRequest<List<AccountViewModel>>("/api/Account/GetAllAccounts");
|
||||||
|
|
||||||
return View();
|
return View(new List<ReportCashierAccountsViewModel>());
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Получение отчёта PDF
|
[HttpPost]
|
||||||
|
public IActionResult ReportWithAccounts(string accountId)
|
||||||
|
{
|
||||||
|
if (APICashier.Cashier == null)
|
||||||
|
{
|
||||||
|
return Redirect("~/Home/Enter");
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet]
|
ViewBag.Accounts = APICashier.GetRequest<List<AccountViewModel>>("/api/Account/GetAllAccounts");
|
||||||
|
var cashWithdrawals = APICashier.GetRequest<List<CashWithdrawalViewModel>>("api/Account/FindAllCashWithdrawal").Where(x => x.AccountId == int.Parse(accountId))
|
||||||
|
.Select(x => new ReportCashierAccountsViewModel
|
||||||
|
{
|
||||||
|
CashierSurname = x.SurmaneCashier,
|
||||||
|
Sum = x.Sum,
|
||||||
|
AccountSenderNumber = x.AccountNumber,
|
||||||
|
DateOperation = x.DateOperation,
|
||||||
|
typeOperation = TypeOperationEnum.Снятие
|
||||||
|
});
|
||||||
|
|
||||||
|
var moneyTransfers = APICashier.GetRequest<List<MoneyTransferViewModel>>("/api/Account/FindAllMoneyTransfer").Where(x => (x.AccountPayeeId == int.Parse(accountId) || x.AccountSenderId == int.Parse(accountId)))
|
||||||
|
.Select(x => new ReportCashierAccountsViewModel
|
||||||
|
{
|
||||||
|
CashierSurname = x.CashierSurname,
|
||||||
|
Sum = x.Sum,
|
||||||
|
AccountPayeeNumber = x.AccountPayeeNumber,
|
||||||
|
AccountSenderNumber = x.AccountSenderNumber,
|
||||||
|
DateOperation = x.DateOperation,
|
||||||
|
typeOperation = x.AccountSenderId.HasValue ? TypeOperationEnum.Перевод : TypeOperationEnum.Пополнение
|
||||||
|
});
|
||||||
|
return View(cashWithdrawals.Concat(moneyTransfers).OrderBy(x => x.DateOperation).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Получение отчёта PDF
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
public IActionResult CreateReport()
|
public IActionResult CreateReport()
|
||||||
{
|
{
|
||||||
if (APICashier.Cashier == null)
|
if (APICashier.Cashier == null)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
@using BankYouBankruptContracts.ViewModels
|
@using BankYouBankruptContracts.ViewModels
|
||||||
|
|
||||||
@model ReportClientCardsViewModel
|
@model List<ReportCashierAccountsViewModel>?
|
||||||
|
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Отчет по аккаунтам";
|
ViewData["Title"] = "Отчет по аккаунтам";
|
||||||
@ -30,28 +30,50 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
|
||||||
Номер карты
|
|
||||||
</th>
|
|
||||||
<th>
|
<th>
|
||||||
Тип операции
|
Тип операции
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Сумма
|
Кассир
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Статус
|
1 Счет
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Дата открытия
|
2 Счет
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Дата закрытия
|
Сумма операции
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Дата
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@foreach (var item in Model)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.typeOperation)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.CashierSurname)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.AccountSenderNumber)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.AccountPayeeNumber)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Sum)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.DateOperation)
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,12 +43,16 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="MoneyTransfers">Переводы</a>
|
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="MoneyTransfers">Переводы</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="ReportWithAccounts">Отчёт по аккаунтам</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="CreateReport">Отчёт</a>
|
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="CreateReport">Отчёт</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Privacy">Личный кабинет</a>
|
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Privacy">Личный кабинет</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
using System;
|
using BankYouBankruptDataModels.Enums;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -8,8 +10,17 @@ namespace BankYouBankruptContracts.ViewModels
|
|||||||
{
|
{
|
||||||
public class ReportCashierAccountsViewModel
|
public class ReportCashierAccountsViewModel
|
||||||
{
|
{
|
||||||
public List<CheckboxViewModel>? Accounts { get; set; } = new();
|
|
||||||
|
|
||||||
public List<ReportViewModel>? Operations { get; set; } = new();
|
public int Sum { get; set; }
|
||||||
|
|
||||||
|
public string AccountSenderNumber { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string AccountPayeeNumber { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public DateTime DateOperation { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
public string CashierSurname { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public TypeOperationEnum typeOperation { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ namespace BankYouBankruptDataModels.Enums
|
|||||||
{
|
{
|
||||||
Снятие = 1,
|
Снятие = 1,
|
||||||
|
|
||||||
Пополнение = 2
|
Пополнение = 2,
|
||||||
|
|
||||||
|
Перевод = 3,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,8 +156,36 @@ namespace BankYouBankruptRestApi.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//найти все открытые заявки на снятие средств
|
[HttpGet]
|
||||||
[HttpGet]
|
public List<CashWithdrawalViewModel>? FindAllCashWithdrawal()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return _cashLogic.ReadList(null);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка входа в систему");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public List<MoneyTransferViewModel>? FindAllMoneyTransfer()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return _moneyTransferLogic.ReadList(null);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка входа в систему");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//найти все открытые заявки на снятие средств
|
||||||
|
[HttpGet]
|
||||||
public List<DebitingViewModel>? FindOpenDebiting()
|
public List<DebitingViewModel>? FindOpenDebiting()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
Loading…
Reference in New Issue
Block a user