diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs index 1aaa970a7..97af4196f 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Volo.Abp.ObjectMapping; @@ -59,9 +60,9 @@ public class ProductionReturnNoteConverter : IOutgoingConverter outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNote); outgoingToExternalList.Add(outgoingToExternal); #endregion - + var sumDetails = wmsReceipt.Details.GroupBy(r => new { r.ItemCode, r.FromLocationErpCode, r.ToLocationErpCode }).Select(p => new ProductionReturnNoteDetailDTO { ItemCode = p.Key.ItemCode, FromLocationErpCode = p.Key.FromLocationErpCode, ToLocationErpCode = p.Key.ToLocationErpCode, Qty = p.Sum(x => x.Qty) }).ToList(); #region 明细 - foreach (var detail in wmsReceipt.Details) + foreach (var detail in sumDetails) { var outgoingDetailToExternal = new OutgoingToExternal() { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs index 8a8ec9951..a8b6552dd 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs @@ -95,7 +95,7 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase #endregion #region 线边仓退料单 ProductionReturn scontrol - Logger.LogInformation($"Write ProductionReturnNote");//线边仓退料单 + Logger.LogInformation($"Write ProductionReturnNote");//线边仓退料单(汇总) var productionReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService(); var productionReturnNoteList = await productionReturnNoteConvert.ConvertAsync().ConfigureAwait(false); await scontrolWriter.WriteAsync(productionReturnNoteList).ConfigureAwait(false);