diff --git a/Framework/YLErp.Core/DBModels/ChinaBondValuation.cs b/Framework/YLErp.Core/DBModels/ChinaBondValuation.cs index e6db6541..4e375c68 100644 --- a/Framework/YLErp.Core/DBModels/ChinaBondValuation.cs +++ b/Framework/YLErp.Core/DBModels/ChinaBondValuation.cs @@ -150,5 +150,9 @@ namespace YLErp.DBModels [DisplayName("估值日期")] [DataChange] public DateTime valuation_date { get; set; } + /// + /// 聚源id + /// + public string JSID { get; set; } } } diff --git a/YLErpDAL/Modules/EodModule/EodPriceService.cs b/YLErpDAL/Modules/EodModule/EodPriceService.cs index 06f3869f..01541916 100644 --- a/YLErpDAL/Modules/EodModule/EodPriceService.cs +++ b/YLErpDAL/Modules/EodModule/EodPriceService.cs @@ -1,5 +1,6 @@ using BaseOUDAL; using DocumentFormat.OpenXml.Bibliography; +using NPOI.POIFS.NIO; using YLErp.Helpers; namespace YLErp.Modules.EodModule @@ -28,6 +29,14 @@ namespace YLErp.Modules.EodModule { predicatEoc = predicatEoc.And(d => d.DataSource.Contains(req.DataSource)); predicatEot = predicatEot.And(d => d.DataSource.Contains(req.DataSource)); + if (req.DataSource=="系统") + { + predicatEob= predicatEob.And(d => d.JSID!=null); + } + else + { + predicatEob = predicatEob.And(d => d.JSID==null); + } } if (!string.IsNullOrEmpty(req.MarketName)) @@ -64,7 +73,8 @@ namespace YLErp.Modules.EodModule SourceTime = source.SourceTime, DeciClosePrice=0, DeciSettlePrice = 0, - DeciReferencePrice=0 + DeciReferencePrice=0, + JSID = "" }; var query2 = from un in queryUn @@ -90,7 +100,8 @@ namespace YLErp.Modules.EodModule SourceTime = stockClose.SourceTime, DeciClosePrice = 0, DeciSettlePrice = 0, - DeciReferencePrice = 0 + DeciReferencePrice = 0, + JSID="" }; var query3 = from un in queryUn join bondClose in DbContext.china_bond_valuation.Where(predicatEob) on un.UnderlyingCode equals bondClose.bond_id @@ -98,7 +109,7 @@ namespace YLErp.Modules.EodModule { IsBond = true, id = bondClose.id, - DataSource = "系统", + DataSource="人工", LaunchState = un.LaunchState, MarketName = un.MarketName, UnderlyingId = un.id, @@ -115,7 +126,8 @@ namespace YLErp.Modules.EodModule UpdateTime = bondClose.update_time, ReferencePrice=0, DeciReferencePrice = bondClose.yield, - SourceTime="" + SourceTime="", + JSID=bondClose.JSID }; var unionQuery = query1.Concat(query2); var finalQuery = unionQuery.Concat(query3); @@ -133,6 +145,10 @@ namespace YLErp.Modules.EodModule item.SettlePrice=Convert.ToDouble(item.DeciSettlePrice); item.ClosePrice = Convert.ToDouble(item.DeciClosePrice); item.ReferencePrice = Convert.ToDouble(item.DeciReferencePrice); + if (!string.IsNullOrEmpty(item.JSID)) + { + item.DataSource = "系统"; + } } } return result; @@ -320,5 +336,7 @@ namespace YLErp.Modules.EodModule public decimal? DeciReferencePrice { get; set; } public bool IsBond { get; set; } + + public string JSID { get; set; } } }