| | | 1 | | using Microsoft.AspNetCore.Mvc; |
| | | 2 | | using OzonDomains; |
| | | 3 | | using OzonDomains.Models; |
| | | 4 | | using OzonOrdersWeb.Areas.Studio2.Controllers.Base; |
| | | 5 | | using OzonRepositories.Context; |
| | | 6 | | using Services.CacheServices.Cache.OzonOrdersCache; |
| | | 7 | | using Services.CacheServices.Cache.UserCacheService; |
| | | 8 | | using Services.DataServices; |
| | | 9 | | using OzonOrdersWeb.WebServices.Currency; |
| | | 10 | | using Services.TransactionUtilsServices; |
| | | 11 | | using Services.CacheServices.Cache; |
| | | 12 | | |
| | | 13 | | namespace OzonOrdersWeb.Areas.Studio2.Controllers.Transactions; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Контроллер транзакции "Перемещение" (из возврата покупателя) |
| | | 17 | | /// </summary> |
| | | 18 | | public class ReturnTransferTransactionController : BaseTransactionController |
| | | 19 | | { |
| | | 20 | | public ReturnTransferTransactionController( |
| | | 21 | | ApplicationDbContext context, |
| | | 22 | | AppStatusDataServices appStatusServices, |
| | | 23 | | OrdersDataServices orderServices, |
| | | 24 | | TransactionManager transactionManager, |
| | | 25 | | TransactionCache transactionCache, |
| | | 26 | | SupplierDataServices supplierDataServices, |
| | | 27 | | IUserCacheService userCacheService, |
| | | 28 | | ICurrencyRatesViewBagService currencyRatesViewBagService, |
| | | 29 | | CacheUpdater<Order> cacheUpdater, |
| | | 30 | | OrderCache orderCache, |
| | | 31 | | WarehouseDataServices warehouseDataServices, |
| | | 32 | | ExpenseTypeDataServices expenseTypeDataServices, |
| | | 33 | | OrderExtraExpenseDataServices orderExtraExpenseDataServices, |
| | | 34 | | StatusTransitionDataServices statusTransitionDataServices) |
| | 0 | 35 | | : base(context, appStatusServices, orderServices, transactionManager, transactionCache, |
| | 0 | 36 | | supplierDataServices, userCacheService, currencyRatesViewBagService, cacheUpdater, orderCache, |
| | 0 | 37 | | warehouseDataServices: warehouseDataServices, expenseTypeDataServices: expenseTypeDataServices, |
| | 0 | 38 | | orderExtraExpenseDataServices: orderExtraExpenseDataServices, |
| | 0 | 39 | | statusTransitionDataServices: statusTransitionDataServices) |
| | | 40 | | { |
| | 0 | 41 | | } |
| | | 42 | | |
| | 0 | 43 | | protected override TransactionConfig GetTransactionConfig() => new() |
| | 0 | 44 | | { |
| | 0 | 45 | | TransactionType = TransactionType.ReturnTransfer, |
| | 0 | 46 | | PrimaryStatusName = "Перемещение", |
| | 0 | 47 | | UseStatusTransitions = false, |
| | 0 | 48 | | ViewName = "CreateReturnTransferTransaction", |
| | 0 | 49 | | IncludeCancelledOrders = false, |
| | 0 | 50 | | OrderFilter = order => order.AppStatus?.Name is "Возврат покупателя", |
| | 0 | 51 | | CreateTransactionMethod = (tm, orders, userName, createAt, comment) => |
| | 0 | 52 | | tm.CreateReturnTransferTransaction(orders, userName, createAt, comment) |
| | 0 | 53 | | }; |
| | | 54 | | |
| | | 55 | | public Task<IActionResult> CreateReturnTransferTransaction(string ids, int page) |
| | 0 | 56 | | => CreateTransactionBase(ids, page); |
| | | 57 | | |
| | | 58 | | [HttpPost] |
| | | 59 | | [ValidateAntiForgeryToken] |
| | | 60 | | public Task<IActionResult> CreateReturnTransferTransaction( |
| | | 61 | | List<Order> orders, string userName, string? comment, |
| | | 62 | | int page, string? deletedOrders, Dictionary<int, string?>? orderSupplierMap) |
| | 0 | 63 | | => CreateTransactionPostBase(orders, userName, comment, page, deletedOrders, orderSupplierMap); |
| | | 64 | | } |