价格查询修改

This commit is contained in:
吴方海
2025-04-22 14:39:05 +08:00
parent 08682b28c4
commit cbfad5c86a
2 changed files with 26 additions and 4 deletions
@@ -150,5 +150,9 @@ namespace YLErp.DBModels
[DisplayName("估值日期")]
[DataChange]
public DateTime valuation_date { get; set; }
/// <summary>
/// 聚源id
/// </summary>
public string JSID { get; set; }
}
}
+22 -4
View File
@@ -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; }
}
}