(fix): 将原保证金模板名称=系统默认 的默认值改为null。

This commit is contained in:
马冰冰
2026-07-22 16:28:17 +08:00
parent 05ce6fb02f
commit 4419a4125b
7 changed files with 15 additions and 9 deletions
@@ -455,7 +455,7 @@ namespace YLErp.Modules.EodModule
Lots = swapFlow.Lots,
IsNight = swapFlow.IsNight,
OpponentRole = "甲方",
MarginTemplateName = "系统默认",
MarginTemplateName = null,
MarginType = MarginTypeEnum.DEFAULT,
IsGroup = isSingleTrade ? 0 : 2
};
@@ -743,7 +743,7 @@ namespace YLErp.Modules.EodModule
td.OriginalNotional = td.Notional;
td.OriginalStockEqvNotional = td.StockEqvNotional;
td.StockEqvNotionalReal = td.StockEqvNotionalReal;
td.MarginTemplateName = "系统默认";
td.MarginTemplateName = null;
td.MarginType = MarginTypeEnum.DEFAULT;
td.IsTradePricePayType = true;
td.TradeSource = TradeSourceEnum..ToString();
@@ -321,7 +321,7 @@ namespace YLErp.Modules.SwapModule
TradeDate = flowMerge.OccurTime,
TraderId = asset.TraderIdsInt.FirstOrDefault(),
TraderName = asset.TraderNamesList.FirstOrDefault(),
MarginTemplateName = "系统默认",
MarginTemplateName = null,
OpponentRole = "乙方",
StructureType = structureType,
InitialMargin = 0,
@@ -378,7 +378,7 @@ namespace YLErp.Modules.TradeModule.SwapModule
importTrade.StockEqvNotionalReal = importTrade.StockEqvNotionalReal;
importTrade.trade_swap.RateCalcMode = "01";
importTrade.IsUsePremiumRate = true;
importTrade.MarginTemplateName = "系统默认";
importTrade.MarginTemplateName = null;
importTrade.MarginType = MarginTypeEnum.DEFAULT;
importTrade.IsTradePricePayType = true;
importTrade.TradeSource = TradeSourceEnum..ToString();
@@ -519,7 +519,7 @@ namespace YLErp.Modules.TradeModule.SwapModule
importTrade.ParticipationRate = 1;
//预付金
importTrade.MarginTemplateName = "系统默认";
importTrade.MarginTemplateName = null;
importTrade.MarginType = MarginTypeEnum.DEFAULT;
SetDBModelCreator(importTrade);
@@ -726,7 +726,7 @@ namespace YLErp.Modules.TradeModule.SwapModule
td.OriginalStockEqvNotional = td.StockEqvNotional;
td.StockEqvNotionalReal = td.StockEqvNotionalReal;
td.IsUsePremiumRate = true;
td.MarginTemplateName = "系统默认";
td.MarginTemplateName = null;
td.MarginType = MarginTypeEnum.DEFAULT;
td.IsTradePricePayType = true;
td.TradeSource = TradeSourceEnum..ToString();
@@ -2815,7 +2815,7 @@ namespace YLErp.Modules.TradeModule.SwapModule
td.SettlementDate = td.ExerciseDate;
td.StockEqvNotional = reader.GetDouble("名义本金(人民币)", true) ?? 0;
td.MarginTemplateName = "系统默认";
td.MarginTemplateName = null;
td.UnWindDate = reader.GetDate("提前终止日/终止日", true);
td.Comments = reader.GetString("备注", false);
//td.UnderlyingName = reader.GetString("标的名称", true);
@@ -116,6 +116,12 @@ namespace YLErp.Web.Controllers
{
return ShowError("没有找到交易数据");
}
var marginTemplateConfig = SwapMarginTemplateConfigService.GetConfig();
if (string.IsNullOrWhiteSpace(tradeObj.MarginTemplateName)
|| !marginTemplateConfig.options.Any(item => item.Value == tradeObj.MarginTemplateName))
{
tradeObj.MarginTemplateName = marginTemplateConfig.defaultValue;
}
TradeViewModel model;
model = new TradeViewModel(tradeObj)
+2 -2
View File
@@ -303,7 +303,7 @@ namespace YLErp.Web.Controllers
TradeDate = valuedateBLL.ValueDate,
TraderId = CurUser.UserId,
TraderName = CurUser.UserName,
MarginTemplateName = "系统默认",
MarginTemplateName = null,
OpponentRole = "乙方",
trade_swap = new trade_swap()
{
@@ -1196,4 +1196,4 @@ namespace YLErp.Web.Controllers
return JsonSuccess("", 0);
}
}
}
}