From 673cfd4e05b399bf6c78649d90ed25ce0100464c Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 20 Dec 2023 08:34:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8F=91=E8=BF=90=E4=B8=8EEDI=E6=AF=94?= =?UTF-8?q?=E5=AF=B9=E5=A2=9E=E5=8A=A0=E5=8F=91=E8=BF=90=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reports/SeEidCompareReport.cs | 4 +-- .../Report/SeEdiCompareExportBaseService.cs | 30 +++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs index 500cd839..456fcef1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs @@ -92,7 +92,7 @@ namespace Win.Sfs.SettleAccount.Reports /// [Display(Name = "发货日期")] [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] - public DateTime? ShippingDate { get; set; } + public DateTime? ShippingDate { get; set; } /// /// 序列号 /// @@ -122,7 +122,7 @@ namespace Win.Sfs.SettleAccount.Reports /// [Display(Name = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] - public DateTime? AssemblyDate { get; set; } + public DateTime? AssemblyDate { get; set; } /// /// 小总成号 /// 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 f532398e..2cac1829 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 @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using Magicodes.ExporterAndImporter.Core.Extension; @@ -10,6 +11,7 @@ using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Consts; +using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Reports; namespace SettleAccount.Job.Services.Report @@ -58,7 +60,7 @@ namespace SettleAccount.Job.Services.Report maxRowNumberOnASheet = excelExporterAttribute.MaxRowNumberOnASheet > 0 ? excelExporterAttribute.MaxRowNumberOnASheet : maxRowNumberOnASheet; } //有EDI无发运 - var haveEdiNotHaveSeList = _settleAccountDbContext.Set().Where(t => t.IsHaveSeData == false) + var haveEdiNotHaveSeList = _settleAccountDbContext.Set().Where(t => t.IsHaveSeData == false && t.State==0) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => new TCompareReport() { @@ -79,9 +81,25 @@ namespace SettleAccount.Job.Services.Report t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber); t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : ""; }); + + List proType = new List(); + proType.Add(EnumProTpe.Jit发货); + proType.Add(EnumProTpe.Jit补发订单); + proType.Add(EnumProTpe.Jis发货); + proType.Add(EnumProTpe.Jis补发订单); + proType.Add(EnumProTpe.Jit备件); + proType.Add(EnumProTpe.Jis备件); + proType.Add(EnumProTpe.Jit买单件); + proType.Add(EnumProTpe.Jis买单件); + proType.Add(EnumProTpe.无); + + + //无EDI有发运 var notHaveEdiHaveSeList = _settleAccountDbContext.Set() .Where(t => t.BusinessType == businessType && t.BillTime >= seStartDateTime && t.BillTime <= seEndDateTime) + .Where(t=>t.State==0) + .Where(t => proType.Contains(t.ProType)) .Where(t => t.IsHaveEdiData == false) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => new TCompareReport() @@ -89,7 +107,7 @@ namespace SettleAccount.Job.Services.Report Category = "JIS", WmsBillNum = t.Max(t => t.BillNum), MESConfigCode = t.Max(t => t.MESConfigCode), - ShippingDate = t.Max(t => t.BillTime), + ShippingDate = t.Max(t => t.BillTime), PN = t.Max(t => t.PN), Seq = t.Max(t => t.Seq), PjsNum = t.Max(t => t.PjsNum), @@ -103,7 +121,7 @@ namespace SettleAccount.Job.Services.Report }).ToList(); //有EDI有发运 var ediGroup = from edi in _settleAccountDbContext.Set() - where edi.IsDeleted == false && edi.IsHaveSeData == true + where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0 group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { @@ -116,7 +134,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 + where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && proType.Contains(se.ProType) group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { @@ -126,7 +144,7 @@ namespace SettleAccount.Job.Services.Report LU = groupItem.Max(t => t.LU), BillNum = groupItem.Max(t => t.BillNum), MESConfigCode = groupItem.Max(t => t.MESConfigCode), - BillTime = groupItem.Max(t => t.BillTime), + BillTime = groupItem.Max(t => t.BillTime), Seq = groupItem.Max(t => t.Seq), PjsNum = groupItem.Max(t => t.PjsNum), ToLoc = groupItem.Max(t => t.ToLoc), @@ -147,7 +165,7 @@ namespace SettleAccount.Job.Services.Report SequenceNumber = edi.Extend3, ParType = edi.Extend2, MESConfigCode = se.MESConfigCode, - ShippingDate = se.BillTime, + ShippingDate = se.BillTime, PN = se.PN, Seq = se.Seq, PjsNum = se.PjsNum, From f1a163f5a6e3f75f9caee6d047295c79c0ad39f7 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 20 Dec 2023 10:09:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9EXCEL=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/BA_SERVICE.cs | 19 +++++++++-------- .../Bases/CurdBaseAppService.cs | 21 ++++++++++--------- .../Bases/PD_SERVICE.cs | 20 ++++++++++-------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index 47beae43..da208b2d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -389,15 +389,16 @@ namespace Win.Sfs.SettleAccount.Bases 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; - } + //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(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); //保存导出文件到服务器存成二进制 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs index 08a22bc9..07322a52 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Reflection; @@ -73,15 +73,16 @@ namespace Win.Sfs.SettleAccount.Bases 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; - } + //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(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); //保存导出文件到服务器存成二进制 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs index 02c75ed1..bd000b44 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -114,15 +114,17 @@ namespace Win.Sfs.SettleAccount.Bases 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; - } + //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(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); //保存导出文件到服务器存成二进制