lvzb 2 years ago
parent
commit
7ee6ac620e
  1. 1
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/Users/ISfsUserAppService.cs
  2. 10
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Users/SfsUserAppService.cs
  3. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/UnplannedIssuesNotes/UnplannedIssueNoteAppService.cs
  4. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteAppService.cs
  5. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/UnplannedIssueNoteEventHandler.cs

1
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/Users/ISfsUserAppService.cs

@ -14,4 +14,5 @@ public interface ISfsUserAppService : IApplicationService
Task<IdentityUserDto> UpdateIsActiveAsync(Guid id, bool isActive);
Task<string> GetUserNameByUserAsync(string worker);
}

10
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Users/SfsUserAppService.cs

@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using IdentityModel;
using Microsoft.AspNetCore.Authorization;
@ -94,6 +95,15 @@ public class SfsUserAppService : ApplicationService, ISfsUserAppService
return username;
}
[HttpPost("get-username-by-user")]
public virtual async Task<string> GetUserNameByUserAsync(string worker)
{
var userList = await _userRepository.GetListAsync().ConfigureAwait(false);
var userEntity = userList.First(p => p.Name == worker);
return userEntity.UserName;
}
/// <summary>
/// 修改密码
/// </summary>

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/UnplannedIssuesNotes/UnplannedIssueNoteAppService.cs

@ -1,7 +1,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Identity;
using Volo.Abp.Users;
using Win_in.Sfs.Auth.Users;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Wms.Inventory.Domain;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -19,11 +25,13 @@ public class UnplannedIssueNoteAppService :
IUnplannedIssueNoteAppService
{
private readonly IUnplannedIssueNoteManager _unplannedIssueNoteManager;
private readonly ISfsUserAppService _userAppService;
public UnplannedIssueNoteAppService(IUnplannedIssueNoteRepository repository,
IUnplannedIssueNoteManager unplannedIssueNoteManager) : base(repository)
IUnplannedIssueNoteManager unplannedIssueNoteManager, ISfsUserAppService userAppService) : base(repository)
{
_unplannedIssueNoteManager = unplannedIssueNoteManager;
_userAppService = userAppService;
}
[HttpPost("")]
@ -41,6 +49,9 @@ public class UnplannedIssueNoteAppService :
detail.ExtraProperties = inputDetail.ExtraProperties;
entity.Details.Add(detail);
//2023-10-20 袁静雯要求修改计划外出入库 Worker为userName
var userName = await _userAppService.GetUserNameByUserAsync(input.Worker).ConfigureAwait(false);
entity.Worker = userName;
}
await _unplannedIssueNoteManager.CreateAsync(entity).ConfigureAwait(false);

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteAppService.cs

@ -1,6 +1,8 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Win_in.Sfs.Auth.Users;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
@ -9,6 +11,8 @@ using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application;
using System.Collections.Generic;
using Volo.Abp.Identity;
using Volo.Abp.Users;
/// <summary>
/// 计划外入库记录
@ -21,14 +25,14 @@ public class UnplannedReceiptNoteAppService :
IUnplannedReceiptNoteAppService
{
private readonly IUnplannedReceiptNoteManager _unplannedReceiptNoteManager;
private readonly ILocationCapacityAppService _locationCapacityAppService;
private readonly ISfsUserAppService _userAppService;
public UnplannedReceiptNoteAppService(IUnplannedReceiptNoteRepository repository,
IUnplannedReceiptNoteManager unplannedReceiptNoteManager,
ILocationCapacityAppService locationCapacityAppService) : base(repository)
ISfsUserAppService userAppService) : base(repository)
{
_unplannedReceiptNoteManager = unplannedReceiptNoteManager;
_locationCapacityAppService = locationCapacityAppService;
_userAppService = userAppService;
}
[HttpPost("")]
@ -45,7 +49,8 @@ public class UnplannedReceiptNoteAppService :
detail.ExtraProperties = inputDetail.ExtraProperties;
entity.Details.Add(detail);
var userName = await _userAppService.GetUserNameByUserAsync(input.Worker).ConfigureAwait(false);
entity.Worker = userName;
}
await _unplannedReceiptNoteManager.CreateAsync(entity).ConfigureAwait(false);

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/UnplannedIssueNoteEventHandler.cs

@ -3,6 +3,7 @@ using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Volo.Abp.Users;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;

Loading…
Cancel
Save