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