Browse Source

接口修改

集成Redis
唐明亮 2 years ago
parent
commit
9d60c4693a
  1. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs
  2. 4
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs
  3. 28
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
  4. 57
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs
  5. 2
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs
  6. 2
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/OutgoingToExternal/OutgoingToExternalManager.cs

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs

@ -166,7 +166,7 @@ public class EosAgentModule : AbpModule
{ {
context.AddBackgroundWorkerAsync<EosIncomingBackgroundWorker>(); context.AddBackgroundWorkerAsync<EosIncomingBackgroundWorker>();
context.AddBackgroundWorkerAsync<EosOutgoingBackgroundWorker>(); //context.AddBackgroundWorkerAsync<EosOutgoingBackgroundWorker>();
} }
} }

4
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.PurchaseOrder;
using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReceipt; using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReceipt;
using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReturn; 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.DataExchange.WMS.SuppplierAsn;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -23,6 +24,9 @@ public class FawtygAutoMapperProfile : Profile
CreateMap<OutgoingFromWms, ArchivedOutgoingFromWms>(); CreateMap<OutgoingFromWms, ArchivedOutgoingFromWms>();
CreateMap<OutgoingToExternal, ArchivedOutgoingToExternal>(); CreateMap<OutgoingToExternal, ArchivedOutgoingToExternal>();
CreateMap<PutawayNoteDTO, PutawayNoteExchangeDto>();
CreateMap<PutawayNoteDetailDTO, PutawayNoteDetailExchangeDto>();
CreateMap<PurchaseReceiptNoteDTO, PurchaseReceiptNoteExchangeDto>() CreateMap<PurchaseReceiptNoteDTO, PurchaseReceiptNoteExchangeDto>()
.Ignore(x => x.Detail); .Ignore(x => x.Detail);
CreateMap<PurchaseReceiptNoteDetailDTO, PurchaseReceiptNoteDetailExchangeDto>(); CreateMap<PurchaseReceiptNoteDetailDTO, PurchaseReceiptNoteDetailExchangeDto>();

28
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs

@ -35,13 +35,13 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
return; return;
} }
Logger.LogInformation($"Read Plan"); //Logger.LogInformation($"Read Plan");
var planReader = workerContext.ServiceProvider.GetRequiredService<PlanReader>(); //var planReader = workerContext.ServiceProvider.GetRequiredService<PlanReader>();
var planConverter = workerContext.ServiceProvider.GetRequiredService<PlanConverter>(); //var planConverter = workerContext.ServiceProvider.GetRequiredService<PlanConverter>();
//读取并保存Plan ////读取并保存Plan
var plansFromExternalList = await planReader.ReadAsync().ConfigureAwait(false); //var plansFromExternalList = await planReader.ReadAsync().ConfigureAwait(false);
//转换Plan ////转换Plan
await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false); //await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Ship"); Logger.LogInformation($"Read Ship");
var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>(); var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>();
@ -51,13 +51,13 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//转换Ship //转换Ship
await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Product"); //Logger.LogInformation($"Read Product");
var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>(); //var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>();
var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>(); //var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>();
//读取并保持Product ////读取并保持Product
var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); //var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false);
// 转换Product //// 转换Product
await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); //await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Completed: Handling {Incoming}"); Logger.LogInformation($"Completed: Handling {Incoming}");
} }

57
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 System.Threading.Tasks;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Volo.Abp.Data;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Label.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;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.WMS.SuppplierAsn; using Win_in.Sfs.Wms.DataExchange.WMS.SuppplierAsn;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
@ -24,6 +27,9 @@ public class ShipConverter : IIncomingConverter
private readonly IItemPackAppService _itemPackAppService; private readonly IItemPackAppService _itemPackAppService;
private readonly ILogger<ShipConverter> _logger; private readonly ILogger<ShipConverter> _logger;
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
private readonly ISupplierAppService _supplierAppService;
private readonly ISupplierItemAppService _supplierItemAppService;
public ShipConverter( public ShipConverter(
IIncomingToWmsManager incomingToWmsManager IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper , IObjectMapper objectMapper
@ -31,8 +37,9 @@ public class ShipConverter : IIncomingConverter
, IItemPackAppService itemPackAppService , IItemPackAppService itemPackAppService
, ILogger<ShipConverter> logger, , ILogger<ShipConverter> logger,
IConfiguration configuration, IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager IIncomingFromExternalManager incomingFromExternalManager,
) ISupplierAppService supplierAppService,
ISupplierItemAppService supplierItemAppService)
{ {
_incomingFromExternalManager = incomingFromExternalManager; _incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
@ -41,6 +48,8 @@ public class ShipConverter : IIncomingConverter
_itemPackAppService = itemPackAppService; _itemPackAppService = itemPackAppService;
_logger = logger; _logger = logger;
_configuration = configuration; _configuration = configuration;
_supplierAppService = supplierAppService;
_supplierItemAppService = supplierItemAppService;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -95,13 +104,55 @@ public class ShipConverter : IIncomingConverter
{ {
purchaseLabel.ItemName = item.Name; purchaseLabel.ItemName = item.Name;
purchaseLabel.ItemDesc1 = item.Desc1; purchaseLabel.ItemDesc1 = item.Desc1;
purchaseLabel.Uom = item.BasicUom;
purchaseLabel.ItemDesc2 = item.Desc2;
} }
else else
{ {
purchaseLabel.ItemName = ""; purchaseLabel.ItemName = "";
purchaseLabel.ItemDesc1 = ""; 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; return purchaseLabel;
} }

2
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs

@ -150,7 +150,7 @@ public static class IncomingToWmsExtensions
{ {
var inventoryLabel = JsonSerializer.Deserialize<InventoryLabelEditInput>(incomingConverted.DataContent); var inventoryLabel = JsonSerializer.Deserialize<InventoryLabelEditInput>(incomingConverted.DataContent);
var inventoryLabelAppService = workerContext.ServiceProvider.GetRequiredService<IInventoryLabelAppService>(); var inventoryLabelAppService = workerContext.ServiceProvider.GetRequiredService<IInventoryLabelAppService>();
await inventoryLabelAppService.CreateAsync(inventoryLabel).ConfigureAwait(false); await inventoryLabelAppService.CreateManyByNoCodeAsync(new List<InventoryLabelEditInput> { inventoryLabel }).ConfigureAwait(false);
} }
public static async Task HandleBackFlushsAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext) public static async Task HandleBackFlushsAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext)
{ {

2
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<OutgoingToExternal> entities) public virtual async Task ArchiveManyAsync(List<OutgoingToExternal> entities)
{ {
var archivedEntities = _objectMapper.Map<List<OutgoingToExternal>, List<ArchivedOutgoingToExternal>>(entities); var archivedEntities = _objectMapper.Map<List<OutgoingToExternal>, List<ArchivedOutgoingToExternal>>(entities);
await _archiveRepository.InsertManyAsync(archivedEntities).ConfigureAwait(false); await _archiveRepository.InsertManyAsync(archivedEntities).ConfigureAwait(false);
await _repository.DeleteManyAsync(entities).ConfigureAwait(false); await _repository.DeleteManyAsync(entities).ConfigureAwait(false);

Loading…
Cancel
Save