From 0d196dfc806b90b1128754bb71d4a4c3c3494713 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Thu, 11 Jan 2024 17:30:45 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B9=B0=E7=82=B9=E4=BB=B6=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/NOT_SA_SERVICE.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs index 2d2ab663..6eff0ae3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs @@ -17,6 +17,7 @@ using Win.Sfs.SettleAccount.Bases.DomainServices; using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.ExportReports; +using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Bases @@ -52,6 +53,23 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("detailquery")] public virtual async Task> DetailQueryAsync(TRequestDetailInput input) { + var ls = input.Filters.Where(p => p.Column == "businessType").ToList(); + if (ls.Count > 0) + { + var entiy = input.Filters.Where(p => p.Column == "businessType").FirstOrDefault(); + var value = entiy.Value; + if (value == "JisBBAC") + { + input.Filters.Add(new Shared.Filter.FilterCondition() { Column = "businessType", Action = EnumFilterAction.Equal, Logic = EnumFilterLogic.Or, Value = "MaiDanJianBBAC" }); + } + else + { + input.Filters.Add(new Shared.Filter.FilterCondition() { Column = "businessType", Action = EnumFilterAction.Equal, Logic = EnumFilterLogic.Or, Value = "MaiDanJianHBPO" }); + } + + + } + var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); From 96e60f11c48657d046188c90ced9f48480cdb7f2 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Fri, 12 Jan 2024 10:45:47 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=95=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs index 566b9700..f77cd77d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs @@ -685,7 +685,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //不可结算 结算分组号码(根据价格区分结算、不可结算) var pubNotSaGroupNums = pubSaDetails.FindAll(t => t.Price == default(decimal)).Select(t => t.GroupNum).Distinct(); pubSaDetailsCanSes = pubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == false); - pubSaDetailsNotCanSes = pubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == true && t.Price== default(decimal)); + pubSaDetailsNotCanSes = pubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == true || t.Price== default(decimal)); } //可结算明细 From 7ba3010e20d0e50c672da5636ec4e01d59d7c69a Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Tue, 16 Jan 2024 11:00:21 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0RealPN=E5=92=8C?= =?UTF-8?q?=E9=80=80=E8=B4=A7=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/BBAC_SA_SERVICE.cs | 2 ++ .../BQ/Syncs/JisBBACSeEdiCompareAppService.cs | 16 ++++++++++++++++ .../src/SettleAccount.Domain/Bases/EntityBase.cs | 12 ++++++++++++ .../Report/JisBBACSaSeEdiCompareExportService.cs | 2 +- .../Report/JisHBPOSaSeEdiCompareExportService.cs | 2 +- .../Report/SeEdiCompareExportBaseService.cs | 5 +++-- 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index e379bdd8..40885a68 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs @@ -160,6 +160,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ importBBACSaDetail.Version = Version; importBBACSaDetail.Site = Site; importBBACSaDetail.BusinessType = importBBACSaDetail.PN.Contains("R0") ? EnumBusinessType.MaiDanJianBBAC : EnumBusinessType.JisBBAC; + importBBACSaDetail.RealPN = importBBACSaDetail.PN; }); var jisSaDetails = importBBACSaDetails.FindAll(t => t.BusinessType == EnumBusinessType.JisBBAC); @@ -171,6 +172,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ */ maiDanSaDetails.ForEach(maiDanSaDetail => { + //maiDanSaDetail.RealPN = maiDanSaDetail.PN; maiDanSaDetail.ProductionCodeType = maiDanSaDetail.PN[^2..]; maiDanSaDetail.PN = maiDanSaDetail.PN[..7]; }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs index ffbfc794..b92abe84 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs @@ -124,6 +124,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs await db.BulkUpdateAsync(ediFlagErrEntities).ConfigureAwait(false); } } + + var seReturnUpdateQuery = db.Set().FromSqlRaw("select distinct b.* from (select * FROM [BQ_SA].[dbo].[Set_BBAC_SE_DETAIL] where TransType=-1 and Remark is null and BusinessType=1) a left join [BQ_SA].[dbo].[Set_BBAC_SE_DETAIL] b on a.PN=b.PN and a.LU=b.LU where b.TransType=1 and b.BusinessType=1 and b.ProType in (3,7,0) and b.IsDeleted=0"); + var seReturnUpdateEntities = seReturnUpdateQuery.ToList(); + if (seReturnUpdateEntities.Count > 0) + { + seReturnUpdateEntities.ForEach(t => t.IsDeleted = true); + await db.BulkUpdateAsync(seReturnUpdateEntities).ConfigureAwait(false); + } + + var hbpoReturnUpdateQuery = db.Set().FromSqlRaw("select distinct b.* from (select * FROM [BQ_SA].[dbo].[Set_HBPO_SE_DETAIL] where TransType=-1 and Remark is null and BusinessType=2) a left join [BQ_SA].[dbo].[Set_HBPO_SE_DETAIL] b on a.PN=b.PN and a.LU=b.LU where b.TransType=1 and b.BusinessType=2 and b.ProType in (3,7,0) and b.IsDeleted=0"); + var hbpoReturnUpdateEntities = hbpoReturnUpdateQuery.ToList(); + if (hbpoReturnUpdateEntities.Count > 0) + { + hbpoReturnUpdateEntities.ForEach(t => t.IsDeleted = true); + await db.BulkUpdateAsync(hbpoReturnUpdateEntities).ConfigureAwait(false); + } } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs index 430f2947..7ef977d0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs @@ -342,6 +342,10 @@ namespace SettleAccount.Bases /// public virtual string PN { get; set; } /// + /// 真实生產號 + /// + public virtual string RealPN { get; set; } + /// /// 組合鍵值(LU+PN) /// public virtual string KeyCode { get; set; } @@ -408,6 +412,10 @@ namespace SettleAccount.Bases /// public string PN { get; set; } /// + /// 真实生產號 + /// + public virtual string RealPN { get; set; } + /// /// 組合鍵值(LU+PN) /// public string KeyCode { get; set; } @@ -486,6 +494,10 @@ namespace SettleAccount.Bases /// public string PN { get; set; } /// + /// 真实生產號 + /// + public virtual string RealPN { get; set; } + /// /// 組合鍵值(LU+PN) /// public string KeyCode { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs index ec4cdc0d..3e1d66d6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs @@ -157,7 +157,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 + where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && se.IsDeleted == false group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs index 2702a544..28be044e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs @@ -152,7 +152,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 + where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 && se.IsDeleted == false group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs index c728ad17..56536446 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs @@ -97,10 +97,11 @@ namespace SettleAccount.Job.Services.Report //无EDI有发运 var notHaveEdiHaveSeList = _settleAccountDbContext.Set() - .Where(t => t.BusinessType == businessType && t.BillTime >= seStartDateTime && t.BillTime <= seEndDateTime) + .Where(t => t.BusinessType == businessType && t.BillTime >= seStartDateTime && t.BillTime <= seEndDateTime && t.TransType == EnumDelTransType.发货) .Where(t=>t.State==0) .Where(t => proType.Contains(t.ProType)) .Where(t => t.IsHaveEdiData == false) + .Where(t => t.IsDeleted == false) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => new TCompareReport() { @@ -135,7 +136,7 @@ namespace SettleAccount.Job.Services.Report LineStationCode = groupItem.Max(t => t.LineStationCode) }; var seGroup = from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && proType.Contains(se.ProType) + where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && proType.Contains(se.ProType) && se.IsDeleted == false && se.TransType == EnumDelTransType.发货 group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { From 3dff6160111ae7a9981ddfd768a5052f0eadb2aa Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Tue, 16 Jan 2024 11:38:12 +0800 Subject: [PATCH 04/11] =?UTF-8?q?partcode=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs index a98d982d..bb102506 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs @@ -197,6 +197,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs t.BusinessType = EnumBusinessType.MaiDanJianHBPO; } } + t.PartCode = t.RealPartCode; t.CreateTime = dateTimeNow; t.CreationTime = dateTimeNow; From ad9e667d06da718634c04757ac6938bcc589436e Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Tue, 16 Jan 2024 13:30:53 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0RealPN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/BBAC_SA_SERVICE.cs | 3 ++- .../Entities/BQ/HBPO_SA_SERVICE.cs | 2 ++ .../SettleAccount.Domain/Bases/EntityBase.cs | 24 +++++++++---------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index 40885a68..78003e65 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs @@ -160,7 +160,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ importBBACSaDetail.Version = Version; importBBACSaDetail.Site = Site; importBBACSaDetail.BusinessType = importBBACSaDetail.PN.Contains("R0") ? EnumBusinessType.MaiDanJianBBAC : EnumBusinessType.JisBBAC; - importBBACSaDetail.RealPN = importBBACSaDetail.PN; + //importBBACSaDetail.RealPN = importBBACSaDetail.PN; + importBBACSaDetail.ExtraProperties.TryAdd("RealPN", importBBACSaDetail.PN); }); var jisSaDetails = importBBACSaDetails.FindAll(t => t.BusinessType == EnumBusinessType.JisBBAC); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs index 6b10a5f3..1def0478 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs @@ -265,9 +265,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var luAssemble = lus.Select(t => t.Replace(" ", "")); hbpoSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); } + hbpoSaDetail.PN = Regex.Replace(hbpoSaDetail.PN, "['‘’]", ""); hbpoSaDetail.CustomerPartCodeNoSpace = hbpoSaDetail.LU.Replace(" ", ""); hbpoSaDetail.Version = Version; + hbpoSaDetail.ExtraProperties.TryAdd("RealPN", hbpoSaDetail.PN); }); return hbpoSaDetails; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs index 7ef977d0..7feca1aa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs @@ -341,10 +341,10 @@ namespace SettleAccount.Bases /// 生產號 /// public virtual string PN { get; set; } - /// - /// 真实生產號 - /// - public virtual string RealPN { get; set; } + ///// + ///// 真实生產號 + ///// + //public virtual string RealPN { get; set; } /// /// 組合鍵值(LU+PN) /// @@ -411,10 +411,10 @@ namespace SettleAccount.Bases /// 生產號 /// public string PN { get; set; } - /// - /// 真实生產號 - /// - public virtual string RealPN { get; set; } + ///// + ///// 真实生產號 + ///// + //public virtual string RealPN { get; set; } /// /// 組合鍵值(LU+PN) /// @@ -493,10 +493,10 @@ namespace SettleAccount.Bases /// 生產號 /// public string PN { get; set; } - /// - /// 真实生產號 - /// - public virtual string RealPN { get; set; } + ///// + ///// 真实生產號 + ///// + //public virtual string RealPN { get; set; } /// /// 組合鍵值(LU+PN) /// From 7658bfd4be5fbdb223be18e225a4f172807dc0b0 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 17 Jan 2024 11:08:12 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B9=B0=E5=8D=95=E4=BB=B6=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/models/settle/detail.js | 2 +- .../Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs | 24 ++++- .../Bases/NOT_SA_SERVICE.cs | 27 ++++-- .../Entities/BQ/BBAC_NOT_SA_SERVICE.cs | 95 +++++++++++++++++++ .../Entities/BQ/BBAC_SA_SERVICE.cs | 9 ++ 5 files changed, 143 insertions(+), 14 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js index 485eb189..5ab133b6 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js @@ -57,7 +57,7 @@ export default function (businessType, type) { title: "是否退货", type: "boolean", }, - isMaidan: { + isMaiDan: { title: "是否买单", type: "boolean", }, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs index 5845e3a0..8e60e612 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; @@ -58,9 +59,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// 厂内零件号 /// public string PartCode { get; set; } + /// + ///是否退货 + /// + [ExporterHeader(DisplayName = "是否退货")] + public string IsReturn { get; set; } + /// + /// 是否是买单件 + /// + [ExporterHeader(DisplayName = "是否是买单件")] + public bool IsMaiDan { get; set; } } - public class BBAC_NOT_SA_DETAIL_EXP_DTO + public class BBAC_NOT_SA_DETAIL_EXP_DTO:EntityDto { /// @@ -84,9 +95,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "是否退货")] public string IsReturn { get; set; } /// - /// 是否退货 + /// 是否是买单件 /// - [ExporterHeader(DisplayName = "是否退货")] + [ExporterHeader(DisplayName = "是否是买单件")] + public bool IsMaiDan { get; set; } + [ExporterHeader(DisplayName = "原始生产码")] + public string RealPN { get; set; } + /// + /// 版本 + /// + [ExporterHeader(DisplayName = "版本")] public int Version { get; set; } [ExporterHeader(DisplayName = "单价")] public decimal Price { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs index 6eff0ae3..7b1ef41f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs @@ -9,8 +9,10 @@ using Magicodes.ExporterAndImporter.Csv; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Mvc; using SettleAccount.Bases; +using ShardingCore.Extensions; using Shouldly; using Volo.Abp.Application.Dtos; +using Volo.Abp.Data; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases.DomainServices; @@ -58,21 +60,23 @@ namespace Win.Sfs.SettleAccount.Bases { var entiy = input.Filters.Where(p => p.Column == "businessType").FirstOrDefault(); var value = entiy.Value; - if (value == "JisBBAC") - { - input.Filters.Add(new Shared.Filter.FilterCondition() { Column = "businessType", Action = EnumFilterAction.Equal, Logic = EnumFilterLogic.Or, Value = "MaiDanJianBBAC" }); - } - else - { - input.Filters.Add(new Shared.Filter.FilterCondition() { Column = "businessType", Action = EnumFilterAction.Equal, Logic = EnumFilterLogic.Or, Value = "MaiDanJianHBPO" }); - } - - + //if (value == "JisBBAC") + //{ + // input.Filters.Add(new Shared.Filter.FilterCondition() { Column = "businessType", Action = EnumFilterAction.Equal, Logic = EnumFilterLogic.Or, Value = "MaiDanJianBBAC" }); + //} + //else + //{ + // input.Filters.Add(new Shared.Filter.FilterCondition() { Column = "businessType", Action = EnumFilterAction.Equal, Logic = EnumFilterLogic.Or, Value = "MaiDanJianHBPO" }); + //} + + input.Filters.Remove(entiy); } var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); + + return new PagedResultDto(totalCount, dtos); } /// @@ -87,7 +91,10 @@ namespace Win.Sfs.SettleAccount.Bases IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + var dtoDetails = ObjectMapper.Map, List>(entities); + + var classDisplayName = typeof(TEntityDetailExportDto).GetCustomAttribute()?.Name ?? typeof(TEntityDetailExportDto).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; byte[] result = null; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs index 4a481eac..cd5e86a0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs @@ -1,9 +1,19 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using System.Security.Policy; using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Csv; +using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; +using Shouldly; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Data; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; @@ -12,6 +22,8 @@ using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; +using Win.Sfs.SettleAccount.Entities.BQ.Temp; +using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; @@ -37,6 +49,89 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { _bbacNotMng = bbacNotMng; } + + + [HttpPost] + //[Route("export")] + public override async Task ExportAsync(BBAC_NOT_SA_DETAIL_REQ_DTO input) + { + var ls = input.Filters.Where(p => p.Column == "businessType").ToList(); + if (ls.Count > 0) + { + var entiy = input.Filters.Where(p => p.Column == "businessType").FirstOrDefault(); + var value = entiy.Value; + + input.Filters.Remove(entiy); + } + + IExporter _csv = new CsvExporter(); + IExporter _excel = new ExcelExporter(); + var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + + var dtoDetails = ObjectMapper.Map, List>(entities); + + var inner = from d in entities + join p in dtoDetails on d.Id equals p.Id + + select + new BBAC_NOT_SA_DETAIL_EXP_DTO() + { + SettleBillNum=d.SettleBillNum, + Site=d.Site, + Category=p.Category, + IsReturn=p.IsReturn, + IsMaiDan=p.IsMaiDan, + RealPN = d.GetProperty("RealPN", ""), + InvGroupNum=p.InvGroupNum, + SettleDate = d.SettleDate, + LU = d.LU, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + KeyCode = d.KeyCode, + Price = p.Price, + }; + + //dtoDetails.ForEach(dtoDetail => + //{ + // var item= entities.FirstOrDefault(e => e.Id == dtoDetail.Id); + // dtoDetail.RealPN = item.GetProperty("RealPN", ""); + + //}); + + + var classDisplayName = typeof(BBAC_NOT_SA_DETAIL_EXP_DTO).GetCustomAttribute()?.Name ?? typeof(BBAC_NOT_SA_DETAIL_EXP_DTO).Name; + string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; + byte[] result = null; + + //switch (input.FileType) + //{ + // case 0: + // result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); + // break; + // case 1: + // result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); + // break; + //} + + result = await _excel.ExportAsByteArray(inner.ToList()).ConfigureAwait(false); + result.ShouldNotBeNull(); + + //保存导出文件到服务器存成二进制 + await _excelImportService.SaveBlobAsync( + new SaveExcelImportInputDto + { + Name = _fileName, + Content = result + } + ).ConfigureAwait(false); + return _fileName; + } + + + + + [HttpPost] public override async Task GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index 78003e65..bc16cd6a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs @@ -480,6 +480,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } if (bbacNotSaDetails.Count > 0) { + bbacNotSaDetails.ForEach(bbacNotSaDetail => + { + if(bbacNotSaDetail.BusinessType==EnumBusinessType.MaiDanJianBBAC) + { + bbacNotSaDetail.IsMaiDan = true; + } + + }); + await _bbacNotSaDetailRepository.DbContext.BulkInsertAsync(bbacNotSaDetails).ConfigureAwait(false); } if (materialRelationships.Count > 0) From a5f8bb9df9963369473bb21b0cb9500e4784034d Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Thu, 18 Jan 2024 16:24:17 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=B8=89=E6=96=B9=E6=AF=94=E5=AF=B9?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs | 10 ++- .../Bases/NOT_SA_SERVICE.cs | 3 + .../Entities/BQ/BBAC_NOT_SA_SERVICE.cs | 1 + .../Entities/BQ/HBPO_NOT_SA_SERVICE.cs | 85 +++++++++++++++++++ .../JisBBACSaSeEdiCompareExportService.cs | 46 +++++++++- .../JisHBPOSaSeEdiCompareExportService.cs | 51 ++++++++++- .../Report/SaSeEdiCompareExportBaseService.cs | 69 ++++++++------- 7 files changed, 226 insertions(+), 39 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs index bd136af0..951bb0b2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs @@ -63,7 +63,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public string PartCode { get; set; } } - public class HBPO_NOT_SA_DETAIL_EXP_DTO + public class HBPO_NOT_SA_DETAIL_EXP_DTO : EntityDto { /// @@ -79,13 +79,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// ///业务类别 /// - //[ExporterHeader(DisplayName = "业务类别")] - //public string Category { get; set; } + [ExporterHeader(DisplayName = "业务类别")] + public string Category { get; set; } /// ///是否退货 /// //[ExporterHeader(DisplayName = "是否退货")] //public string IsReturn { get; set; } + //[ExporterHeader(DisplayName = "是否买单")] + //public string IsMaiDan { get; set; } + [ExporterHeader(DisplayName = "原始生产码")] + public string RealPN { get; set; } [ExporterHeader(DisplayName = "期间")] public int Version { get; set; } [ExporterHeader(DisplayName = "单价")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs index 7b1ef41f..6c02623a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs @@ -122,6 +122,9 @@ namespace Win.Sfs.SettleAccount.Bases ).ConfigureAwait(false); return _fileName; } + + + /// /// 生成可计算单 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs index cd5e86a0..2d2e1b6a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs @@ -132,6 +132,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ + [HttpPost] public override async Task GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs index bcda4f67..117db355 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs @@ -1,9 +1,18 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Csv; +using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; +using Shouldly; +using Volo.Abp.Data; +using Volo.Abp.ObjectMapping; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; @@ -41,6 +50,82 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _hbpoNotMng = hbpoNotMng; } + [HttpPost] + //[Route("export")] + public override async Task ExportAsync(HBPO_NOT_SA_DETAIL_REQ_DTO input) + { + var ls = input.Filters.Where(p => p.Column == "businessType").ToList(); + if (ls.Count > 0) + { + var entiy = input.Filters.Where(p => p.Column == "businessType").FirstOrDefault(); + var value = entiy.Value; + + input.Filters.Remove(entiy); + } + + IExporter _csv = new CsvExporter(); + IExporter _excel = new ExcelExporter(); + var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + + var dtoDetails = ObjectMapper.Map, List>(entities); + + var inner = from d in entities + join p in dtoDetails on d.Id equals p.Id + + select + new HBPO_NOT_SA_DETAIL_EXP_DTO() + { + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Category = d.BusinessType.ToString(), + RealPN = d.GetProperty("RealPN", ""), + InvGroupNum = p.InvGroupNum, + SettleDate = d.SettleDate, + LU = d.LU, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + KeyCode = d.KeyCode, + Price = p.Price, + }; + + //dtoDetails.ForEach(dtoDetail => + //{ + // var item= entities.FirstOrDefault(e => e.Id == dtoDetail.Id); + // dtoDetail.RealPN = item.GetProperty("RealPN", ""); + + //}); + + + var classDisplayName = typeof(HBPO_NOT_SA_DETAIL_EXP_DTO).GetCustomAttribute()?.Name ?? typeof(HBPO_NOT_SA_DETAIL_EXP_DTO).Name; + string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; + byte[] result = null; + + //switch (input.FileType) + //{ + // case 0: + // result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); + // break; + // case 1: + // result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); + // break; + //} + + result = await _excel.ExportAsByteArray(inner.ToList()).ConfigureAwait(false); + result.ShouldNotBeNull(); + + //保存导出文件到服务器存成二进制 + await _excelImportService.SaveBlobAsync( + new SaveExcelImportInputDto + { + Name = _fileName, + Content = result + } + ).ConfigureAwait(false); + return _fileName; + } + + public override async Task GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input) { var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs index 3e1d66d6..a873e84c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs @@ -140,8 +140,23 @@ namespace SettleAccount.Job.Services.Report public List GetEdiSeSaCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime) { //结算 + //var saGroup = from sa in _settleAccountDbContext.Set() + // where sa.BusinessType == businessType && sa.Version == version + // 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), + // Site = groupItem.Max(t => t.Site), + // Price = groupItem.Max(t => t.Price), + // }; var saGroup = from sa in _settleAccountDbContext.Set() - where sa.BusinessType == businessType && sa.Version == version + where sa.BusinessType == businessType group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem select new { @@ -156,8 +171,23 @@ namespace SettleAccount.Job.Services.Report Price = groupItem.Max(t => t.Price), }; //发运 + //var seGroup = (from se in _settleAccountDbContext.Set() + // where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && se.IsDeleted == false + // group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem + // select new + // { + // groupItem.Key.PN, + // groupItem.Key.CustomerPartCodeNoSpace, + // Qty = groupItem.Sum(t => t.Qty), + // LU = groupItem.Max(t => t.LU), + // WmsBillNum = groupItem.Max(t => t.WmsBillNum), + // ShippingDate = groupItem.Max(t => t.ShippingDate), + // FactoryPartCode = groupItem.Max(t => t.FactoryPartCode), + // ToLoc = groupItem.Max(t => t.ToLoc), + // ErpToLoc = groupItem.Max(t => t.ErpToLoc) + // }).Where(t => t.Qty != 0M); var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && se.IsDeleted == false + where se.BusinessType == businessType && se.IsDeleted == false group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { @@ -172,8 +202,18 @@ namespace SettleAccount.Job.Services.Report ErpToLoc = groupItem.Max(t => t.ErpToLoc) }).Where(t => t.Qty != 0M); //Edi + //var ediGroup = from edi in _settleAccountDbContext.Set() + // where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0 + // group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem + // select new + // { + // groupItem.Key.PN, + // groupItem.Key.CustomerPartCodeNoSpace, + // Qty = groupItem.Sum(t => t.Qty), + // LU = groupItem.Max(t => t.LU) + // }; var ediGroup = from edi in _settleAccountDbContext.Set() - where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0 + where edi.IsDeleted == false && edi.IsHaveSeData == true group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs index 28be044e..3927b297 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs @@ -135,8 +135,24 @@ namespace SettleAccount.Job.Services.Report public List GetSaSeEdiCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime) { //结算 + //var saGroup = from sa in _settleAccountDbContext.Set() + // where sa.BusinessType == businessType && sa.Version == version + // 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), + // Site = groupItem.Max(t => t.Site), + // Price = groupItem.Max(t => t.Price) + // }; + var saGroup = from sa in _settleAccountDbContext.Set() - where sa.BusinessType == businessType && sa.Version == version + where sa.BusinessType == businessType group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem select new { @@ -150,9 +166,26 @@ namespace SettleAccount.Job.Services.Report Site = groupItem.Max(t => t.Site), Price = groupItem.Max(t => t.Price) }; + //发运 + //var seGroup = (from se in _settleAccountDbContext.Set() + // where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 && se.IsDeleted == false + // group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem + // select new + // { + // groupItem.Key.PN, + // groupItem.Key.CustomerPartCodeNoSpace, + // Qty = groupItem.Sum(t => t.Qty), + // LU = groupItem.Max(t => t.LU), + // WmsBillNum = groupItem.Max(t => t.WmsBillNum), + // ShippingDate = groupItem.Max(t => t.ShippingDate), + // FactoryPartCode = groupItem.Max(t => t.FactoryPartCode), + // ToLoc = groupItem.Max(t => t.ToLoc), + // ErpToLoc = groupItem.Max(t => t.ErpToLoc) + // }).Where(t => t.Qty != 0M); + var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 && se.IsDeleted == false + where se.BusinessType == businessType && se.IsDeleted == false group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { @@ -166,9 +199,20 @@ namespace SettleAccount.Job.Services.Report ToLoc = groupItem.Max(t => t.ToLoc), ErpToLoc = groupItem.Max(t => t.ErpToLoc) }).Where(t => t.Qty != 0M); + //Edi + //var ediGroup = from edi in _settleAccountDbContext.Set() + // where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0 + // group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem + // select new + // { + // groupItem.Key.PN, + // groupItem.Key.CustomerPartCodeNoSpace, + // Qty = groupItem.Sum(t => t.Qty), + // LU = groupItem.Max(t => t.LU) + // }; var ediGroup = from edi in _settleAccountDbContext.Set() - where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0 + where edi.IsDeleted == false && edi.IsHaveSeData == true group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { @@ -177,6 +221,7 @@ namespace SettleAccount.Job.Services.Report Qty = groupItem.Sum(t => t.Qty), LU = groupItem.Max(t => t.LU) }; + var seEdiGroup = from se in seGroup join edi in ediGroup on new { se.PN, se.CustomerPartCodeNoSpace } equals new { edi.PN, edi.CustomerPartCodeNoSpace } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs index 9e1f301b..f6df0838 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs @@ -259,6 +259,8 @@ namespace SettleAccount.Job.Services.Report SEQty = p.Sum(t => t.SEQty), EdiQty = p.Sum(t => t.EdiQty) }).ToList(); + //有结算无发运 + var haveSaNotHaveSeExport = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaNotHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaNotHaveSeNotHaveEdi }.Contains(t.Category)); //有结算有发运 var haveSaHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi }.Contains(t.Category)); @@ -295,28 +297,35 @@ namespace SettleAccount.Job.Services.Report }).ToList(); var excelExporter = new ExcelExporter(); - //结算核对明细输出 - excelExporter.Append(saSeEdiCompareDetailExports.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}结算核对明细输出"); - for (var i = 1; i < saSeEdiCompareDetailExports.Count / detailMaxRowNumberOnASheet + ((saSeEdiCompareDetailExports.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) + //有结算无发运 + excelExporter.Append(haveSaNotHaveSeExport.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算无发运"); + for (var i = 1; i < haveSaNotHaveSeExport.Count / detailMaxRowNumberOnASheet + ((haveSaNotHaveSeExport.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) { - var sheetDataItems = saSeEdiCompareDetailExports.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); - excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}结算核对明细输出-{i}"); + var sheetDataItems = haveSaNotHaveSeExport.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); + excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算无发运-{i}"); } - //结算核对汇总输出 - excelExporter.Append(saSeEdiCompareSumExports.Take(sumMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}结算核对汇总输出"); - for (var i = 1; i < saSeEdiCompareSumExports.Count / sumMaxRowNumberOnASheet + ((saSeEdiCompareSumExports.Count % sumMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) + //无结算有发运 + excelExporter.Append(notHaveSaHaveSeExports.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}无结算有发运"); + for (var i = 1; i < notHaveSaHaveSeExports.Count / detailMaxRowNumberOnASheet + ((notHaveSaHaveSeExports.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) { - var sheetDataItems = saSeEdiCompareSumExports.Skip(i * sumMaxRowNumberOnASheet).Take(sumMaxRowNumberOnASheet).ToList(); ; - excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}结算核对汇总输出-{i}"); + var sheetDataItems = notHaveSaHaveSeExports.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); + excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}无结算有发运-{i}"); } + ////结算核对汇总输出 + //excelExporter.Append(saSeEdiCompareSumExports.Take(sumMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}结算核对汇总输出"); + //for (var i = 1; i < saSeEdiCompareSumExports.Count / sumMaxRowNumberOnASheet + ((saSeEdiCompareSumExports.Count % sumMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) + //{ + // var sheetDataItems = saSeEdiCompareSumExports.Skip(i * sumMaxRowNumberOnASheet).Take(sumMaxRowNumberOnASheet).ToList(); ; + // excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}结算核对汇总输出-{i}"); + //} //有结算有发货明细输出 - excelExporter.Append(haveSaHaveSeExports.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算有发货明细输出"); - for (var i = 1; i < haveSaHaveSeExports.Count / detailMaxRowNumberOnASheet + ((haveSaHaveSeExports.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) - { - var sheetDataItems = haveSaHaveSeExports.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); - excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算有发货明细输出-{i}"); - } + //excelExporter.Append(haveSaHaveSeExports.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算有发货明细输出"); + //for (var i = 1; i < haveSaHaveSeExports.Count / detailMaxRowNumberOnASheet + ((haveSaHaveSeExports.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) + //{ + // var sheetDataItems = haveSaHaveSeExports.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); + // excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算有发货明细输出-{i}"); + //} //有结算有发货汇总输出 excelExporter.Append(haveSaHaveSeSumExports.Take(sumMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算有发货汇总输出"); for (var i = 1; i < haveSaHaveSeSumExports.Count / sumMaxRowNumberOnASheet + ((haveSaHaveSeSumExports.Count % sumMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) @@ -325,20 +334,20 @@ namespace SettleAccount.Job.Services.Report excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算有发货汇总输出-{i}"); } - //有结算有发货明细输出 - excelExporter.Append(haveSaNotHaveSeExports.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算无发货明细输出"); - for (var i = 1; i < haveSaNotHaveSeExports.Count / detailMaxRowNumberOnASheet + ((haveSaNotHaveSeExports.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) - { - var sheetDataItems = haveSaNotHaveSeExports.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); - excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算无发货明细输出-{i}"); - } - //有结算有发货汇总输出 - excelExporter.Append(haveSaNotHaveSeSumExports.Take(sumMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算无发货汇总输出"); - for (var i = 1; i < haveSaNotHaveSeSumExports.Count / sumMaxRowNumberOnASheet + ((haveSaNotHaveSeSumExports.Count % sumMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) - { - var sheetDataItems = haveSaNotHaveSeSumExports.Skip(i * sumMaxRowNumberOnASheet).Take(sumMaxRowNumberOnASheet).ToList(); - excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算无发货汇总输出-{i}"); - } + ////有结算无发货明细输出 + //excelExporter.Append(haveSaNotHaveSeExports.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算无发货明细输出"); + //for (var i = 1; i < haveSaNotHaveSeExports.Count / detailMaxRowNumberOnASheet + ((haveSaNotHaveSeExports.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) + //{ + // var sheetDataItems = haveSaNotHaveSeExports.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); + // excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算无发货明细输出-{i}"); + //} + ////有结算无发货汇总输出 + //excelExporter.Append(haveSaNotHaveSeSumExports.Take(sumMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算无发货汇总输出"); + //for (var i = 1; i < haveSaNotHaveSeSumExports.Count / sumMaxRowNumberOnASheet + ((haveSaNotHaveSeSumExports.Count % sumMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) + //{ + // var sheetDataItems = haveSaNotHaveSeSumExports.Skip(i * sumMaxRowNumberOnASheet).Take(sumMaxRowNumberOnASheet).ToList(); + // excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算无发货汇总输出-{i}"); + //} return excelExporter; } From 89f70325d01103edea2d1964875f3c605f42c82e Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Fri, 19 Jan 2024 11:28:02 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=87=8F=E5=B0=91=E5=8F=91=E8=BF=90?= =?UTF-8?q?=E9=99=90=E5=88=B6=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Report/JisBBACSaSeEdiCompareExportService.cs | 2 +- .../Services/Report/JisHBPOSaSeEdiCompareExportService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs index a873e84c..9a310e1c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs @@ -187,7 +187,7 @@ namespace SettleAccount.Job.Services.Report // ErpToLoc = groupItem.Max(t => t.ErpToLoc) // }).Where(t => t.Qty != 0M); var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.IsDeleted == false + where se.BusinessType == businessType group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs index 3927b297..a87a70c9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs @@ -185,7 +185,7 @@ namespace SettleAccount.Job.Services.Report // }).Where(t => t.Qty != 0M); var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.IsDeleted == false + where se.BusinessType == businessType group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { From 257eb0b3c1b98ca69fae09133f58b1d4cbfa2d84 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 22 Jan 2024 13:04:21 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=B8=89=E6=96=B9=E6=AF=94=E5=AF=B9?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JisBBACSaSeEdiCompareExportService.cs | 36 +++++++++++-------- .../JisHBPOSaSeEdiCompareExportService.cs | 24 ++++++------- .../Report/SaSeEdiCompareExportBaseService.cs | 2 ++ 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs index 9a310e1c..56d714ab 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs @@ -76,19 +76,25 @@ namespace SettleAccount.Job.Services.Report HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs); + //var sa1 = saSeEdiCompareDiffs.FindAll(t => t.PN == "3819841").ToList(); + //var sa2 = sa1.FindAll(t => t.SaCustomerPartCode == "A2068808405").ToList(); + + //saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(t => t.PN == "3819841").ToList(); + + #region 二次对比 //二次匹配上的记录 - var secondMatchHaveSaHaveSes = HandleSecondCompare(saSeEdiCompareDiffs, businessType); - if (secondMatchHaveSaHaveSes.Any()) - { - //二次匹配 匹配上的厂内零件号、PN - var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); - saSeEdiCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); - saSeEdiCompareDiffs.AddRange(secondMatchHaveSaHaveSes); - //二次对比比对上的数据入库 - var seCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); - _settleAccountDbContext.Set().AddRange(seCDetailEntitys); - } + //var secondMatchHaveSaHaveSes = HandleSecondCompare(saSeEdiCompareDiffs, businessType); + //if (secondMatchHaveSaHaveSes.Any()) + //{ + // //二次匹配 匹配上的厂内零件号、PN + // var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); + // saSeEdiCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); + // saSeEdiCompareDiffs.AddRange(secondMatchHaveSaHaveSes); + // //二次对比比对上的数据入库 + // var seCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); + // _settleAccountDbContext.Set().AddRange(seCDetailEntitys); + //} #endregion #region 结算数据处理 @@ -155,7 +161,7 @@ namespace SettleAccount.Job.Services.Report // Site = groupItem.Max(t => t.Site), // Price = groupItem.Max(t => t.Price), // }; - var saGroup = from sa in _settleAccountDbContext.Set() + var saGroup = from sa in _settleAccountDbContext.Set() where sa.BusinessType == businessType group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem select new @@ -186,8 +192,8 @@ namespace SettleAccount.Job.Services.Report // ToLoc = groupItem.Max(t => t.ToLoc), // ErpToLoc = groupItem.Max(t => t.ErpToLoc) // }).Where(t => t.Qty != 0M); - var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType + var seGroup = (from se in _settleAccountDbContext.Set() + where se.BusinessType == businessType group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { @@ -200,7 +206,7 @@ namespace SettleAccount.Job.Services.Report FactoryPartCode = groupItem.Max(t => t.FactoryPartCode), ToLoc = groupItem.Max(t => t.ToLoc), ErpToLoc = groupItem.Max(t => t.ErpToLoc) - }).Where(t => t.Qty != 0M); + }).Where(t => t.Qty > 0M); //Edi //var ediGroup = from edi in _settleAccountDbContext.Set() // where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs index a87a70c9..0997ee53 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs @@ -78,17 +78,17 @@ namespace SettleAccount.Job.Services.Report #region 二次对比 //二次匹配上的记录 - var secondMatchHaveSaHaveSes = HandleSecondCompare(saSeEdiCompareDiffs, businessType); - if (secondMatchHaveSaHaveSes.Any()) - { - //二次匹配 匹配上的厂内零件号、PN - var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); - saSeEdiCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); - saSeEdiCompareDiffs.AddRange(secondMatchHaveSaHaveSes); - //二次对比比对上的数据入库 - var seCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); - _settleAccountDbContext.Set().AddRange(seCDetailEntitys); - } + //var secondMatchHaveSaHaveSes = HandleSecondCompare(saSeEdiCompareDiffs, businessType); + //if (secondMatchHaveSaHaveSes.Any()) + //{ + // //二次匹配 匹配上的厂内零件号、PN + // var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); + // saSeEdiCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); + // saSeEdiCompareDiffs.AddRange(secondMatchHaveSaHaveSes); + // //二次对比比对上的数据入库 + // var seCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); + // _settleAccountDbContext.Set().AddRange(seCDetailEntitys); + //} #endregion #region 结算数据处理 @@ -198,7 +198,7 @@ namespace SettleAccount.Job.Services.Report FactoryPartCode = groupItem.Max(t => t.FactoryPartCode), ToLoc = groupItem.Max(t => t.ToLoc), ErpToLoc = groupItem.Max(t => t.ErpToLoc) - }).Where(t => t.Qty != 0M); + }).Where(t => t.Qty > 0M); //Edi //var ediGroup = from edi in _settleAccountDbContext.Set() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs index f6df0838..11673601 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs @@ -264,6 +264,8 @@ namespace SettleAccount.Job.Services.Report //有结算有发运 var haveSaHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi }.Contains(t.Category)); + + //有结算有发运汇总 var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumReport() { From e39c5184204798da39e7212e516d2f71ddde2a45 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 22 Jan 2024 15:42:00 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E8=BE=93=E5=87=BA=E6=9C=89=E7=BB=93?= =?UTF-8?q?=E6=9C=89=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reports/SaSeEdiCompareDetailReport.cs | 1 + .../Report/SaSeEdiCompareExportBaseService.cs | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs index df896c36..ccac730d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs @@ -169,6 +169,7 @@ namespace Win.Sfs.SettleAccount.Reports [ValueMapping("当期数据", true)] [ValueMapping("", false)] public bool IsCurrent { get; set; } + /// /// 地点 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs index 11673601..c5d23b5d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using EFCore.BulkExtensions; @@ -265,7 +266,7 @@ namespace SettleAccount.Job.Services.Report //有结算有发运 var haveSaHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi }.Contains(t.Category)); - + var haveSaHaveSeExport = haveSaHaveSeExports.FindAll(t => t.IsCurrent==true); //有结算有发运汇总 var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumReport() { @@ -322,12 +323,12 @@ namespace SettleAccount.Job.Services.Report //} //有结算有发货明细输出 - //excelExporter.Append(haveSaHaveSeExports.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算有发货明细输出"); - //for (var i = 1; i < haveSaHaveSeExports.Count / detailMaxRowNumberOnASheet + ((haveSaHaveSeExports.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) - //{ - // var sheetDataItems = haveSaHaveSeExports.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); - // excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算有发货明细输出-{i}"); - //} + excelExporter.Append(haveSaHaveSeExport.Take(detailMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算有发货明细输出"); + for (var i = 1; i < haveSaHaveSeExport.Count / detailMaxRowNumberOnASheet + ((haveSaHaveSeExport.Count % detailMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) + { + var sheetDataItems = haveSaHaveSeExport.Skip(i * detailMaxRowNumberOnASheet).Take(detailMaxRowNumberOnASheet).ToList(); + excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}有结算有发货明细输出-{i}"); + } //有结算有发货汇总输出 excelExporter.Append(haveSaHaveSeSumExports.Take(sumMaxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}有结算有发货汇总输出"); for (var i = 1; i < haveSaHaveSeSumExports.Count / sumMaxRowNumberOnASheet + ((haveSaHaveSeSumExports.Count % sumMaxRowNumberOnASheet) > 0 ? 1 : 0); i++) From dd40d2b607db146714351f867ceccdb4663dc54d Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 22 Jan 2024 16:10:14 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=8C=89=E5=BD=93=E6=9C=9F=E6=B1=87?= =?UTF-8?q?=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Report/SaSeEdiCompareExportBaseService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs index c5d23b5d..c88f3af0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs @@ -268,7 +268,7 @@ namespace SettleAccount.Job.Services.Report var haveSaHaveSeExport = haveSaHaveSeExports.FindAll(t => t.IsCurrent==true); //有结算有发运汇总 - var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumReport() + var haveSaHaveSeSumExports = haveSaHaveSeExport.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumReport() { FactoryPartCode = p.Key, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,