Merge branch 'glms/feature/swaptrade_6603_mbb' into glms/feature/1.4.2
# Conflicts: # YLErpDAL/Modules/SwapModule/SwapTradeService.cs
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using BaseOUDAL;
|
||||
using YLErp.Models;
|
||||
|
||||
namespace YLErp.Modules.SwapModule
|
||||
{
|
||||
public static class SwapMarginTemplateConfigService
|
||||
{
|
||||
public const string DictionaryName = "保证金模板名称";
|
||||
|
||||
public static readonly string[] InitialTemplateNames = { "现金保证金", "授信保证金" };
|
||||
|
||||
public static SwapMarginTemplateConfig GetConfig()
|
||||
{
|
||||
using var db = new ErpBaseContext();
|
||||
var dictionaryId = db.Dictionaries
|
||||
.Where(item => item.Name == DictionaryName)
|
||||
.Select(item => item.Id)
|
||||
.FirstOrDefault();
|
||||
var items = db.DictionaryItems
|
||||
.Where(item => item.DictId == dictionaryId && !string.IsNullOrWhiteSpace(item.Name))
|
||||
.OrderBy(item => item.IndexNum)
|
||||
.Select(item => new SelectItem { Text = item.Name, Value = item.Name })
|
||||
.ToArray();
|
||||
|
||||
return new SwapMarginTemplateConfig
|
||||
{
|
||||
options = items,
|
||||
defaultValue = items.FirstOrDefault()?.Value
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class SwapMarginTemplateConfig
|
||||
{
|
||||
public IEnumerable<SelectItem> options { get; set; }
|
||||
|
||||
public string defaultValue { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using BaseOUDAL;
|
||||
using BaseOUDAL;
|
||||
using ClosedXML.Report.Options;
|
||||
using Confluent.Kafka;
|
||||
using CsvHelper;
|
||||
@@ -341,7 +341,7 @@ namespace YLErp.Modules.SwapModule
|
||||
TradeDate = flowMerge.OccurTime,
|
||||
TraderId = asset.TraderIdsInt.FirstOrDefault(),
|
||||
TraderName = asset.TraderNamesList.FirstOrDefault(),
|
||||
MarginTemplateName = "系统默认",
|
||||
MarginTemplateName = null,
|
||||
OpponentRole = "乙方",
|
||||
StructureType = structureType,
|
||||
InitialMargin = 0,
|
||||
@@ -1414,6 +1414,7 @@ namespace YLErp.Modules.SwapModule
|
||||
position.FloatRateUnderlyingCode = swap.FloatRateUnderlyingCode;
|
||||
position.interest_rest_days = swap.interest_rest_days;
|
||||
position.interest_rule = swap.interest_rule;
|
||||
position.category_tag = string.IsNullOrEmpty(swap.category_tag) ? "互换利率" : swap.category_tag;
|
||||
position.InitYtm = RoundSwapBondNetPriceAndYtm(swap.InitYtm);
|
||||
if (position.InitYtm != null && position.InitYtm > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user