fix(swap-trade): 修正名义本金小数点精度

This commit is contained in:
张名锐
2026-08-05 13:44:17 +08:00
parent 41de2f6dd6
commit 9affdf5d41
8 changed files with 18 additions and 17 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ try
options.ValueLengthLimit = 1024 * 1024 * 100; // 100MB max len form data
options.MultipartBodyLengthLimit = int.MaxValue; //不限制文件上传大小
});
builder.Services.AddMvcOptions(options => options.MaxModelBindingCollectionSize = 1000000);
builder.Services.Configure<MvcOptions>(options => options.MaxModelBindingCollectionSize = 1000000);
builder.Services.Configure<KafkaConfig>(builder.Configuration.GetSection("KafkaConfig"));
builder.Services.Configure<ExternalCashFlowOptions>(builder.Configuration.GetSection("ExternalCashFlow"));
builder.Services.AddScoped<IViewRenderService, ViewRenderService>();
+1 -1
View File
@@ -179,7 +179,7 @@
</td>
<td>{{floatPosition.Quantity}}</td>
<td>
<vue-number-input v-model="floatPosition.TradingFee" v-bind:format="inputFormatEqvNotional" v-on:input="changeTradingFee"></vue-number-input>
<vue-number-input v-model="floatPosition.TradingFee" v-bind:format="inputFormatInterestAmount" v-on:input="changeTradingFee"></vue-number-input>
<div class="bubble-box" style="margin-left:6px;">我方{{floatPosition.PayDirection==1?"支付":"收取"}}交易费用</div>
</td>
<td> <vue-number-input v-model="floatPosition.DividendIn" v-bind:format="inputFormatDividend" v-on:input="changeTradingFee"></vue-number-input></td>
+1 -1
View File
@@ -492,7 +492,7 @@
<vue-swap-price-input :key="getPosiPriceFormatKey(item,'normalPosiGrossPrice')" v-model="item.PosiGrossPrice" v-bind:format="getPosiPriceInputFormat(item,'grossPrice')" v-on:input="changeSpotPrice(item)"></vue-swap-price-input>
</td>
<td>
<vue-number-input v-model="item.PosiQuantity" v-on:input="changeQuantity(item)" v-bind:format="inputFormatTradeAmount"></vue-number-input>{{item.underlying!=null?item.underlying.QuoteUnitString:''}}
<vue-number-input v-model="item.PosiQuantity" v-on:input="changeQuantity(item)" v-bind:format="inputFormatPositionQuantityFixed2"></vue-number-input>{{item.underlying!=null?item.underlying.QuoteUnitString:''}}
</td>
<td>
<template v-if="posiFeeModePercent">
@@ -4,7 +4,7 @@ window.otcformat.options.disableGrouping = true;
const inputFormatSwapRate = Object.freeze({ precision: otcformat.trading.premiumRateP.precision, append: '%' });
const inputFormatTradePrice = Object.freeze({ precision: otcformat.trading.tradePrice.precision, append: '' });
const inputFormatTradeAmount = Object.freeze({ precision: otcformat.trading.notional.precision, append: '' });
const inputFormatEqvNotional = Object.freeze({ precision: otcformat.trading.StockEqvNotional.precision, append: '', negative: true });
const inputFormatEqvNotional = Object.freeze({ precision: 2, append: '', negative: true, trimTailZeros: false });
const inputFormatInterestAmount = Object.freeze({ precision: 2, append: '', negative: true, trimTailZeros: false });
const inputFormatDividend = Object.freeze({ precision: 2, append: '', negative: true });
const inputFormatMarginRate = Object.freeze({ precision: otcformat.trading.marginRateP.precision, append: '%' });
@@ -120,8 +120,8 @@ const vue = new Vue({
return pricef;
},
dataFormat() {
this.deal.NotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.NotionalValue));
this.deal.PosiNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.PosiNotionalValue));
this.deal.NotionalValue = otcformat.fixed2(parseFloat(this.deal.NotionalValue));
this.deal.PosiNotionalValue = otcformat.fixed2(parseFloat(this.deal.PosiNotionalValue));
this.deal.NotionalQty = otcformat.trading.notional(this.deal.NotionalQty);
this.deal.PositionQty2 = otcformat.trading.notional(this.deal.PositionQty);
this.floatPosition.Quantity = otcformat.trading.notional(this.floatPosition.Quantity);
@@ -1,6 +1,6 @@
//otcformat禁止千分位分组
window.otcformat.options.disableGrouping = true;
const inputFormatEqvNotional = Object.freeze({ precision: otcformat.trading.StockEqvNotional.precision, append: '' });
const inputFormatEqvNotional = Object.freeze({ precision: 2, append: '', trimTailZeros: false });
let ValueDate = model.ValueDate;
const vue = new Vue({
el: '#vueDiv',
@@ -42,8 +42,8 @@ const vue = new Vue({
}
},
dataFormat() {
this.deal.NotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.NotionalValue));
this.deal.PosiNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.PosiNotionalValue));
this.deal.NotionalValue = otcformat.fixed2(parseFloat(this.deal.NotionalValue));
this.deal.PosiNotionalValue = otcformat.fixed2(parseFloat(this.deal.PosiNotionalValue));
this.deal.NotionalQty = otcformat.trading.notional(this.deal.NotionalQty);
this.deal.PositionQty = otcformat.trading.notional(this.deal.PositionQty);
this.deal.SwapCloseAmount = otcformat.trading.StockEqvNotional(this.deal.SwapCloseAmount);
@@ -10,8 +10,9 @@ const consAssetUnits = page.canAddNewTrader ? ylotc.assetunits
: ylotc.assetunits.filter(x => x.TraderIds.includes(page.Trade.TraderId));
const inputFormatInteger = Object.freeze({ precision: 0, append: '' });
const inputFormatEqvNotional = Object.freeze({ precision: otcformat.trading.StockEqvNotional.precision, append: '' });
const inputFormatEqvNotional = Object.freeze({ precision: 2, append: '', trimTailZeros: false });
const inputFormatTradeAmount = Object.freeze({ precision: otcformat.trading.notional.precision, append: '' });
const inputFormatPositionQuantityFixed2 = Object.freeze({ precision: 2, append: '', trimTailZeros: false });
const inputFormatSwapRate = Object.freeze({ precision: 4, negative: true, append: '%', trimTailZeros: false });
const inputFormatTradePrice = Object.freeze({ precision: otcformat.trading.tradePrice.precision, negative: true, append: '' });
const inputFormatTradeSinglePrice = Object.freeze({ precision: otcformat.trading.tradeSinglePrice.precision, negative: true, append: '', percent: false });
@@ -1,6 +1,6 @@
//otcformat禁止千分位分组
window.otcformat.options.disableGrouping = true;
const inputFormatEqvNotional = Object.freeze({ precision: otcformat.trading.StockEqvNotional.precision, append: '' });
const inputFormatEqvNotional = Object.freeze({ precision: 2, append: '', trimTailZeros: false });
let dealDate = model.DealDate;
const vue = new Vue({
el: '#vueDiv',
@@ -30,8 +30,8 @@ const vue = new Vue({
});
},
dataFormat() {
this.deal.NotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.NotionalValue));
this.deal.PosiNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.PosiNotionalValue));
this.deal.NotionalValue = otcformat.fixed2(parseFloat(this.deal.NotionalValue));
this.deal.PosiNotionalValue = otcformat.fixed2(parseFloat(this.deal.PosiNotionalValue));
this.deal.NotionalQty = otcformat.trading.notional(this.deal.NotionalQty);
this.deal.SwapCloseAmount = otcformat.trading.StockEqvNotional(this.deal.SwapCloseAmount);
this.deal.PositionQty = otcformat.trading.notional(this.deal.PositionQty);
@@ -4,7 +4,7 @@ window.otcformat.options.disableGrouping = true;
const inputFormatSwapRate = Object.freeze({ precision: otcformat.trading.premiumRateP.precision, append: '%' });
const inputFormatTradePrice = Object.freeze({ precision: otcformat.trading.tradePrice.precision, append: '' });
const inputFormatTradeAmount = Object.freeze({ precision: otcformat.trading.notional.precision, append: '' });
const inputFormatEqvNotional = Object.freeze({ precision: otcformat.trading.StockEqvNotional.precision, append: '', negative: true });
const inputFormatEqvNotional = Object.freeze({ precision: 2, append: '', negative: true, trimTailZeros: false });
const inputFormatCloseAmount = Object.freeze({ precision: 2, append: '', negative: true, trimTailZeros: false });
const inputFormatMarginRate = Object.freeze({ precision: otcformat.trading.marginRateP.precision, append: '%' });
const inputFormatMarginRateNoPercent = Object.freeze({ precision: otcformat.trading.umpriceP.precision, append: '', percent: true });
@@ -124,9 +124,9 @@ const vue = new Vue({
return pricef;
},
dataFormat() {
this.deal.NotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.NotionalValue));
this.deal.PosiNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.PosiNotionalValue));
this.deal.CloseNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.CloseNotionalValue));
this.deal.NotionalValue = otcformat.fixed2(parseFloat(this.deal.NotionalValue));
this.deal.PosiNotionalValue = otcformat.fixed2(parseFloat(this.deal.PosiNotionalValue));
this.deal.CloseNotionalValue = otcformat.fixed2(parseFloat(this.deal.CloseNotionalValue));
this.deal.NotionalQty = otcformat.trading.notional(this.deal.NotionalQty);
this.deal.PositionQty2 = otcformat.trading.notional(this.deal.PositionQty);
this.floatPosition.Quantity = otcformat.trading.notional(this.floatPosition.Quantity);