|
|
@ -2,14 +2,9 @@ using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Text.Json; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel; |
|
|
|
using DocumentFormat.OpenXml.Presentation; |
|
|
|
using Microsoft.AspNetCore.Identity; |
|
|
|
using Nito.AsyncEx; |
|
|
|
using Volo.Abp.Identity; |
|
|
|
using Volo.Abp.ObjectMapping; |
|
|
|
using Volo.Abp.Users; |
|
|
|
using Win_in.Sfs.Auth.Application.Contracts; |
|
|
|
using Win_in.Sfs.Auth.Users; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.Domain; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; |
|
|
@ -25,21 +20,20 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter |
|
|
|
private readonly IOutgoingToExternalManager _outgoingToExternalManager; |
|
|
|
private readonly IDepartmentAppService _departmentAppService; |
|
|
|
private readonly IObjectMapper _objectMapper; |
|
|
|
private readonly IIdentityUserAppService identityUserAppService; |
|
|
|
private readonly ISfsUserAppService _sfsUserAppService; |
|
|
|
|
|
|
|
public UnplannedIssueNoteConverter( |
|
|
|
IOutgoingFromWmsManager outgoingFromWmsManager |
|
|
|
, IOutgoingToExternalManager outgoingToExternalManager |
|
|
|
, IDepartmentAppService departmentAppService |
|
|
|
, IObjectMapper objectMapper |
|
|
|
, |
|
|
|
IIdentityUserAppService identityUserAppService) |
|
|
|
, ISfsUserAppService sfsUserAppService) |
|
|
|
{ |
|
|
|
_outgoingFromWmsManager = outgoingFromWmsManager; |
|
|
|
_outgoingToExternalManager = outgoingToExternalManager; |
|
|
|
_departmentAppService = departmentAppService; |
|
|
|
_objectMapper = objectMapper; |
|
|
|
this.identityUserAppService = identityUserAppService; |
|
|
|
_sfsUserAppService = sfsUserAppService; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -60,10 +54,10 @@ IIdentityUserAppService identityUserAppService) |
|
|
|
var departmentCode = department == null ? "" : department.Code; |
|
|
|
if (Guid.TryParse(exchangeReceipt.CreatorId.ToString(), out Guid guid)) |
|
|
|
{ |
|
|
|
var user = await identityUserAppService.GetAsync(guid).ConfigureAwait(false); |
|
|
|
if(user != null) |
|
|
|
var username = await _sfsUserAppService.GetUserNameById(guid).ConfigureAwait(false); |
|
|
|
if (string.IsNullOrEmpty(username)) |
|
|
|
{ |
|
|
|
exchangeReceipt.Worker = user.UserName; |
|
|
|
exchangeReceipt.Worker = username; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -124,8 +118,8 @@ IIdentityUserAppService identityUserAppService) |
|
|
|
/// </summary>
|
|
|
|
/// <param name="exchangeOrder"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
private Wmsoutm BuildDataInterface(UnplannedIssueNoteExchangeDto exchangeOrder) |
|
|
|
{ |
|
|
|
private Wmsoutm BuildDataInterface(UnplannedIssueNoteExchangeDto exchangeOrder) |
|
|
|
{ |
|
|
|
var ret = new Wmsoutm() |
|
|
|
{ |
|
|
|
wmsoutm_nbr = exchangeOrder.Number, |
|
|
|