From 7c3c9557d1fc61105fb967d956469aa9843ebec9 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Thu, 1 Aug 2024 17:06:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=B0=E7=82=B9=E4=BB=B6=E3=80=81=E5=A4=87?= =?UTF-8?q?=E4=BB=B6=E3=80=81=E5=8D=B0=E5=BA=A6=E4=BB=B6=E3=80=81=E7=9B=B4?= =?UTF-8?q?=E4=BE=9B=E4=BB=B6=E9=83=BD=E6=8C=89lu=E5=92=8Cpn=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=8F=91=E8=BF=90=E6=95=B0=E6=8D=AE=E9=9B=B6=E4=BB=B6?= =?UTF-8?q?=E5=8F=B7=E5=92=8C=E5=BA=93=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Report/MaiDanBBACSaSeCompareExportService.cs | 5 ++++- .../Report/PubSaSeCompareExportService.cs | 16 ++++++++++++++++ .../Report/SaSeCompareExportBaseService.cs | 15 +++++++++++---- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs index 2938a102..7912ed15 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs @@ -169,7 +169,7 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.PN, groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), - Version = groupItem.Max(t => t.Version), + Version = groupItem.Max(t => t.Version), LU = groupItem.Max(t => t.LU), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), @@ -239,6 +239,7 @@ namespace SettleAccount.Job.Services.Report Version = sa.Version, CustomerOfflineTime = sa.SettleDate, PN = sa.PN, + LU = sa.LU, SAQty = sa.Qty, SaCustomerPartCode = sa.CustomerPartCodeNoSpace, SaFactoryPartCode = sa.PartCode, @@ -259,6 +260,7 @@ namespace SettleAccount.Job.Services.Report WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, PN = se.PN, + LU = se.LU, SEQty = se.Qty, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, @@ -281,6 +283,7 @@ namespace SettleAccount.Job.Services.Report ShippingDate = se.ShippingDate, CustomerOfflineTime = sa.SettleDate, PN = sa.PN, + LU = sa.LU, SAQty = sa.Qty, SEQty = se.Qty, ToLocCode = se.ToLocCode, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs index 20bf9a96..8d1d52f1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs @@ -279,6 +279,7 @@ namespace SettleAccount.Job.Services.Report Version = sa.Version, CustomerOfflineTime = sa.SettleDate, PN = sa.PN, + LU = sa.LU, SAQty = sa.Qty, SaCustomerPartCode = sa.CustomerPartCodeNoSpace, SaFactoryPartCode = sa.PartCode, @@ -298,6 +299,7 @@ namespace SettleAccount.Job.Services.Report WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, PN = se.PN, + LU = se.LU, SEQty = se.Qty, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, @@ -319,6 +321,7 @@ namespace SettleAccount.Job.Services.Report ShippingDate = se.ShippingDate, CustomerOfflineTime = sa.SettleDate, PN = sa.PN, + LU = sa.LU, SAQty = sa.Qty, SEQty = se.Qty, ToLocCode = se.ToLocCode, @@ -351,6 +354,7 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), Version = groupItem.Max(t => t.Version), + PN = groupItem.Max(t => t.PN), LU = groupItem.Max(t => t.LU), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), @@ -365,6 +369,7 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), Version = groupItem.Max(t => t.Version), + PN = groupItem.Max(t => t.PN), LU = groupItem.Max(t => t.LU), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), @@ -379,6 +384,7 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), Version = groupItem.Max(t => t.Version), + PN = groupItem.Max(t => t.PN), LU = groupItem.Max(t => t.LU), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), @@ -393,6 +399,7 @@ namespace SettleAccount.Job.Services.Report { groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), + PN = groupItem.Max(t => t.PN), LU = groupItem.Max(t => t.LU), WmsBillNum = groupItem.Max(t => t.WmsBillNum), ShippingDate = groupItem.Max(t => t.ShippingDate), @@ -413,6 +420,8 @@ namespace SettleAccount.Job.Services.Report Version = sa.Version, CustomerOfflineTime = sa.SettleDate, SAQty = sa.Qty, + PN = sa.PN, + LU = sa.LU, SaCustomerPartCode = sa.CustomerPartCodeNoSpace, SaFactoryPartCode = sa.PartCode, CustomerPartCode = sa.LU, @@ -431,6 +440,8 @@ namespace SettleAccount.Job.Services.Report WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, SEQty = se.Qty, + PN = se.PN, + LU = se.LU, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, SeCustomerPartCode = se.CustomerPartCodeNoSpace, @@ -451,6 +462,8 @@ namespace SettleAccount.Job.Services.Report ShippingDate = se.ShippingDate, CustomerOfflineTime = sa.SettleDate, SAQty = sa.Qty, + PN = sa.PN, + LU = sa.LU, SEQty = se.Qty, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, @@ -544,6 +557,7 @@ namespace SettleAccount.Job.Services.Report Version = sa.Version, CustomerOfflineTime = sa.SettleDate, PN = sa.PN, + LU = sa.LU, SAQty = sa.Qty, SaCustomerPartCode = sa.LU, SaFactoryPartCode = sa.FactoryPartCode, @@ -563,6 +577,7 @@ namespace SettleAccount.Job.Services.Report WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, PN = se.PN, + LU = se.LU, SEQty = se.Qty, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, @@ -584,6 +599,7 @@ namespace SettleAccount.Job.Services.Report ShippingDate = se.ShippingDate, CustomerOfflineTime = sa.SettleDate, PN = sa.PN, + LU = sa.LU, SAQty = sa.Qty, SEQty = se.Qty, ToLocCode = se.ToLocCode, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs index 72b63471..c07917c9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs @@ -122,6 +122,7 @@ namespace SettleAccount.Job.Services.Report Version = sa.Version, CustomerOfflineTime = sa.SettleDate, PN = sa.PN, + LU = sa.LU, SAQty = sa.Qty, SaCustomerPartCode = sa.CustomerPartCodeNoSpace, SaFactoryPartCode = sa.PartCode, @@ -141,6 +142,7 @@ namespace SettleAccount.Job.Services.Report WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, PN = se.PN, + LU = se.LU, SEQty = se.Qty, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, @@ -162,6 +164,7 @@ namespace SettleAccount.Job.Services.Report ShippingDate = se.ShippingDate, CustomerOfflineTime = sa.SettleDate, PN = sa.PN, + LU = sa.LU, SAQty = sa.Qty, SEQty = se.Qty, ToLocCode = se.ToLocCode, @@ -200,8 +203,8 @@ namespace SettleAccount.Job.Services.Report break; case EnumPubSaSeCompareCategory.HaveSaHaveSe: { - p.FactoryPartCode = p.SaFactoryPartCode; - p.ReplaceFactoryPartCode = p.SaFactoryPartCode; + p.FactoryPartCode = p.SeFactoryPartCode; + p.ReplaceFactoryPartCode = p.SeFactoryPartCode; } break; case EnumPubSaSeCompareCategory.HaveSaNotHaveSe: @@ -339,10 +342,12 @@ namespace SettleAccount.Job.Services.Report select sa).ToList(); if (canSaDetails.Any()) { - var canSaDetailsUpdate = canSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.PartCode }, i => new { i.PN, PartCode = i.FactoryPartCode }, (o, i) => + //var canSaDetailsUpdate = canSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.PartCode }, i => new { i.PN, PartCode = i.FactoryPartCode }, (o, i) => + var canSaDetailsUpdate = canSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, i.LU }, (o, i) => { o.ErpLoc = i.ToErpLocCode; o.RealPartCode = i.ReplaceFactoryPartCode; + o.PartCode = i.ReplaceFactoryPartCode; return o; }).ToList(); _settleAccountDbContext.BulkUpdate(canSaDetailsUpdate); @@ -354,10 +359,12 @@ namespace SettleAccount.Job.Services.Report select sa).ToList(); if (notSaDetails.Any()) { - var notSaDetailsUpdate = notSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.PartCode }, i => new { i.PN, PartCode = i.FactoryPartCode }, (o, i) => + //var notSaDetailsUpdate = notSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.PartCode }, i => new { i.PN, PartCode = i.FactoryPartCode }, (o, i) => + var notSaDetailsUpdate = notSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, i.LU }, (o, i) => { o.ErpLoc = i.ToErpLocCode; o.RealPartCode = i.ReplaceFactoryPartCode; + o.PartCode = i.ReplaceFactoryPartCode; return o; }).ToList(); _settleAccountDbContext.BulkUpdate(notSaDetailsUpdate);