物料收发明细加入操作人
This commit is contained in:
@@ -918,6 +918,11 @@
|
||||
操作时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.InventoryInOutDetails.Create(System.Int32)">
|
||||
<summary>
|
||||
创建
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Entitys.MoveBoxRecord">
|
||||
<summary>
|
||||
wms移箱记录
|
||||
@@ -2081,6 +2086,11 @@
|
||||
公司Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Infrastructure.ILoginRepositories.StaffId">
|
||||
<summary>
|
||||
员工ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.IMoveBoxRecordRepositories.AddRange(System.Collections.Generic.List{WMS.Web.Domain.Entitys.MoveBoxRecord},System.Boolean)">
|
||||
批量添加
|
||||
</member>
|
||||
|
||||
@@ -70,5 +70,14 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建
|
||||
/// </summary>
|
||||
public void Create(int staffId)
|
||||
{
|
||||
this.CreatorId = staffId;
|
||||
this.CreateTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,10 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// 公司Id
|
||||
/// </summary>
|
||||
int CompanyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工ID
|
||||
/// </summary>
|
||||
int StaffId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Domain.Services.Public;
|
||||
using WMS.Web.Domain.Values;
|
||||
|
||||
namespace WMS.Web.Domain.Services
|
||||
@@ -19,16 +21,19 @@ namespace WMS.Web.Domain.Services
|
||||
public class InventoryInOutDetailsService: IInventoryInOutDetailsService
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly ILoginRepositories _loginRepositories;
|
||||
private readonly IBoxRepositories _boxRepositories;
|
||||
private readonly ISerialNumbersRepositories _serialNumbersRepositories;
|
||||
private readonly IInventoryDetailsRepositories _inventoryDetailsRepositories;
|
||||
private readonly IInventoryInOutDetailsRepositories _inventoryInOutDetailsRepositories;
|
||||
public InventoryInOutDetailsService(IMapper mapper, IBoxRepositories boxRepositories,
|
||||
ILoginRepositories loginRepositories,
|
||||
ISerialNumbersRepositories serialNumbersRepositories,
|
||||
IInventoryDetailsRepositories inventoryDetailsRepositories,
|
||||
IInventoryInOutDetailsRepositories inventoryInOutDetailsRepositories)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_loginRepositories = loginRepositories;
|
||||
_boxRepositories = boxRepositories;
|
||||
_inventoryDetailsRepositories = inventoryDetailsRepositories;
|
||||
_serialNumbersRepositories = serialNumbersRepositories;
|
||||
@@ -43,6 +48,7 @@ namespace WMS.Web.Domain.Services
|
||||
/// <returns></returns>
|
||||
public async Task<Result> GenerateInOrOutDetails(List<InventoryInOutDetailsGenerateDto> dtos,bool isTransaction)
|
||||
{
|
||||
|
||||
//找到物料对应的即时库存明细
|
||||
var orgCodes = dtos.Select(x => x.OrgCode).ToList();
|
||||
var materialIds = dtos.Select(x => x.MaterialId).ToList();
|
||||
@@ -66,6 +72,7 @@ namespace WMS.Web.Domain.Services
|
||||
//2.2组装物料收发明细实体
|
||||
var entity = _mapper.Map<InventoryInOutDetails>(dto);
|
||||
entity.SurplusQty = currentDetail == null ? 0 : currentDetail.Qty;
|
||||
entity.Create(_loginRepositories.StaffId);
|
||||
add_entitys.Add(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace WMS.Web.Repositories
|
||||
public class LoginRepositories:ILoginRepositories
|
||||
{
|
||||
public int CompanyId { get; set; } = 0;
|
||||
public int StaffId { get; set; } = 0;
|
||||
private readonly RedisClientService _redisClientService;
|
||||
public LoginRepositories(ILogger<LoginRepositories> logger, IHttpContextAccessor httpContextAccessor, RedisClientService redisClientService)
|
||||
{
|
||||
@@ -29,12 +30,14 @@ namespace WMS.Web.Repositories
|
||||
if (string.IsNullOrEmpty(token))
|
||||
{
|
||||
this.CompanyId = 0;
|
||||
this.StaffId = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
_redisClientService = redisClientService;
|
||||
var logininfo = _redisClientService.GetStringKey<LoginInDto>($"wms_login_{token}");
|
||||
this.CompanyId = logininfo == null ? 0 : logininfo.UserInfo.CompanyId;
|
||||
this.StaffId = logininfo == null ? 0 : logininfo.UserInfo.StaffId;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user