From 59f8744466de6c99b9595a8fe48c441ff196a51c Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Sat, 6 May 2023 10:09:27 +0800 Subject: [PATCH] =?UTF-8?q?EOS=E9=AA=8C=E6=94=B6=E5=8D=95=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Outgoing/ArriveConverter.cs | 16 +++++++++++++++- .../Outgoing/ArriveNoteWriter.cs | 5 ++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs index 207931f9a..e3f5cbadb 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs @@ -21,13 +21,13 @@ public class ArriveConverter : IOutgoingConverter private readonly IObjectMapper _objectMapper; private readonly IInventoryLabelAppService _inventoryLabelAppService; - public ArriveConverter( IOutgoingFromWmsManager outgoingFromWmsManager , IOutgoingToExternalManager outgoingToExternalManager , ISupplierAsnAppService supplierAsnAppService , IObjectMapper objectMapper , IInventoryLabelAppService inventoryLabelAppService + ) { _inventoryLabelAppService = inventoryLabelAppService; @@ -71,6 +71,20 @@ public class ArriveConverter : IOutgoingConverter { arrive.ShipBillNo = label.AsnNumber; } + try + { + //通过发货单号获取发货时间 + var supplierAsnDTO=await _supplierAsnAppService.GetByNumberAsync(label.AsnNumber).ConfigureAwait(false); + if (supplierAsnDTO != null) + { + arrive.ShipDate = supplierAsnDTO.ShipDate; + } + } + catch (Exception ex) + { + outgoingToExternal.SetError(EnumExchangeDataErrorCode.Exception, ex.InnerException == null ? ex.Message : ex.InnerException.Message, ex.ToString()); + } + outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); outgoingToExternalList.Add(outgoingToExternal); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveNoteWriter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveNoteWriter.cs index d31e68eb1..a513f50f5 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveNoteWriter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveNoteWriter.cs @@ -1,8 +1,10 @@ using System.Collections.Generic; +using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; +using Win_in.Sfs.Wms.DataExchange.Domain.Shared; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; @@ -21,7 +23,8 @@ public class ArriveNoteWriter : IWriter public virtual async Task WriteAsync(List outgoingDataList) { - var arriveNotes = await BuildArriveNotesAsync(outgoingDataList).ConfigureAwait(false); + var outarrive = outgoingDataList.Where(r => r.Status != EnumExchangeDataStatus.Error).ToList() ; + var arriveNotes = await BuildArriveNotesAsync(outarrive).ConfigureAwait(false); //写Arrive数据到EOS await _arriveNoteNoteManager.PostListAsync(arriveNotes).ConfigureAwait(false);