From a7b58b2246cda55edf27aad405d139a2349191b4 Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 1 Jun 2022 11:11:06 +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/Materials/Material.cs | 7 +++++- .../Report/ErpPartDapperRepository.cs | 24 ++++--------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs index 5da25af4..cef7b17a 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs @@ -37,6 +37,10 @@ namespace Win.Sfs.SettleAccount.Entities.Materials /// 估价类描述 /// public string EstimateTypeDesc { set; get; } + + + + public string CustomerPartCode { set; get; } public void SetId(Guid id, Guid branchId) { @@ -63,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials Guid id, Guid branchId, - string factory, string materialCode, string materialDesc, string unit, string estimateType, string estimateTypeDesc):base(id) + string factory, string materialCode, string materialDesc, string unit, string estimateType, string estimateTypeDesc,string customerPartCode) :base(id) { BranchId = branchId; Factory = factory; @@ -72,6 +76,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials Unit = unit; EstimateType = estimateType; EstimateTypeDesc = estimateTypeDesc; + CustomerPartCode = customerPartCode; } } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs index c1e67d3d..734e49a4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs @@ -55,25 +55,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { List _materialList = new List(); List _priceList = new List(); - //if (CacheManager.CacheMaterials != null) - //{ - // _materialList = CacheManager.CacheMaterials; - // _materialList= CacheManager.CacheMaterials.GroupBy(p => new { p.MaterialCode }).Select(p => p.FirstOrDefault()).ToList(); - //} - //else - //{ - _materialList = DbConnection.Query("select max(Id) ID,'' Factory,MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType from Set_material group by MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType ").ToList(); - //} - //if (CacheManager.CachePriceList != null) - //{ - // _priceList = CacheManager.CachePriceList; - // _priceList = CacheManager.CachePriceList.GroupBy(p => new { p.SapErpPartCode }).Select(p => p.FirstOrDefault()).ToList(); - - //} - //else - //{ - _priceList = DbConnection.Query("select Price SapPrice, MaterialCode SapErpPartCode from Set_PriceList where type='10' and version=(select max(version) from Set_PriceListVersion)").ToList(); - //} + + _materialList = DbConnection.Query("select max(Id) ID,'' Factory,MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType from Set_material group by MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType ").ToList(); + + _priceList = DbConnection.Query("select Price SapPrice, MaterialCode SapErpPartCode from Set_PriceList where type='10' and version=(select max(version) from Set_PriceListVersion)").ToList(); + List tmpList = new List(); if (isNotHistoryPart == true) {