diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs index 43fc043db..d1ed0e792 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs @@ -166,7 +166,7 @@ public class EosAgentModule : AbpModule { context.AddBackgroundWorkerAsync(); - context.AddBackgroundWorkerAsync(); + //context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs index e526956e1..10b785717 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs @@ -9,6 +9,7 @@ using Win_in.Sfs.Wms.DataExchange.WMS.ItemPack; using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseOrder; using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReceipt; using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReturn; +using Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote; using Win_in.Sfs.Wms.DataExchange.WMS.SuppplierAsn; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -23,6 +24,9 @@ public class FawtygAutoMapperProfile : Profile CreateMap(); CreateMap(); + CreateMap(); + CreateMap(); + CreateMap() .Ignore(x => x.Detail); CreateMap(); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs index 8b13c38dd..48f9cbd07 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs @@ -35,13 +35,13 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase return; } - Logger.LogInformation($"Read Plan"); - var planReader = workerContext.ServiceProvider.GetRequiredService(); - var planConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保存Plan - var plansFromExternalList = await planReader.ReadAsync().ConfigureAwait(false); - //转换Plan - await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false); + //Logger.LogInformation($"Read Plan"); + //var planReader = workerContext.ServiceProvider.GetRequiredService(); + //var planConverter = workerContext.ServiceProvider.GetRequiredService(); + ////读取并保存Plan + //var plansFromExternalList = await planReader.ReadAsync().ConfigureAwait(false); + ////转换Plan + //await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false); Logger.LogInformation($"Read Ship"); var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); @@ -51,13 +51,13 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase //转换Ship await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); - Logger.LogInformation($"Read Product"); - var productHandleService = workerContext.ServiceProvider.GetRequiredService(); - var productConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保持Product - var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); - // 转换Product - await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); + //Logger.LogInformation($"Read Product"); + //var productHandleService = workerContext.ServiceProvider.GetRequiredService(); + //var productConverter = workerContext.ServiceProvider.GetRequiredService(); + ////读取并保持Product + //var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); + //// 转换Product + //await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); Logger.LogInformation($"Completed: Handling {Incoming}"); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs index 599879719..40b357a52 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs @@ -5,13 +5,16 @@ using System.Text.Json; using System.Threading.Tasks; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; +using Volo.Abp.Data; using Volo.Abp.ObjectMapping; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Label.Application.Contracts; +using Win_in.Sfs.Label.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.WMS.SuppplierAsn; using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; @@ -24,6 +27,9 @@ public class ShipConverter : IIncomingConverter private readonly IItemPackAppService _itemPackAppService; private readonly ILogger _logger; private readonly IConfiguration _configuration; + private readonly ISupplierAppService _supplierAppService; + private readonly ISupplierItemAppService _supplierItemAppService; + public ShipConverter( IIncomingToWmsManager incomingToWmsManager , IObjectMapper objectMapper @@ -31,8 +37,9 @@ public class ShipConverter : IIncomingConverter , IItemPackAppService itemPackAppService , ILogger logger, IConfiguration configuration, - IIncomingFromExternalManager incomingFromExternalManager - ) + IIncomingFromExternalManager incomingFromExternalManager, + ISupplierAppService supplierAppService, + ISupplierItemAppService supplierItemAppService) { _incomingFromExternalManager = incomingFromExternalManager; _incomingToWmsManager = incomingToWmsManager; @@ -41,6 +48,8 @@ public class ShipConverter : IIncomingConverter _itemPackAppService = itemPackAppService; _logger = logger; _configuration = configuration; + _supplierAppService = supplierAppService; + _supplierItemAppService = supplierItemAppService; } public virtual async Task ConvertAsync(List incomingFromExternalList) @@ -95,13 +104,55 @@ public class ShipConverter : IIncomingConverter { purchaseLabel.ItemName = item.Name; purchaseLabel.ItemDesc1 = item.Desc1; - + purchaseLabel.Uom = item.BasicUom; + purchaseLabel.ItemDesc2 = item.Desc2; } else { purchaseLabel.ItemName = ""; purchaseLabel.ItemDesc1 = ""; + purchaseLabel.Uom = ""; + purchaseLabel.ItemDesc2 = ""; } + purchaseLabel.LabelType = EnumLabelType.PurchaseLabel; + var supplierDto = await _supplierAppService.GetByCodeAsync(exchangeAsn.SupplierCode).ConfigureAwait(false); + purchaseLabel.SupplierCode = exchangeAsn.SupplierCode; + purchaseLabel.PoNumber = exchangeAsn.PoNumber; + purchaseLabel.Qty = exchangeAsn.Detail.Qty; + + var supplierItemDTO=await _supplierItemAppService.GetBySupplierCodeAndItemCodeAsync(exchangeAsn.SupplierCode, purchaseLabel.ItemCode).ConfigureAwait(false); + + purchaseLabel.ProduceDate = exchangeAsn.Detail.ProduceDate; + purchaseLabel.ArriveDate = exchangeAsn.Detail.ArriveDate; + purchaseLabel.FullBarcodeString = exchangeAsn.Detail.PackingCode; + purchaseLabel.LocationErpCode = exchangeAsn.Detail.LocationErpCode; + purchaseLabel.Lot = exchangeAsn.Detail.Lot; + purchaseLabel.RecommendLocationCode = exchangeAsn.Detail.LocationErpCode; + purchaseLabel.Remark = exchangeAsn.Detail.Remark; + purchaseLabel.Code = exchangeAsn.Detail.PackingCode; + purchaseLabel.PlanArriveDate = exchangeAsn.PlanArriveDate; + + purchaseLabel.SupplierItemCode = supplierItemDTO.SupplierItemCode; + purchaseLabel.SupplierItemName = supplierItemDTO.ItemName; + + + purchaseLabel.ExpireDate = DateTime.Now.AddDays(item.GetValidateDays()); + purchaseLabel.ExtraProperties = new ExtraPropertyDictionary(); + purchaseLabel.LabelStatus = LabelStatus.Enable; + purchaseLabel.Specifications = item.Color; + purchaseLabel.StdPackQty = item.StdPackQty; + purchaseLabel.SupplierName = supplierDto.Name; + purchaseLabel.SupplierSimpleName = supplierDto.ShortName; + purchaseLabel.Team = string.Empty; + purchaseLabel.ProdLine = string.Empty; + purchaseLabel.QLevel = string.Empty; + purchaseLabel.QualityFile = string.Empty; + purchaseLabel.Shift = string.Empty; + purchaseLabel.ContainerCode = string.Empty; + + purchaseLabel.RpNumber = string.Empty; + purchaseLabel.SupplierBatch = string.Empty; + return purchaseLabel; } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs index 0448cbeec..14f5e1a74 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs @@ -149,8 +149,8 @@ public static class IncomingToWmsExtensions public static async Task HandleInventoryLabelsAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext) { var inventoryLabel = JsonSerializer.Deserialize(incomingConverted.DataContent); - var inventoryLabelAppService = workerContext.ServiceProvider.GetRequiredService(); - await inventoryLabelAppService.CreateAsync(inventoryLabel).ConfigureAwait(false); + var inventoryLabelAppService = workerContext.ServiceProvider.GetRequiredService(); + await inventoryLabelAppService.CreateManyByNoCodeAsync(new List { inventoryLabel }).ConfigureAwait(false); } public static async Task HandleBackFlushsAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext) { diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/OutgoingToExternal/OutgoingToExternalManager.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/OutgoingToExternal/OutgoingToExternalManager.cs index 2fa873f15..a2b7393d9 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/OutgoingToExternal/OutgoingToExternalManager.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/OutgoingToExternal/OutgoingToExternalManager.cs @@ -53,7 +53,7 @@ public class OutgoingToExternalManager : DomainService, IOutgoingToExternalManag public virtual async Task ArchiveManyAsync(List entities) { - var archivedEntities = _objectMapper.Map, List>(entities); + var archivedEntities = _objectMapper.Map, List>(entities); await _archiveRepository.InsertManyAsync(archivedEntities).ConfigureAwait(false); await _repository.DeleteManyAsync(entities).ConfigureAwait(false);