From 5cc24f787e3ebbc70701f65dcc4d4275eee99423 Mon Sep 17 00:00:00 2001 From: hjhan Date: Mon, 13 Jul 2026 11:22:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A5=E7=BB=88?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E6=96=B0=E5=A2=9E=E9=A1=B5=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=A1=A5=E5=85=A8=E5=A4=B1=E6=95=88=E4=B8=8E=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=BC=80=E5=B1=8F=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EodPriceService.SearchUnderlyingList 三分支 Concat 投影成员不对称(债券缺 DataSource、期货/股票缺 UpdateUser),EF 翻译期抛 'DataSource' key not present 致 eodPriceQuery 开屏崩溃,补齐成员对称。eodPriceAdd.cshtml 原用 jQuery UI .autocomplete() 但 bundle 未打包该插件,调用即抛错、脚本中断、标的无法搜索;改为自带下拉补全(纯 jQuery+ajax,不依赖外部插件)。 --- YLErpDAL/Modules/EodModule/EodPriceService.cs | 9 +- YLErpWeb/Views/EodPrice/eodPriceAdd.cshtml | 143 +++++++++++++----- 2 files changed, 116 insertions(+), 36 deletions(-) diff --git a/YLErpDAL/Modules/EodModule/EodPriceService.cs b/YLErpDAL/Modules/EodModule/EodPriceService.cs index 07167103..104847dc 100644 --- a/YLErpDAL/Modules/EodModule/EodPriceService.cs +++ b/YLErpDAL/Modules/EodModule/EodPriceService.cs @@ -57,6 +57,10 @@ namespace YLErp.Modules.EodModule IsBond=false, id = source.id, DataSource = source.DataSource, + // EF Core Concat 要求各分支投影成员集合完全一致: + // 债券分支设了 UpdateUser,故期货/股票分支也必须显式设(置 null),否则翻译期抛 + // "The given key 'UpdateUser/DataSource' was not present in the dictionary"。 + UpdateUser = (long?)null, LaunchState = un.LaunchState, MarketName = un.MarketName, UnderlyingId = un.id, @@ -84,6 +88,7 @@ namespace YLErp.Modules.EodModule IsBond = false, id = stockClose.id, DataSource = stockClose.DataSource, + UpdateUser = (long?)null, // 对齐 Concat 投影成员,见 query1 注释 LaunchState = un.LaunchState, MarketName = un.MarketName, UnderlyingId = un.id, @@ -110,7 +115,9 @@ namespace YLErp.Modules.EodModule IsBond = true, id = bondClose.id, UpdateUser = bondClose.update_user, - // 债券 DataSource 在后处理统一置为固定值"中债估值"(见下方 foreach)。 + // 债券 DataSource 在后处理统一置为人名/"中债估值"(见下方 foreach); + // 此处仍须显式设 null 以对齐 Concat 各分支投影成员集合(见 query1 注释)。 + DataSource = null, LaunchState = un.LaunchState, MarketName = un.MarketName, UnderlyingId = un.id, diff --git a/YLErpWeb/Views/EodPrice/eodPriceAdd.cshtml b/YLErpWeb/Views/EodPrice/eodPriceAdd.cshtml index f9bc30d3..bc216e25 100644 --- a/YLErpWeb/Views/EodPrice/eodPriceAdd.cshtml +++ b/YLErpWeb/Views/EodPrice/eodPriceAdd.cshtml @@ -1,48 +1,109 @@ -@{ +@{ ViewBag.Title = "日终价格新增"; Layout = "~/Views/Shared/_InfoLayout.cshtml"; } +@section CSS +{ + +} @section JS { @@ -117,10 +189,11 @@

日终价格新增

-
+
- + +