diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs index 686eecaa7..b977269d5 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.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; @@ -58,9 +59,9 @@ public class IssueNoteConverter : 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 IssueNoteDetailDTO { 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/PutawayNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs index 3c1bd6cf8..06b8fe872 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.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; @@ -61,8 +62,10 @@ public class PutawayNoteConverter : IOutgoingConverter outgoingToExternalList.Add(outgoingToExternal); #endregion + var sumDetails= wmsReceipt.Details.GroupBy(r => new { r.ItemCode, r.PoNumber, r.ToLocationErpCode }).Select(p => new PutawayNoteDetailDTO { ItemCode = p.Key.ItemCode, PoNumber = p.Key.PoNumber, 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/ScontrolWriter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs index ea7815a5c..df1883ceb 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs @@ -49,6 +49,11 @@ public class ScontrolWriter : IWriter } try { + //零件号和ERP库位以及单据号相同则汇总 + //var groupScmsends= dataInterfaceDetailList.GroupBy(r => new { r.scmsend_type, r.scmsend_dt_w, r.scmsend_nbr, r.scmsend_stat1, r.scmsend_part, r.scmsend_delv_date, r.scmsend_orderno, r.scmsend_loc, r.scmsend_date, r.scmsend_wipd_loc, r.scmsend_userid }) + // .Select(p=>new Scmsend { scmsend_type = p.Key.scmsend_type , scmsend_dt_w =p.Key.scmsend_dt_w , scmsend_nbr =p.Key.scmsend_nbr , scmsend_stat1 =p.Key.scmsend_stat1 , scmsend_part =p.Key.scmsend_part + // , scmsend_delv_date =p.Key.scmsend_delv_date , scmsend_orderno =p.Key.scmsend_orderno , scmsend_loc =p.Key.scmsend_loc , scmsend_date=p.Key.scmsend_date, scmsend_wipd_loc = p.Key.scmsend_wipd_loc, + // scmsend_userid=p.Key.scmsend_userid,scmsend_qty=p.Sum(itm=>itm.scmsend_qty)} ).ToList(); //dataInterface分主子表分别写入ERP await _dataInterfaceManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false); }