出入库回退上下架
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -8,6 +9,7 @@ using System.Threading.Tasks;
|
||||
using WMS.Web.Core;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Repositories.Configuration;
|
||||
@@ -88,5 +90,33 @@ namespace WMS.Web.Repositories
|
||||
response.Data = list;
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<BackRecord> Add(BackRecord entity, bool isTransaction = true)
|
||||
{
|
||||
IDbContextTransaction _transaction = null;
|
||||
if (isTransaction)
|
||||
_transaction = _context.Database.BeginTransaction();
|
||||
try
|
||||
{
|
||||
await _context.BackRecord.AddAsync(entity);
|
||||
await _context.SaveChangesAsync();
|
||||
if (_transaction != null)
|
||||
_transaction.Commit();
|
||||
return entity;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_transaction != null)
|
||||
_transaction.Rollback();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,6 +233,8 @@ namespace WMS.Web.Repositories.DependencyInjection
|
||||
Services.AddTransient<IHttpClientService, HttpClientService>();
|
||||
Services.AddTransient<ISingleDataService, SingleDataService>();
|
||||
Services.AddTransient<IErpService, ErpService>();
|
||||
Services.AddTransient<IBackRecordService, BackRecordService>();
|
||||
|
||||
|
||||
Services.AddTransient<IChangeMoveBoxService, ChangeMoveBoxService>();
|
||||
Services.AddTransient<ITakeStockService, TakeStockService>();
|
||||
|
||||
Reference in New Issue
Block a user