fix(fr007): 界面手工录入定盘精度 4→6 位——1.4150% 不再被截成 1.4200%
UAT 实测发现(EQD-6968 测试期间):录入 1.4150 落库变 0.0142。两层拆解: - ÷100 为设计(界面按百分数录入,SwapflowList.js toNumber(value/100,6) 已传 6 位) - Math.Round(price,4) 为精度截断:FR007 官方发布百分数下 4 位=小数 6 位, 4 位舍入只保百分数下 2 位,丢 0.5bp(1 亿本金 7 天约 96 元) 修复:抽 RoundFr007Price(6位) 替换三处 Round(,4),与前端 6 位对齐; DB 列 double(18,10) 已验证容纳;bond-sync 自动同步链(BigDecimal 全精度透传) 不经此路径零影响。已截断的历史行(如 2026-08-19 的 0.0142)不自愈,需重录。 附带修复 GLMS20260819Fr007TradeDiscoveryTest 编译错误:@"" 逐字字符串内 应用 "" 转义、UnderlyingCode→FutureContractId(实际列名)、EF6 Database.Connection → EF Core GetDbConnection()。 验证:SwapFlowFr007EntryPrecisionTest 2/2;全量 985 例 145 败与基线 diff=0
This commit is contained in:
@@ -110,9 +110,9 @@ namespace YLErp.Modules.SwapModule
|
||||
DbContext.Add(frdata);
|
||||
}
|
||||
frdata.UnderlyingId = EodPriceService.ResolveUnderlyingIdForCode(frdata.UnderlyingCode, frdata.UnderlyingId ?? 0, frUnderlying.id);
|
||||
frdata.ClosePrice = Math.Round(price, 4);
|
||||
frdata.SettlePrice = Math.Round(price, 4);
|
||||
frdata.ReferencePrice = Math.Round(price, 4);
|
||||
frdata.ClosePrice = RoundFr007Price(price);
|
||||
frdata.SettlePrice = RoundFr007Price(price);
|
||||
frdata.ReferencePrice = RoundFr007Price(price);
|
||||
frdata.OptId = UserInfo.UserId;
|
||||
frdata.OptName = UserInfo.UserName;
|
||||
frdata.OptDate = DateTime.Now;
|
||||
@@ -121,6 +121,14 @@ namespace YLErp.Modules.SwapModule
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FR007 界面手工录入定盘的落库精度。FR007 官方发布为百分数下 4 位(如 1.4150%),
|
||||
/// 小数口径需 6 位(0.014150)——原 Math.Round(,4) 只保留百分数下 2 位,1.4150% 被截成
|
||||
/// 1.4200%(丢 0.5bp)。取 6 位与前端 toNumber(value/100, 6) 对齐;DB 列 double(18,10) 容纳无虞;
|
||||
/// bond-sync 自动同步链(BigDecimal 全精度透传)不经此函数。
|
||||
/// </summary>
|
||||
internal static double RoundFr007Price(double price) => Math.Round(price, 6);
|
||||
|
||||
/// <summary>
|
||||
/// 查询互换流水导入
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user