From 9eca57d68b8b54cfe0c037c397636b3ab9d7ac22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 9 Nov 2023 15:12:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0BBAC=20HBPO=20=E6=A0=B8?= =?UTF-8?q?=E5=AF=B9=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index f3999f19..7b98b74e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -24,6 +24,7 @@ using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.Entities.TaskJobs; +using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ @@ -48,6 +49,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly INormalEfCoreRepository _notRepository; private readonly INormalEfCoreRepository _priceRepository; + private readonly INormalEfCoreRepository _saRepository; private readonly TaskJobService _service; @@ -57,6 +59,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public BBAC_CAN_SA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, + INormalEfCoreRepository saRepository, INormalEfCoreRepository repository, INormalEfCoreRepository detailRepository, INV_MNG invmng, @@ -72,6 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _notRepository = notRepository; _bbacMng = bbacMng; _priceRepository = priceRepository; + _saRepository = saRepository; } /// @@ -97,17 +101,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var entitys = await _bbacMng.GetDetalListAsync(invbillNum).ConfigureAwait(false);//可结算 + List errors = new List(); + var settleBillList = entitys.Select(p => p.SettleBillNum).Distinct().ToList(); + var checklist = _saRepository.Where(p => settleBillList.Contains(p.BillNum)).ToList(); + var jischeck = checklist.Where(p => p.State == "0").ToList(); - - - - - - - - - + foreach (var itm in jischeck) + { + errors.Add(new ERR_EXP_DTO() { Remark = $"版本:{itm.Version},结算单:{itm.BillNum}+JIS业务没进行报表核对!" }); + } + var mcheck = checklist.Where(p => p.StateOther == "0").ToList(); + foreach (var itm in mcheck) + { + errors.Add(new ERR_EXP_DTO() { Remark = $"版本:{itm.Version},结算单:{itm.BillNum}+买单业务没进行报表核对!" }); + } + if (errors.Count > 0) + { + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errors).ConfigureAwait(false) }); + } var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); //价格单 var errorList = await CheckInvoiceGenerationRules(entitys, main.Site, priceList, main.BusinessType).ConfigureAwait(false);//校验生成规则