From 20650235a9b19f7dc48652ebdb635cf0d6247686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 25 Nov 2024 16:13:47 +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/BQ/PUB_CAN_SA_SERVICE.cs | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs index 92e37924..6214819b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs @@ -1,14 +1,25 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.LinqAsync; +using System.Reflection; using System.Threading.Tasks; +using DocumentFormat.OpenXml.Drawing; +using DocumentFormat.OpenXml.Office2010.Excel; +using DocumentFormat.OpenXml.Office2010.ExcelAc; +using DocumentFormat.OpenXml.Spreadsheet; using EFCore.BulkExtensions; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Csv; +using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Omu.ValueInjecter; using SettleAccount.Domain.BQ; +using Shouldly; using Volo.Abp; +using Volo.Abp.BlobStoring; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; @@ -19,8 +30,11 @@ using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Temp; +using Win.Sfs.SettleAccount.Entities.MaterialRelationships; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.ExportReports; +using Win.Sfs.SettleAccount.MaterialRelationships; +using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ @@ -49,6 +63,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly INormalEfCoreRepository _notRepository; private readonly INormalEfCoreRepository _saRepository; + private readonly IBlobContainer _fileContainer; public PUB_CAN_SA_SERVICE @@ -65,7 +80,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BaseDomainService baseservice, INormalEfCoreRepository notRepository, INormalEfCoreRepository priceYinDuRepository, - INormalEfCoreRepository saRepository + INormalEfCoreRepository saRepository, + IBlobContainer fileContainer ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng, baseservice) { @@ -75,6 +91,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _notRepository = notRepository; _priceYinDuRepository= priceYinDuRepository; _saRepository= saRepository; + } [HttpPost] [UnitOfWork(false)] @@ -96,14 +113,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var priceListbj = _pricebjRepository.ToList();//价格单 foreach (var itm in priceListbj) { - priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo }); + if (itm.IsCancel == false) + { + priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo }); + } } break; case EnumBusinessType.YinDuJian: var priceListYindu = _priceYinDuRepository.ToList();//价格单 foreach (var itm in priceListYindu) { - priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo }); + if (itm.IsCancel == false) + { + priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo }); + } } break; @@ -161,8 +184,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); entitys = entitys.OrderBy(p => p.IndexNum).ToList(); var dto1s = ObjectMapper.Map, List>(entitys); + + + + + var q = from d in dto1s - join p in priceList on d.LU equals p.LU + join p in priceList + + on d.LU equals p.LU where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == main.Site select new TEMP_CAN_SA_DETAIL {