|
|
@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Application.Dtos; |
|
|
|
using Volo.Abp.Domain.Entities; |
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
|
using Win_in.Sfs.Shared.Domain; |
|
|
|
using Win_in.Sfs.Shared.Event; |
|
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
@ -25,13 +26,14 @@ public class InjectionIssueNoteAppService : |
|
|
|
IInjectionIssueNoteAppService |
|
|
|
{ |
|
|
|
private readonly IInjectionIssueNoteManager _injectionIssueNoteManager; |
|
|
|
private readonly ILocationAppService _locationAppService; |
|
|
|
|
|
|
|
public InjectionIssueNoteAppService( |
|
|
|
IInjectionIssueNoteRepository repository, |
|
|
|
IInjectionIssueNoteManager injectionIssueNoteManager |
|
|
|
) : base(repository) |
|
|
|
IInjectionIssueNoteManager injectionIssueNoteManager, ILocationAppService locationAppService) : base(repository) |
|
|
|
{ |
|
|
|
_injectionIssueNoteManager = injectionIssueNoteManager; |
|
|
|
_locationAppService = locationAppService; |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("")] |
|
|
@ -39,6 +41,24 @@ public class InjectionIssueNoteAppService : |
|
|
|
public override async Task<InjectionIssueNoteDTO> CreateAsync(InjectionIssueNoteEditInput input) |
|
|
|
{ |
|
|
|
var entity = ObjectMapper.Map<InjectionIssueNoteEditInput, InjectionIssueNote>(input); |
|
|
|
|
|
|
|
foreach (var detail in entity.Details) |
|
|
|
{ |
|
|
|
var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
detail.HandledFromLocationArea = fromLocationDto.AreaCode; |
|
|
|
detail.HandledFromLocationGroup = fromLocationDto.LocationGroupCode; |
|
|
|
detail.HandledFromLocationErpCode = fromLocationDto.ErpLocationCode; |
|
|
|
detail.HandledFromWarehouseCode = fromLocationDto.WarehouseCode; |
|
|
|
|
|
|
|
detail.HandledToLocationArea = toLocationDto.AreaCode; |
|
|
|
detail.HandledToLocationGroup = toLocationDto.LocationGroupCode; |
|
|
|
detail.HandledToLocationErpCode = toLocationDto.ErpLocationCode; |
|
|
|
detail.HandledToWarehouseCode = toLocationDto.WarehouseCode; |
|
|
|
} |
|
|
|
|
|
|
|
await _injectionIssueNoteManager.CreateAsync(entity).ConfigureAwait(false); |
|
|
|
var dto = ObjectMapper.Map<InjectionIssueNote, InjectionIssueNoteDTO>(entity); |
|
|
|
return dto; |
|
|
|