From 668f2abe46c3b44d2f38c08d65c17640043baf3f Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 2 Jan 2022 16:01:36 +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 | 29 +++++++++++++++++-- .../SharePartUnSettledDapperRepository.cs | 22 +++++++------- .../Report/SharePartUnSettledExport.cs | 22 +++++++------- .../SettleAccountJobModule.cs | 7 ++++- 5 files changed, 54 insertions(+), 28 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 e0873952..b91cfc52 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -179,8 +179,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// [HttpPost] [Route("WmsSharePartOutPut")] - - public async Task WmsSharePartOutPut(WmsJitRequestDto input) { var _billNum = "B" + DateTime.Now.ToString("yyyyMMddhhmmss"); 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 f71ebce7..3d8f9d2b 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -214,7 +214,30 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices #endregion + + [HttpGet] + [Route("SettleSparePartExport")] + [DisableRequestSizeLimit] + public async Task SharePartUnSettled( string sapCode, string version, + DateTime begin, DateTime end) + { + + List customConditionList = new List(); + customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty }); + + customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty }); + + + customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() }); + customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() }); + + var _taskid = await _service.ExportEnqueueAsync("备件未结对比", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SharePartUnSettledExport), customConditionList, (rs) => + { + + }); + return _taskid; + } @@ -234,7 +257,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices //[HttpGet] //[Route("UnSettledDiff-Make")] //[DisableRequestSizeLimit] - + //public async Task UnSettledMake(string year, string period, string version, string customerCode, string factory, string matialCode, string state,DateTime begin,DateTime end) //{ @@ -272,7 +295,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices //[HttpGet] //[Route("FisUnSettledDiff-Make")] //[DisableRequestSizeLimit] - + //public async Task FisUnSettledMake(string year, string version, string customerCode, string factory, string state) //{ @@ -302,7 +325,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices //[HttpGet] //[Route("PriceQtyDiff-Make")] //[DisableRequestSizeLimit] - + //public async Task PriceQtyDiffMake(string year, string version, string customerCode, string factory, string state) //{ // //if (!_invoiceVersionRepository.Any(p => p.Version == version)) diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SharePartUnSettledDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SharePartUnSettledDapperRepository.cs index 3bf41843..9fe7b358 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SharePartUnSettledDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SharePartUnSettledDapperRepository.cs @@ -18,26 +18,26 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public class SharePartUnSettled { [ExporterHeader(DisplayName = "交货单号")] - public string WMSDeliveryNote {set;get;} + public string WMSDeliveryNote { set; get; } [ExporterHeader(DisplayName = "发货日期")] - public string OrderDate {set;get;} + public string OrderDate { set; get; } [ExporterHeader(DisplayName = "订单编号")] - public string PurchaseOrderNo {set;get;} + public string PurchaseOrderNo { set; get; } [ExporterHeader(DisplayName = "物料编码")] - public string SAPCode {set;get;} + public string SAPCode { set; get; } [ExporterHeader(DisplayName = "客户物料号")] - public string MaterialCode {set;get;} + public string MaterialCode { set; get; } [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDesc {set;get;} + public string MaterialDesc { set; get; } [ExporterHeader(DisplayName = "物料组(车型)")] - public string MaterilGroup {set;get;} + public string MaterilGroup { set; get; } [ExporterHeader(DisplayName = "发货数量")] //public string PurchaseOrderNoText {set;get;} - public decimal Qty {set;get;} + public decimal Qty { set; get; } [ExporterHeader(DisplayName = "收货数量")] - public decimal ReceiptQty {set;get;} + public decimal ReceiptQty { set; get; } [ExporterHeader(DisplayName = "数量差异")] - public decimal DiffQty {set;get;} + public decimal DiffQty { set; get; } [ExporterHeader(DisplayName = "单价")] public decimal Price { set; get; } [ExporterHeader(DisplayName = "差异金额")] @@ -106,7 +106,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { } - public virtual List GetKanbanReportList( string version, string begintime, string endtime) + public virtual List GetOrderSharePartReportList( string version, string begintime, string endtime) { var sql = "SELECT\n" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SharePartUnSettledExport.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SharePartUnSettledExport.cs index 23098a45..1a97aec5 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SharePartUnSettledExport.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SharePartUnSettledExport.cs @@ -18,10 +18,10 @@ namespace SettleAccount.Job.Services.Report { private readonly OutputService _outputService; - KanbanUnSettledDapperRepository _dapper; + SharePartUnSettledDapperRepository _dapper; private readonly IBlobContainer _fileContainer; - public SharePartUnSettledExport(KanbanUnSettledDapperRepository dapper, OutputService outputService, + public SharePartUnSettledExport(SharePartUnSettledDapperRepository dapper, OutputService outputService, IBlobContainer fileContainer ) @@ -46,14 +46,14 @@ namespace SettleAccount.Job.Services.Report var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; - var _ls = _dapper.GetKanbanReportList(version, begin,end); - var _lst = _dapper.GetNoKanbanReportList(version, begin, end); + var _ls = _dapper.GetOrderSharePartReportList(version, begin,end); + var _lst = _dapper.GetNoOrderSharePartReportList(version, begin, end); if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); if (_groupList.Count() > 0) { - _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); + _ls = _ls.Where(p => _groupList.Contains(p.MaterilGroup)).ToList(); } } if (!string.IsNullOrEmpty(materialCode)) @@ -61,7 +61,7 @@ namespace SettleAccount.Job.Services.Report var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); if (_groupList.Count() > 0) { - _ls = _ls.Where(p => _groupList.Contains(p.CustomerPartCode)).ToList(); + _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } } if (!string.IsNullOrEmpty(sapCode)) @@ -69,7 +69,7 @@ namespace SettleAccount.Job.Services.Report var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); if (_groupList.Count() > 0) { - _ls = _ls.Where(p => _groupList.Contains(p.SapCode)).ToList(); + _ls = _ls.Where(p => _groupList.Contains(p.SAPCode)).ToList(); } } if (!string.IsNullOrEmpty(materialGroup)) @@ -77,7 +77,7 @@ namespace SettleAccount.Job.Services.Report var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); if (_groupList.Count() > 0) { - _lst = _lst.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); + _lst = _lst.Where(p => _groupList.Contains(p.MaterilGroup)).ToList(); } } if (!string.IsNullOrEmpty(materialCode)) @@ -93,13 +93,13 @@ namespace SettleAccount.Job.Services.Report var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); if (_groupList.Count() > 0) { - _lst = _lst.Where(p => _groupList.Contains(p.SapCode)).ToList(); + _lst = _lst.Where(p => _groupList.Contains(p.SAPCode)).ToList(); } } ExcelExporter _exporter = new ExcelExporter();//导出Excel - var result = _exporter.Append(_ls.ToList(), "有看板号未结差异对比") + var result = _exporter.Append(_ls.ToList(), "备件未结差异对比") .SeparateBySheet() - .Append(_lst.ToList(), "无看板号未结差异对比") + .Append(_lst.ToList(), "备件未结差异对比(无订单号)") .ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs index 5de1afde..9d5e54b8 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs @@ -144,9 +144,14 @@ namespace Win.Sfs.SettleAccount { return implementationFactory.GetService(); } + if (key.Equals(typeof(SharePartUnSettledExport).FullName)) + { + return implementationFactory.GetService(); + } + + - else {