feat(swap): 统一【期初、期末交割价格】精度处理

- 在ConsGlobal中新增SwapDeliveryPriceRound常量定义为9位小数
- 更新incomeSwapTrade.js中交割价格计算逻辑,添加getStorageDeliveryPrice方法
- 修改SwapConsumerService中TradingAmountAvg字段的精度处理
- 添加ValidateDeliveryPrices和NormalizeDeliveryPrices方法进行交割价格验证和标准化
- 在SwapEodPositionService中对PosiGrossPrice和UnderlyingPrice进行精度处理
- 更新SwapFlowEventService中TradingAmountAvg字段的精度处理
- 在SwapFlowImportService中添加交割价格精度处理
- 更新前端界面中的输入格式配置,使用新的交割价格精度设置
- 修改SwapflowList.js中交割价格精度处理逻辑
- 在SwapFlowService中添加交割价格验证和精度处理
- 更新SwapTradeAutoService中交割价格精度处理
- 修改SwapTradeService中PosiGrossPrice字段的精度处理
- 更新unwindSwapTrade.js中交割价格计算逻辑
This commit is contained in:
张名锐
2026-07-22 14:53:46 +08:00
parent 0755233ab6
commit c58a9d40c4
17 changed files with 127 additions and 44 deletions
@@ -61,6 +61,10 @@ namespace YLErp.Modules.SwapModule
{
foreach (var evt in events)
{
if (!string.IsNullOrEmpty(evt.UnderlyingCode))
{
evt.TradingAmountAvg = Math.Round(evt.TradingAmountAvg, ConsGlobal.SwapDeliveryPriceRound, MidpointRounding.AwayFromZero);
}
DbContext.swap_flow_event.Add(evt);
}
DbContext.SaveChanges();
@@ -321,7 +325,7 @@ namespace YLErp.Modules.SwapModule
DataState = 1,
EventDate = flow_merge.OccurTime,
UnwindDate = QdpCalendarHelper.GetNonHoliday(flow_merge.OccurTime.AddDays(1)),
TradingAmountAvg = TradingAmountAvg,
TradingAmountAvg = Math.Round(TradingAmountAvg, ConsGlobal.SwapDeliveryPriceRound, MidpointRounding.AwayFromZero),
TradingAmountFeeAvg = TradingAmountFeeAvg,
TradingAmountNetFeeAvg = TradingAmountNetFeeAvg,
TradingAmountNetAvg = flow_merge.TradingAmountNetAvg,
@@ -375,7 +379,7 @@ namespace YLErp.Modules.SwapModule
DataState = 1,
EventDate = flow_merge.OccurTime,
UnwindDate = QdpCalendarHelper.GetNonHoliday(flow_merge.OccurTime.AddDays(1)),
TradingAmountAvg = flow_merge.TradingAmountAvg,
TradingAmountAvg = Math.Round(flow_merge.TradingAmountAvg, ConsGlobal.SwapDeliveryPriceRound, MidpointRounding.AwayFromZero),
TradingAmountFeeAvg = flow_merge.TradingAmountFeeAvg,
TradingFeePending = flow_merge.TradingFeePending,
ClientId = flow_merge.ClientId
@@ -409,7 +413,7 @@ namespace YLErp.Modules.SwapModule
DataState = (int)SwapFlowDateStateEnum.,
EventDate = td.TradeDate.Value,
UnwindDate = td.StartDate.Value,
TradingAmountAvg = position.PosiGrossPrice,
TradingAmountAvg = Math.Round(position.PosiGrossPrice, ConsGlobal.SwapDeliveryPriceRound, MidpointRounding.AwayFromZero),
TradingAmountFeeAvg = position.PosiNetPrice,
TradingAmountNetFeeAvg = position.PosiNetFeePrice,
TradingAmountNetAvg = position.PosiNetNoFeePrice,
@@ -462,7 +466,7 @@ namespace YLErp.Modules.SwapModule
DataState = 100,
EventDate = td.TradeDate.Value,
UnwindDate = QdpCalendarHelper.GetNonHoliday(td.TradeDate.Value.AddDays(1)),
TradingAmountAvg = flowMerge.TradingAmountAvg,
TradingAmountAvg = Math.Round(flowMerge.TradingAmountAvg, ConsGlobal.SwapDeliveryPriceRound, MidpointRounding.AwayFromZero),
TradingAmountFeeAvg = flowMerge.TradingAmountFeeAvg,
TradingAmountNetFeeAvg = flowMerge.TradingAmountNetFeeAvg,
TradingAmountNetAvg = flowMerge.TradingAmountNetAvg,