From c9b57ae7e7bf6c53c5d00a371326f581b57b2961 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 6 May 2022 10:38:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E6=9D=83=E9=99=90=E5=88=86?= =?UTF-8?q?=E9=85=8D=E9=97=AE=E9=A2=98=EF=BC=8C=E6=9B=B4=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E5=90=8E=E7=AB=AFBOM=E5=AE=9A=E4=BB=B7=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Prices/PriceListAppService.cs | 44 ++++++++++++++- .../ReportServices/ReportMakeService.cs | 54 +++++++++---------- .../HQHSettledDetailDapperRepository.cs | 8 +-- 3 files changed, 74 insertions(+), 32 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index faa6e17c..05f553fc 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -4,17 +4,21 @@ using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using SettleAccount.Job.Services.Report; using Shouldly; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using TaskJob.EventArgs; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Uow; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.ImportMap; +using Win.Sfs.SettleAccount.Entities.TaskJobs; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.Filter; @@ -32,15 +36,53 @@ namespace Win.Sfs.SettleAccount.Entities.Prices private readonly PriceListManager _mng; private readonly IExcelImportAppService _excelImportService; private readonly ISettleAccountBranchEfCoreRepository _mapRepository; + private readonly TaskJobService _service; public PriceListAppService( IExcelImportAppService excelImportService, ISettleAccountBranchEfCoreRepository mapRepository, - PriceListManager mng + PriceListManager mng, + TaskJobService service ) { _mapRepository = mapRepository; _excelImportService = excelImportService; _mng = mng; + _service = service; + } + + /// + /// 结算总成和ERP总成价格对比 + /// + /// 上传的文件(前端已经限制只能上传一个附件) + /// + [HttpGet] + [Route("BomDiffPrice-Make")] + [DisableRequestSizeLimit] + [Authorize(SettleAccountPermissions.PriceLists.Default)] + + public async Task SettledPartAndErpPartPriceDiffMake(string version, string customerCode) + { + + List customConditionList = new List(); + + customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" }); + customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version }); + customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode) ? string.Empty : customerCode }); + + var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) => + { + + }); + return _taskid; + } + + [HttpPost] + [Route("job/list")] + [Authorize(SettleAccountPermissions.PriceLists.Default)] + [UnitOfWork(false)] + virtual public async Task> GetListAsync(JobRequestDto input) + { + return await _service.GetListAsync(input); } /// 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 a46ff900..c6d5e803 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -352,39 +352,39 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices } - /// - /// 结算总成和ERP总成价格对比 - /// - /// 上传的文件(前端已经限制只能上传一个附件) - /// - [HttpGet] - [Route("BomDiffPrice-Make")] - [DisableRequestSizeLimit] + ///// + ///// 结算总成和ERP总成价格对比 + ///// + ///// 上传的文件(前端已经限制只能上传一个附件) + ///// + //[HttpGet] + //[Route("BomDiffPrice-Make")] + //[DisableRequestSizeLimit] - public async Task SettledPartAndErpPartPriceDiffMake(string version, string customerCode) - { + //public async Task SettledPartAndErpPartPriceDiffMake(string version, string customerCode) + //{ - //if (!_relationshipRepository.Any(p => p.Version == version && p.CustomerCode == customerCode)) - //{ - // throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version)); - //} - //if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode)) - //{ - // throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version)); - //} + // //if (!_relationshipRepository.Any(p => p.Version == version && p.CustomerCode == customerCode)) + // //{ + // // throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version)); + // //} + // //if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode)) + // //{ + // // throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version)); + // //} - List customConditionList = new List(); + // List customConditionList = new List(); - customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" }); - customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version }); - customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode)?string.Empty: customerCode }); + // customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" }); + // customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version }); + // customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode)?string.Empty: customerCode }); - var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) => - { + // var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) => + // { - }); - return _taskid; - } + // }); + // return _taskid; + //} diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs index 1c96c304..c68ce3a3 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs @@ -280,7 +280,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //var listCompare = DbConnection.Query(sql2); - var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner]", null, null, true, 1200, CommandType.StoredProcedure); + var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); @@ -299,7 +299,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //"WHERE\n" + //" B.Kanban IS NULL"; - var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin]", null, null, true, 1200, CommandType.StoredProcedure); + var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); @@ -827,10 +827,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _query = DbConnection.Query("[dbo].[p_hq_unsettle_weijie]", new { begin = begin, end = end, version = version, iscontionversion = iscontionversion }, null, true, 1200, CommandType.StoredProcedure); _list = _query.ToList(); - var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner]", null, null, true, 1200, CommandType.StoredProcedure); + var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); - var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin]", null, null, true, 1200, CommandType.StoredProcedure); + var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); //发运数据比较