refactor(swap): 统一债券价格处理逻辑
- 将债券价格处理逻辑从依赖 StructureType 改为基于 IsBond 判断 - 移除 SetPosiPrice 方法中的 useBondPriceScale 参数 - 更新收入互换交易中的 multiplier 计算方式 - 调整平仓交易中 isBondTRS 的判断条件 - 同步修改相关注释说明
This commit is contained in:
@@ -3605,9 +3605,10 @@ namespace YLErp.Modules.SwapModule
|
||||
{
|
||||
item.FloatRateAbs = item.position.PosiNotionalValue == 0 ? 0 : item.InterestAmount / item.position.PosiNotionalValue;
|
||||
}
|
||||
// 交易录入的债券类收益互换价格以小数保存,展示时转为百分比价格;
|
||||
// 普通收益互换录入的是数量/原始数值,不做乘 100 转换。
|
||||
SetPosiPrice(item.position, item.StructureType == "普通债券类收益互换");
|
||||
// 是否 ×100 由标的资产类型决定(债券价格以小数保存,展示时转为百分比价格),
|
||||
// 与存储层 GetStorageDeliveryPriceRound / GetSwapValuationPrice 的 IsBond 口径一致,
|
||||
// 不依赖簿记结构类型 StructureType。
|
||||
SetPosiPrice(item.position);
|
||||
}
|
||||
return retListResult;
|
||||
}
|
||||
@@ -3652,10 +3653,10 @@ namespace YLErp.Modules.SwapModule
|
||||
position.SwapPositionValue = -position.SwapPositionValue;
|
||||
position.PosiDividendSum = -position.PosiDividendSum;
|
||||
}
|
||||
private void SetPosiPrice(eod_swap_position position, bool? useBondPriceScale = null)
|
||||
private void SetPosiPrice(eod_swap_position position)
|
||||
{
|
||||
var um = DataCacheProvider.GetUnderlyingDataSource().GetData(position.UnderlyingCode);
|
||||
if (useBondPriceScale ?? (um != null && um.IsBond()))
|
||||
if (um != null && um.IsBond())
|
||||
{
|
||||
position.PosiNetPrice *= 100;
|
||||
position.UnderlyingPrice *= 100;
|
||||
|
||||
Reference in New Issue
Block a user