From bf0c0e11aca6575480f82d8b1e7f09cc8074d0c9 Mon Sep 17 00:00:00 2001 From: mahao Date: Tue, 26 Sep 2023 14:39:07 +0800 Subject: [PATCH] =?UTF-8?q?[CI=20SKIP]=20=E8=A1=A5=E5=85=85=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Report/PubSaSeCompareExportService.cs | 33 ++++++++++++++++--- .../Report/SaSeCompareExportBaseService.cs | 17 ++++++++-- 2 files changed, 44 insertions(+), 6 deletions(-) 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 eee084a8..c0400037 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 @@ -178,7 +178,7 @@ namespace SettleAccount.Job.Services.Report } //结算 var saGroup = from sa in _settleAccountDbContext.Set() - where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None + where sa.BusinessType == businessType group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem select new { @@ -190,6 +190,19 @@ namespace SettleAccount.Job.Services.Report SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode) }; + var saGroupByMappingType = from sa in _settleAccountDbContext.Set() + where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None + group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem + select new + { + groupItem.Key.PN, + groupItem.Key.CustomerPartCodeNoSpace, + Qty = groupItem.Sum(t => t.Qty), + Version = groupItem.Max(t => t.Version), + LU = groupItem.Max(t => t.LU), + SettleDate = groupItem.Max(t => t.SettleDate), + PartCode = groupItem.Max(t => t.PartCode) + }; var saGroupByVersion = from sa in _settleAccountDbContext.Set() where sa.BusinessType == businessType && sa.Version == version group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem @@ -221,7 +234,7 @@ namespace SettleAccount.Job.Services.Report }; //有结算无发运 - var haveSaNotHaveSeList = (from sa in saGroup + var haveSaNotHaveSeList = (from sa in saGroupByMappingType join se in seGroup on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } into temp @@ -291,7 +304,7 @@ namespace SettleAccount.Job.Services.Report { //结算 var saGroup = from sa in _settleAccountDbContext.Set() - where sa.BusinessType == EnumBusinessType.YinDuJian && sa.MappingType == EnumMappingType.None + where sa.BusinessType == EnumBusinessType.YinDuJian group sa by new { sa.CustomerPartCodeNoSpace } into groupItem select new { @@ -302,6 +315,18 @@ namespace SettleAccount.Job.Services.Report SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode) }; + var saGroupByMappingType = from sa in _settleAccountDbContext.Set() + where sa.BusinessType == EnumBusinessType.YinDuJian && sa.MappingType == EnumMappingType.None + group sa by new { sa.CustomerPartCodeNoSpace } into groupItem + select new + { + groupItem.Key.CustomerPartCodeNoSpace, + Qty = groupItem.Sum(t => t.Qty), + Version = groupItem.Max(t => t.Version), + LU = groupItem.Max(t => t.LU), + SettleDate = groupItem.Max(t => t.SettleDate), + PartCode = groupItem.Max(t => t.PartCode) + }; var saGroupByVersion = from sa in _settleAccountDbContext.Set() where sa.BusinessType == EnumBusinessType.YinDuJian && sa.Version == version group sa by new { sa.CustomerPartCodeNoSpace } into groupItem @@ -331,7 +356,7 @@ namespace SettleAccount.Job.Services.Report }; //有结算无发运 - var haveSaNotHaveSeList = (from sa in saGroup + var haveSaNotHaveSeList = (from sa in saGroupByMappingType join se in seGroup on sa.CustomerPartCodeNoSpace equals se.CustomerPartCodeNoSpace into temp 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 681eebdf..9bfa21f3 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 @@ -49,7 +49,7 @@ namespace SettleAccount.Job.Services.Report { //结算 var saGroup = from sa in _settleAccountDbContext.Set() - where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None + where sa.BusinessType == businessType group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem select new { @@ -61,6 +61,19 @@ namespace SettleAccount.Job.Services.Report SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode) }; + var saGroupByMappingType = from sa in _settleAccountDbContext.Set() + where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None + group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem + select new + { + groupItem.Key.PN, + groupItem.Key.CustomerPartCodeNoSpace, + Qty = groupItem.Sum(t => t.Qty), + Version = groupItem.Max(t => t.Version), + LU = groupItem.Max(t => t.LU), + SettleDate = groupItem.Max(t => t.SettleDate), + PartCode = groupItem.Max(t => t.PartCode) + }; var saGroupByVersion = from sa in _settleAccountDbContext.Set() where sa.BusinessType == businessType && sa.Version == version group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem @@ -92,7 +105,7 @@ namespace SettleAccount.Job.Services.Report }; //有结算无发运 - var haveSaNotHaveSeList = (from sa in saGroup + var haveSaNotHaveSeList = (from sa in saGroupByMappingType join se in seGroup on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } into temp