From daa41783a112e9c636caf95b9c94d35ee01c3a4c Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 11 Oct 2023 14:49:34 +0800 Subject: [PATCH] =?UTF-8?q?[CI=20SKIP]=20=E5=8D=B0=E5=BA=A6=E4=BB=B6?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E5=8D=95=E8=BF=87=E6=BB=A4=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E4=B8=BA1041=20=E5=8D=B0=E5=BA=A6=E4=BB=B6?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=AF=BC=E5=85=A5=E4=BD=BF=E7=94=A8=E5=8D=B0?= =?UTF-8?q?=E5=BA=A6=E4=BB=B6=E4=BB=B7=E6=A0=BC=E5=8D=95=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/PUB_SA_SERVICE.cs | 24 +++++++++++++++++++ .../Prices/PriceListAppServiceYinDu.cs | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs index c641c170..09354e02 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs @@ -68,6 +68,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// private readonly INormalEfCoreRepository _priceBjListRepository; /// + /// 印度价格仓储 + /// + private readonly INormalEfCoreRepository _priceYinDuListRepository; + /// /// 客户零件关系仓储 /// private readonly INormalEfCoreRepository _materialRelationshipRepository; @@ -87,6 +91,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INormalEfCoreRepository pubNotSaDetailRepository, INormalEfCoreRepository priceListRepository, INormalEfCoreRepository priceBjListRepository, + INormalEfCoreRepository priceYinDuListRepository, INormalEfCoreRepository materialRelationshipRepository, INormalEfCoreRepository tbRePartsRelationshipRepository, IDistributedCache cache, @@ -103,6 +108,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _pubNotSaDetailRepository = pubNotSaDetailRepository; _priceListRepository = priceListRepository; _priceBjListRepository = priceBjListRepository; + _priceYinDuListRepository = priceYinDuListRepository; _materialRelationshipRepository = materialRelationshipRepository; _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; } @@ -550,6 +556,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ importPubSaDetail.Price = priceListEntity?.Price ?? 0; }); } + else if(businessType == EnumBusinessType.YinDuJian) + { + //印度销售价格 + var priceListEntitys = _priceYinDuListRepository.Where(t => t.IsCancel == false) + .Where(t => t.ClientCode == clientCode) + .Where(t => lus.Contains(t.LU)).ToList(); + pubSaDetails.ForEach(importPubSaDetail => + { + //根据物料号、结算日期获取价格 + var priceListEntity = priceListEntitys + .Where(t => t.LU == importPubSaDetail.LU) + .Where(t => importPubSaDetail.SettleDate >= t.BeginDate && importPubSaDetail.SettleDate <= t.EndDate) + .OrderByDescending(t => t.Date) + .ThenByDescending(t => t.CreationTime) + .FirstOrDefault(); + importPubSaDetail.Price = priceListEntity?.Price ?? 0; + }); + } else { //销售价格 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs index 6a59e00c..75c6cd05 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs @@ -62,7 +62,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var result = await _exportImporter.UploadExcelImportByHeadDesc(files, _excelImportService).ConfigureAwait(false); var filter = new List { - "1049" + "1041" }; result = result.Where(p => filter.Contains(p.Plant)).ToList(); result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2);