From c34bcaf9fe7c8fbe8a817c3fec080071749fc0d3 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Mon, 10 Jul 2023 09:14:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E6=94=B6=E5=8D=95=E5=92=8C=E9=A2=86?= =?UTF-8?q?=E6=96=99=E5=8D=95=E5=86=8D=E4=BC=A0=E6=95=B0=E6=8D=AE=E6=97=B6?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=B1=87=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Outgoing/IssueNoteConverter.cs | 5 +++-- .../Outgoing/PutawayNoteConverter.cs | 5 ++++- .../Outgoing/ScontrolWriter.cs | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) 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); }