|
@ -6,9 +6,11 @@ using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
using Volo.Abp; |
|
|
using Volo.Abp; |
|
|
using Win_in.Sfs.Label.Application.Contracts; |
|
|
using Win_in.Sfs.Label.Application.Contracts; |
|
|
using Win_in.Sfs.Shared.Application.Contracts; |
|
|
using Win_in.Sfs.Shared.Application.Contracts; |
|
|
|
|
|
using Win_in.Sfs.Shared.Domain; |
|
|
using Win_in.Sfs.Shared.Domain.Shared; |
|
|
using Win_in.Sfs.Shared.Domain.Shared; |
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
using Win_in.Sfs.Wms.Store.Domain; |
|
|
using Win_in.Sfs.Wms.Store.Domain; |
|
@ -57,6 +59,41 @@ public class ItemTransformRequestAppService : |
|
|
return dto; |
|
|
return dto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected override async Task<Dictionary<ItemTransformRequest, EntityState>> ImportProcessingEntityAsync(Dictionary<ItemTransformRequest, EntityState> dictionary) |
|
|
|
|
|
{ |
|
|
|
|
|
var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var itemTransformRequest in addList) |
|
|
|
|
|
{ |
|
|
|
|
|
itemTransformRequest.Worker = CurrentUser.GetUserName(); |
|
|
|
|
|
itemTransformRequest.CreatorId = CurrentUser.Id; |
|
|
|
|
|
foreach (var detail in itemTransformRequest.Details) |
|
|
|
|
|
{ |
|
|
|
|
|
var fromLocationDto= await LocationAclService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); |
|
|
|
|
|
var toLocationDto= await LocationAclService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); |
|
|
|
|
|
var itemBasicDto=await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
detail.FromLocationArea = fromLocationDto.AreaCode; |
|
|
|
|
|
detail.FromLocationErpCode = fromLocationDto.ErpLocationCode; |
|
|
|
|
|
detail.FromLocationGroup = fromLocationDto.LocationGroupCode; |
|
|
|
|
|
detail.FromWarehouseCode = fromLocationDto.WarehouseCode; |
|
|
|
|
|
|
|
|
|
|
|
detail.ToLocationArea = toLocationDto.AreaCode; |
|
|
|
|
|
detail.ToLocationErpCode = toLocationDto.ErpLocationCode; |
|
|
|
|
|
detail.ToLocationGroup = toLocationDto.LocationGroupCode; |
|
|
|
|
|
detail.ToWarehouseCode = toLocationDto.WarehouseCode; |
|
|
|
|
|
detail.ItemDesc1 = itemBasicDto.Desc1; |
|
|
|
|
|
detail.ItemDesc2= itemBasicDto.Desc2; |
|
|
|
|
|
detail.ItemName= itemBasicDto.Name; |
|
|
|
|
|
detail.Uom = itemBasicDto.BasicUom; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return dictionary; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected virtual async Task ImportDataAsync(List<ItemTransformRequest> entites, List<ItemTransformRequest> deleteEntities) |
|
|
protected virtual async Task ImportDataAsync(List<ItemTransformRequest> entites, List<ItemTransformRequest> deleteEntities) |
|
|
{ |
|
|
{ |
|
|
await _manager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); |
|
|
await _manager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); |
|
|