任务单来源单调整为明细

This commit is contained in:
18942506660
2023-11-15 09:55:54 +08:00
parent 69576224da
commit 310ed29af2
7 changed files with 29 additions and 25 deletions

View File

@@ -106,7 +106,7 @@ namespace WMS.Web.Domain.Services
foreach (var e in erp_list)
{
//代表单据已经存在 那么就对单据进行修改
var data = data_list.FirstOrDefault(f => f.SourceBillNo == e.SourceBillNo);
var data = data_list.FirstOrDefault(f => f.Details.SelectMany(s => s.SourceBillNos).Contains(e.SourceBillNo));
var detail = data.Details.FirstOrDefault(w => w.MaterialId == e.MaterialId);
//存在就修改,没有就添加
if (detail != null)
@@ -134,8 +134,7 @@ namespace WMS.Web.Domain.Services
{
var e = erp_list.FirstOrDefault(f => f.SourceBillNo == item);
var dto = new OutStockTask();
dto.SourceBillNo = e.SourceBillNo;
dto.Create((OutStockType)e.Type, e.SourceBillNo, e.DeliveryOrgId, e.ReceiptCustomerId, (DateTime)e.CreateTime);
dto.Create((OutStockType)e.Type, e.DeliveryOrgId, e.ReceiptCustomerId, (DateTime)e.CreateTime);
//找到当前对应来源单据编号的集合数据
var current_erp_details = erp_list.Where(x => x.SourceBillNo == item).ToList();
@@ -282,15 +281,15 @@ namespace WMS.Web.Domain.Services
foreach (var entity in taskList)
{
if (entity.Type == OutStockType.Sal)
DeliveryNotice_Nos.Add(entity.SourceBillNo);
DeliveryNotice_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
else if (entity.Type == OutStockType.Stkdirecttransfers)
TransferDirect_Nos.Add(entity.SourceBillNo);
TransferDirect_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
else if (entity.Type == OutStockType.StktransferInst)
TransferOut_Nos.Add(entity.SourceBillNo);
TransferOut_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
else if (entity.Type == OutStockType.Assembled)
AssembledApp_Nos.Add(entity.SourceBillNo);
AssembledApp_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
else if (entity.Type == OutStockType.Miscellaneous)
MisDeliveryOut_Nos.Add(entity.SourceBillNo);
MisDeliveryOut_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
}
if (DeliveryNotice_Nos.Count() > 0)