bug修复

This commit is contained in:
吴方海
2025-04-18 17:00:25 +08:00
parent a33d5a6ff2
commit 4b9bcfb2dc
10 changed files with 42 additions and 34 deletions
@@ -4312,11 +4312,12 @@ namespace YLErp.Modules.RiskModule
{
var um = ums.FirstOrDefault(x => x.UnderlyingCode == item.security_id);
var bondPrice = EodPriceQueryService.GetBondPrice(dealDate, item.security_id);
double lastPrice = bondPrice != null ? bondPrice.ClosePrice : (um.Price ?? 0) * Convert.ToDouble(ConsGlobal.bondPriceMultiple);
double lastPrice = bondPrice != null ? bondPrice.ClosePrice : (um?.Price ?? 0) * Convert.ToDouble(ConsGlobal.bondPriceMultiple);
var bond = new UnderlyingBond();
if (um.IsBond()&&string.IsNullOrEmpty(um.ExJson)) {
if (um!=null&& um.IsBond()&&string.IsNullOrEmpty(um.ExJson)) {
bond = JsonHelper.Deserialize<UnderlyingBond>(um.ExJson);
}
bond.IssueSize = bond.IssueSize ?? 0;
return new CheckQuotaMoitorModel
{
Qty = item.position_qty ?? 0,
@@ -4333,7 +4334,7 @@ namespace YLErp.Modules.RiskModule
Delta = (decimal)((item.side == 0 ? item.deal_full_price_avg : -item.deal_full_price_avg) * (item.position_qty ?? 0) * ConsGlobal.bondPriceMultiple),
UnderlyingId = um?.id ?? 0,
LastPrice = (decimal)lastPrice,
Circulation = (bond.IssueSize * 100000000m) ?? 0,
Circulation = (bond.IssueSize * 100000000) ?? 0,
Pnl = (decimal)((item.full_price_now - item.deal_full_price_avg) * (item.position_qty ?? 0) * ConsGlobal.bondPriceMultiple),
Current = item.Current,
};