Browse Source

验收单和领料单再传数据时进行汇总

集成Redis
lvzb 2 years ago
parent
commit
c34bcaf9fe
  1. 5
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs
  2. 5
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs
  3. 5
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs

5
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()
{

5
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()
{

5
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);
}

Loading…
Cancel
Save