From 14fc9b464412492deb45bbe62244af25c7698d32 Mon Sep 17 00:00:00 2001 From: Administrator Date: Mon, 14 Feb 2022 12:59:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WMSSharePartAppService.cs | 2 +- .../ReportServices/ReportMakeService.cs | 18 +--- .../SettleAccount.Application.xml | 2 +- .../Entities/UnSettle/UnSettleDetailReport.cs | 12 +-- .../Report/UnSettleDiffExportService.cs | 99 ++++++++++++++++--- 5 files changed, 95 insertions(+), 38 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index ff2bbb9e..f5f333de 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -482,7 +482,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts string.Empty, string.Empty, 0, - !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty, + !string.IsNullOrEmpty(itm.Extend1) ?itm.Extend1 : string.Empty, string.Empty, version, itm.ParentMaterialCode, diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index 4847fe52..52daed0e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -400,28 +400,12 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(request.ChassisNumber) ? string.Empty : request.ChassisNumber }); customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup }); customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(request.SapCode) ? string.Empty : request.SapCode }); - - - - - var _taskid = await _service.ExportEnqueueAsync("", ExportExtentsion.Excel, request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) => { }); return _taskid; } - - - - - - - - - - - /// ///发票与结算核对明细表 /// @@ -554,7 +538,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices } /// - ///准时化未结差异比对表 + ///统计汇总表 /// /// 上传的文件(前端已经限制只能上传一个附件) /// diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 7a7dd139..6f7a7b76 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -3894,7 +3894,7 @@ - 准时化未结差异比对表 + 统计汇总表 上传的文件(前端已经限制只能上传一个附件) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs index 0fdeeaff..3ece8c63 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs @@ -1,4 +1,5 @@ using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; using System; using System.Collections.Generic; using System.Linq; @@ -8,9 +9,11 @@ using Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Entities.UnSettle { + + + [ExcelExporter( MaxRowNumberOnASheet = 900000)] public class UnSettleDetailReport:ReportDetailBase { - [ExporterHeader(DisplayName = "交货单号 ")] public override string WmsBillNum { set; get; } [ExporterHeader(DisplayName = "实际发货日期 ")] @@ -37,25 +40,18 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle public override decimal Price { set; get; } [ExporterHeader(DisplayName = "金额 ")] public override decimal Amt { set; get; } - - [ExporterHeader(DisplayName = "结算日期",IsIgnore =true)] public override DateTime CP7Time { set; get; } [ExporterHeader(DisplayName = "开票单价",IsIgnore =true)] public override decimal InvoicePrice { set; get; } - [ExporterHeader(DisplayName = "结算平台未结数量 ")] public decimal Qty { set; get; } - [ExporterHeader(DisplayName = "大众R3未结数量")] public decimal UnSettleQty { set; get; } - - [ExporterHeader(DisplayName = "差异金额")] public decimal DiffAMT { set; get; } [ExporterHeader(DisplayName = "差异数量")] public decimal DiffQty { set; get; } - [ExporterHeader(DisplayName = "漏结标识 ")] public string Flag { set; get; } [ExporterHeader(DisplayName = "漏结期间 ")] diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs index 2cf4ebe6..76c4b6eb 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs @@ -220,22 +220,99 @@ namespace SettleAccount.Job.Services.Report // DiffAmt = p.Sum(p => p.DiffAMT) // }); + if (_ls1.Count() > 900000) + { + if (_ls1.Count() > 2700000) + { + var _lsSheet1 = _ls1.Skip(0 * 900000).Take(900000); + var _lsSheet2 = _ls1.Skip(1* 900000).Take(900000); + var _lsSheet3 = _ls1.Skip(2 * 900000).Take(900000); + var _lsSheet4 = _ls1.Skip(3 * 900000).Take(900000); + ExcelExporter _exporter = new ExcelExporter();//导出Excel + var result = _exporter.Append(_ls, "R3大众未结对比系统未结") + .SeparateBySheet() + .Append(_lsSheet2.ToList(), "系统未结对比R3大众未结(第1页)") + .SeparateBySheet() + .Append(_lsSheet2.ToList(), "系统未结对比R3大众未结(第2页)") + .SeparateBySheet() + .Append(_lsSheet3.ToList(), "系统未结对比R3大众未结(第3页)") + .SeparateBySheet() + .Append(_lsSheet3.ToList(), "系统未结对比R3大众未结(第4页)") + .SeparateBySheet() + .Append(_lsSum.ToList(), "大众R3未结对比结算系统差异汇总") + .SeparateBySheet() + .Append(_lsSum1.ToList(), "结算系统对比大众R3未结差异汇总") + .ExportAppendDataAsByteArray(); + result.ShouldNotBeNull(); + _fileContainer.SaveAsync(_first, result.Result, true); + - ExcelExporter _exporter = new ExcelExporter();//导出Excel - var result = _exporter.Append(_ls, "R3大众未结对比系统未结") - .SeparateBySheet() - .Append(_ls1.ToList(),"系统未结对比R3大众未结") - .SeparateBySheet() - .Append(_lsSum.ToList(), "大众R3未结对比结算系统差异汇总") - .SeparateBySheet() - .Append(_lsSum1.ToList(),"结算系统对比大众R3未结差异汇总") - .ExportAppendDataAsByteArray(); - result.ShouldNotBeNull(); - _fileContainer.SaveAsync(_first, result.Result, true); + } + else + { + if (_ls1.Count() > 18000000) + { + var _lsSheet1 = _ls1.Skip(0 * 900000).Take(900000); + var _lsSheet2 = _ls1.Skip(1 * 900000).Take(900000); + var _lsSheet3 = _ls1.Skip(2 * 900000).Take(900000); + ExcelExporter _exporter = new ExcelExporter();//导出Excel + var result = _exporter.Append(_ls, "R3大众未结对比系统未结") + .SeparateBySheet() + .Append(_lsSheet2.ToList(), "系统未结对比R3大众未结(第1页)") + .SeparateBySheet() + .Append(_lsSheet2.ToList(), "系统未结对比R3大众未结(第2页)") + .SeparateBySheet() + .Append(_lsSheet3.ToList(), "系统未结对比R3大众未结(第3页)") + .SeparateBySheet() + .Append(_lsSum.ToList(), "大众R3未结对比结算系统差异汇总") + .SeparateBySheet() + .Append(_lsSum1.ToList(), "结算系统对比大众R3未结差异汇总") + .ExportAppendDataAsByteArray(); + result.ShouldNotBeNull(); + _fileContainer.SaveAsync(_first, result.Result, true); + + } + else + { + var _lsSheet1 = _ls1.Skip(0 * 900000).Take(900000); + var _lsSheet2 = _ls1.Skip(1 * 900000).Take(900000); + ExcelExporter _exporter = new ExcelExporter();//导出Excel + var result = _exporter.Append(_ls.ToList(), "R3大众未结对比系统未结") + .SeparateBySheet() + .Append(_lsSheet1.ToList(), "系统未结对比R3大众未结(第1页)") + .SeparateBySheet() + .Append(_lsSheet2.ToList(), "系统未结对比R3大众未结(第2页)") + .SeparateBySheet() + .Append(_lsSum.ToList(), "大众R3未结对比结算系统差异汇总") + .SeparateBySheet() + .Append(_lsSum1.ToList(), "结算系统对比大众R3未结差异汇总") + .ExportAppendDataAsByteArray(); + result.ShouldNotBeNull(); + _fileContainer.SaveAsync(_first, result.Result, true); + + + } + } + } + else + { + + ExcelExporter _exporter = new ExcelExporter();//导出Excel + var result = _exporter.Append(_ls, "R3大众未结对比系统未结") + .SeparateBySheet() + .Append(_ls1.ToList(), "系统未结对比R3大众未结") + .SeparateBySheet() + .Append(_lsSum.ToList(), "大众R3未结对比结算系统差异汇总") + .SeparateBySheet() + .Append(_lsSum1.ToList(), "结算系统对比大众R3未结差异汇总") + .ExportAppendDataAsByteArray(); + result.ShouldNotBeNull(); + _fileContainer.SaveAsync(_first, result.Result, true); + } return id.ToString();