From 7ffc29083a810fadc2f20463acc9b928cf2d268f Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 6 Sep 2023 15:34:52 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E5=8F=91=E8=BF=90=E3=80=81EDI=E5=AF=B9?= =?UTF-8?q?=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BQ/Syncs/JisBBACSeEdiCompareAppService.cs | 53 ++++++++++++------- .../BQ/Syncs/JisHBPOSeEdiCompareAppService.cs | 53 ++++++++++++------- .../JisBBACSaSeEdiCompareExportService.cs | 9 ++-- .../JisBBACSeEdiCompareExportService.cs | 12 ++--- .../JisHBPOSaSeEdiCompareExportService.cs | 9 ++-- .../JisHBPOSeEdiCompareExportService.cs | 12 ++--- .../Report/SaSeCompareExportBaseService.cs | 11 ++-- 7 files changed, 95 insertions(+), 64 deletions(-) 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 c75341b6..9c43c708 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 @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Coravel.Invocable; @@ -37,20 +36,20 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable await HandDelEdiDataAsync().ConfigureAwait(false); - var seDetailGroup = db.Set().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace }); - var ediDetailGroup = db.Set().Where(t => t.IsDeleted == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }); + var seDetailGroup = db.Set().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, t.Key.CustomerPartCodeNoSpace }); + var ediDetailGroup = db.Set().Where(t => t.IsDeleted == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, t.Key.CustomerPartCodeNoSpace }); var keyCodes = from se in seDetailGroup from edi in ediDetailGroup - where se.PN == edi.PN && se.LU == edi.LU - select new { se.PN, se.LU }; + where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace + select new { se.PN, se.CustomerPartCodeNoSpace }; var seDetailsQuery = from se in db.Set() from keyCode in keyCodes - where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.LU && se.IsHaveEdiData == false + where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.CustomerPartCodeNoSpace && se.IsHaveEdiData == false select se; var ediDetailsQuery = from edi in db.Set() from keyCode in keyCodes - where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false + where edi.PN == keyCode.PN && edi.CustomerPartCodeNoSpace == keyCode.CustomerPartCodeNoSpace && edi.IsDeleted == false && edi.IsHaveSeData == false select edi; var seDetails = seDetailsQuery.Take(5000).ToList(); @@ -90,24 +89,38 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable */ using var serviceScope = _serviceProvider.CreateScope(); var db = serviceScope.ServiceProvider.GetRequiredService(); - //Edi 删除的数据(有发运数据) - var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).Select(t => new { t.PN, t.LU }).Distinct().ToList(); - - if (ediDelKeyCodes.Any()) + var seed = 0; + while (seed < 10) { - var seDetails = db.Set().Join(ediDelKeyCodes, a => new { a.PN, LU = a.CustomerPartCodeNoSpace }, b => new { b.PN, b.LU }, (a, b) => a); - var ediDetails = db.Set().Join(ediDelKeyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a); - if (seDetails.Any()) + seed++; + //Edi 删除的数据(有发运数据) + var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).GroupBy(t => t.PN).Select(t => t.Key).Take(1000).ToList(); + if (ediDelKeyCodes.Any()) { - seDetails.ForEach(t => t.IsHaveEdiData = false); - db.Set().UpdateRange(seDetails); + var seDetails = db.Set() + .Where(t => t.IsHaveEdiData == true) + .Where(t => ediDelKeyCodes.Contains(t.PN)) + .ToList(); + if (seDetails.Any()) + { + seDetails.ForEach(t => t.IsHaveEdiData = false); + await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); + } + + var ediDetails = db.Set() + .Where(t => t.IsHaveSeData == true) + .Where(t => ediDelKeyCodes.Contains(t.PN)) + .ToList(); + if (ediDetails.Any()) + { + ediDetails.ForEach(t => t.IsHaveSeData = false); + await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); + } } - if (ediDetails.Any()) + else { - ediDetails.ForEach(t => t.IsHaveSeData = false); - db.Set().UpdateRange(ediDetails); + break; } - await db.SaveChangesAsync().ConfigureAwait(false); } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs index 290008fe..e7d203d5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; using System.Threading.Tasks; @@ -38,20 +37,20 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable await HandDelEdiDataAsync().ConfigureAwait(false); - var seDetailGroup = db.Set().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace }); - var ediDetailGroup = db.Set().Where(t => t.IsDeleted == false && t.IsHaveSeData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }); + var seDetailGroup = db.Set().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, t.Key.CustomerPartCodeNoSpace }); + var ediDetailGroup = db.Set().Where(t => t.IsDeleted == false && t.IsHaveSeData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, t.Key.CustomerPartCodeNoSpace }); var keyCodes = from se in seDetailGroup from edi in ediDetailGroup - where se.PN == edi.PN && se.LU == edi.LU - select new { se.PN, se.LU }; + where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace + select new { se.PN, se.CustomerPartCodeNoSpace }; var seDetailsQuery = from se in db.Set() from keyCode in keyCodes - where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.LU && se.IsHaveEdiData == false + where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.CustomerPartCodeNoSpace && se.IsHaveEdiData == false select se; var ediDetailsQuery = from edi in db.Set() from keyCode in keyCodes - where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false + where edi.PN == keyCode.PN && edi.CustomerPartCodeNoSpace == keyCode.CustomerPartCodeNoSpace && edi.IsDeleted == false && edi.IsHaveSeData == false select edi; var seDetails = seDetailsQuery.Take(5000).ToList(); @@ -85,24 +84,38 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable { using var serviceScope = _serviceProvider.CreateScope(); var db = serviceScope.ServiceProvider.GetRequiredService(); - //Edi 删除的数据(有发运数据) - var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).Select(t => new { t.PN, t.LU }).Distinct().ToList(); - - if (ediDelKeyCodes.Any()) + var seed = 0; + while (seed < 10) { - var seDetails = db.Set().Join(ediDelKeyCodes, a => new { a.PN, LU = a.CustomerPartCodeNoSpace }, b => new { b.PN, b.LU }, (a, b) => a); - var ediDetails = db.Set().Join(ediDelKeyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a); - if (seDetails.Any()) + seed++; + //Edi 删除的数据(有发运数据) + var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).GroupBy(t => t.PN).Select(t => t.Key).Take(1000).ToList(); + if (ediDelKeyCodes.Any()) { - seDetails.ForEach(t => t.IsHaveEdiData = false); - db.Set().UpdateRange(seDetails); + var seDetails = db.Set() + .Where(t => t.IsHaveEdiData == true) + .Where(t => ediDelKeyCodes.Contains(t.PN)) + .ToList(); + if (seDetails.Any()) + { + seDetails.ForEach(t => t.IsHaveEdiData = false); + await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); + } + + var ediDetails = db.Set() + .Where(t => t.IsHaveSeData == true) + .Where(t => ediDelKeyCodes.Contains(t.PN)) + .ToList(); + if (ediDetails.Any()) + { + ediDetails.ForEach(t => t.IsHaveSeData = false); + await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); + } } - if (ediDetails.Any()) + else { - ediDetails.ForEach(t => t.IsHaveSeData = false); - db.Set().UpdateRange(ediDetails); + break; } - await db.SaveChangesAsync().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 b255c3c0..f4402be1 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 @@ -149,16 +149,17 @@ namespace SettleAccount.Job.Services.Report //Edi var ediGroup = from edi in _settleAccountDbContext.Set() where edi.IsDeleted == false && edi.IsHaveSeData == true - group edi by new { edi.PN, edi.LU } into groupItem + group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { groupItem.Key.PN, - groupItem.Key.LU, - Qty = groupItem.Sum(t => t.Qty) + groupItem.Key.CustomerPartCodeNoSpace, + 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, CustomerPartCodeNoSpace = edi.LU } + on new { se.PN, se.CustomerPartCodeNoSpace } equals new { edi.PN, edi.CustomerPartCodeNoSpace } into ediTemp from edi in ediTemp.DefaultIfEmpty() select new diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs index 0aab90ac..0a6d9dac 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs @@ -77,7 +77,7 @@ namespace SettleAccount.Job.Services.Report //有EDI无发运 var haveEdiNotHaveSeList = _settleAccountDbContext.Set().Where(t => t.IsHaveSeData == false) - .GroupBy(t => new { t.LU, t.PN }) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => new JisBBACEidSeCompareExport() { Category = "JIS", @@ -86,7 +86,7 @@ namespace SettleAccount.Job.Services.Report SequenceNumber = t.Max(t => t.Extend3), ParType = t.Max(t => t.Extend2), PN = t.Key.PN, - MaterialNumber = t.Key.LU, + MaterialNumber = t.Max(t => t.LU), EdiQty = t.Sum(t => t.Qty), AssemblyDate = default, MatchNumber = default, @@ -95,7 +95,7 @@ namespace SettleAccount.Job.Services.Report }).ToList(); //无EDI有发运 var notHaveEdiHaveSeList = _settleAccountDbContext.Set().Where(t => t.IsHaveEdiData == false) - .GroupBy(t => new { t.CustomerPartCodeNoSpace, t.PN }) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => new JisBBACEidSeCompareExport() { Category = "JIS", @@ -115,11 +115,11 @@ namespace SettleAccount.Job.Services.Report //有EDI有发运 var ediGroup = from edi in _settleAccountDbContext.Set() where edi.IsDeleted == false && edi.IsHaveSeData == true - group edi by new { edi.PN, edi.LU } into groupItem + group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { groupItem.Key.PN, - groupItem.Key.LU, + groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), Extend2 = groupItem.Max(t => t.Extend2), Extend3 = groupItem.Max(t => t.Extend3), @@ -146,7 +146,7 @@ namespace SettleAccount.Job.Services.Report }; var haveEdiHaveSeList = (from edi in ediGroup join se in seGroup - on new { edi.PN, edi.LU } equals new { se.PN, LU = se.CustomerPartCodeNoSpace } + on new { edi.PN, edi.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } select new JisBBACEidSeCompareExport() { Category = "JIS", 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 8a7fe7ab..3ca8f1fd 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 @@ -164,16 +164,17 @@ namespace SettleAccount.Job.Services.Report //Edi var ediGroup = from edi in _settleAccountDbContext.Set() where edi.IsDeleted == false && edi.IsHaveSeData == true - group edi by new { edi.PN, edi.LU } into groupItem + group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { groupItem.Key.PN, - groupItem.Key.LU, - Qty = groupItem.Sum(t => t.Qty) + groupItem.Key.CustomerPartCodeNoSpace, + 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, CustomerPartCodeNoSpace = edi.LU } + on new { se.PN, se.CustomerPartCodeNoSpace } equals new { edi.PN, edi.CustomerPartCodeNoSpace } into ediTemp from edi in ediTemp.DefaultIfEmpty() select new diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs index d095c8bb..58fef3a4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs @@ -74,7 +74,7 @@ namespace SettleAccount.Job.Services.Report //有EDI无发运 var haveEdiNotHaveSeList = _settleAccountDbContext.Set().Where(t => t.IsHaveSeData == false) - .GroupBy(t => new { t.LU, t.PN }) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => new JisHBPOEidSeCompareExport() { Category = "JIS", @@ -83,7 +83,7 @@ namespace SettleAccount.Job.Services.Report SequenceNumber = t.Max(t => t.SeqNumber), ParType = "01", PN = t.Key.PN, - MaterialNumber = t.Key.LU, + MaterialNumber = t.Max(t => t.LU), EdiQty = t.Sum(t => t.Qty), AssemblyDate = default, MatchNumber = default, @@ -92,7 +92,7 @@ namespace SettleAccount.Job.Services.Report }).ToList(); //无EDI有发运 var notHaveEdiHaveSeList = _settleAccountDbContext.Set().Where(t => t.IsHaveEdiData == false) - .GroupBy(t => new { t.CustomerPartCodeNoSpace, t.PN }) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => new JisHBPOEidSeCompareExport() { Category = "JIS", @@ -114,11 +114,11 @@ namespace SettleAccount.Job.Services.Report //有EDI有发运 var ediGroup = from edi in _settleAccountDbContext.Set() where edi.IsDeleted == false && edi.IsHaveSeData == true - group edi by new { edi.PN, edi.LU } into groupItem + group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { groupItem.Key.PN, - groupItem.Key.LU, + groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), SeqNumber = groupItem.Max(t => t.SeqNumber) }; @@ -143,7 +143,7 @@ namespace SettleAccount.Job.Services.Report }; var haveEdiHaveSeList = (from edi in ediGroup join se in seGroup - on new { edi.PN, edi.LU } equals new { se.PN, LU = se.CustomerPartCodeNoSpace } + on new { edi.PN, edi.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } select new JisHBPOEidSeCompareExport() { Category = "JIS", 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 ad469c7a..84dc1bf8 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 @@ -4,10 +4,10 @@ using EFCore.BulkExtensions; using Magicodes.ExporterAndImporter.Core.Extension; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.SignalR; +using Microsoft.EntityFrameworkCore; using SettleAccount.Bases; using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; -using Volo.Abp; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Consts; using Win.Sfs.SettleAccount.Enums; @@ -184,9 +184,10 @@ namespace SettleAccount.Job.Services.Report if (haveSaHaveSes.Any()) { //结算详情 - var saDetails = (from sa in _settleAccountDbContext.Set() - where sa.BusinessType == businessType && sa.Version == version - select sa).ToList(); + var saDetails = _settleAccountDbContext.Set() + .Where(t => t.BusinessType == businessType) + .Where(t => t.Version == version) + .ToList(); if (saDetails.Any()) { var saDetailsUpdate = saDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, LU = i.CustomerPartCode }, (o, i) => @@ -202,6 +203,8 @@ namespace SettleAccount.Job.Services.Report return o; }).ToList(); _settleAccountDbContext.BulkUpdate(saDetailsUpdate); + _settleAccountDbContext.Set().FromSqlInterpolated($"SELECT * FROM dbo.Blogs"); + _settleAccountDbContext.Database.ExecuteSqlInterpolated($"SELECT * FROM dbo.Blogs"); } } } From ae12b726f1a7f874331cb6adbdc9c2cd6b5c0afb Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 6 Sep 2023 16:31:43 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Prices/PriceListDtoBase.cs | 8 ++++---- .../Entities/Prices/PriceListAppService.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs index 17cac9b8..ed086fb5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs @@ -133,7 +133,7 @@ public class PriceListImportDto /// [Display(Name = "零件号")] [Required(ErrorMessage = "{0}是必填项")] - [ImporterHeader(Name = "*Part No.")] + [ImporterHeader(Name = "Part No.")] public string PartNo { get; set; } /// /// 价格 @@ -143,17 +143,17 @@ public class PriceListImportDto /// /// 开始时间 /// - [ImporterHeader(Name = "*Valid From")] + [ImporterHeader(Name = "Valid From")] public DateTime ValidFrom { get; set; } /// /// 结束时间 /// - [ImporterHeader(Name = "*Valid To")] + [ImporterHeader(Name = "Valid To")] public DateTime ValidTo { get; set; } /// /// 客户编码 /// - [ImporterHeader(Name = "*Plant")] + [ImporterHeader(Name = "Plant")] public string Plant { get; set; } /// /// ES1 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index 5b3dfb58..f2c77895 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -77,7 +77,7 @@ public class PriceListAppService : SettleAccountApplicationBase _checkls.Add("1046"); _checkls.Add("104T"); result = result.Where(p => _checkls.Contains(p.Plant)).ToList(); - result.ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2); + result.Where(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2); var entityList = ObjectMapper.Map, List>(result); entityList = entityList.GroupBy(p => new { p.LU, p.ClientCode, p.BeginTime, p.EndTime }).Select(p => p.FirstOrDefault()).ToList(); From 2b11e1d66ea68dfcc6f699e24bf90a0671e3124f Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 7 Sep 2023 09:18:20 +0800 Subject: [PATCH 03/13] update --- .../SettleAccount.HttpApi.Host/Program.cs | 10 +++---- .../wwwroot/components/list/index.js | 6 +++- .../wwwroot/models/base-data/xiao-shou.js | 30 +++++++++++++++++++ .../wwwroot/models/settle/detail.js | 18 +++++++++++ 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs index 86eecc29..679ab321 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs @@ -1,5 +1,4 @@ using System; -using System.IO; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; @@ -13,20 +12,21 @@ public class Program { var configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true); + .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true) + .Build(); Log.Logger = new LoggerConfiguration() - .WriteTo.Async(c => c.File(Path.Combine(Directory.GetCurrentDirectory(), "../Logs/logs.txt") + .WriteTo.Async(c => c.Console()) + .WriteTo.Async(c => c.File("Logs/logs.txt" , rollingInterval: RollingInterval.Day , rollOnFileSizeLimit: true , fileSizeLimitBytes: 30 * 1024 * 1024)) - .WriteTo.Async(c => c.Console()) .CreateLogger(); try { Log.Information("Starting web host."); - CreateHostBuilder(args).Build().Run(); + CreateHostBuilder(args).UseSerilog().Build().Run(); return 0; } catch (Exception ex) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js index 48afc6ce..48539e4d 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js @@ -92,7 +92,7 @@ export default {