From af364b5c8a22f63c33b5ece510af662007dd1a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Tue, 28 Jul 2026 14:50:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20"fix(swaptrade):=20=E4=BA=92?= =?UTF-8?q?=E6=8D=A2=E5=BC=80=E5=B9=B3=E4=BB=93=E4=BA=8B=E4=BB=B6=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=20=E5=B0=8F=E6=95=B0=E7=82=B9=E7=B2=BE=E5=BA=A6?= =?UTF-8?q?=E8=B0=83=E6=95=B4"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bf6b27ba19e498cf338f0fc646b7e3af322f7c8a. --- .../Modules/SwapModule/SwapFlowService.cs | 16 +++---- YLErpWeb/Views/SwapTrade2/EventList.cshtml | 4 +- .../Scripts/app/swaptrade/eventlist.js | 44 +++++++------------ 3 files changed, 26 insertions(+), 38 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapFlowService.cs b/YLErpDAL/Modules/SwapModule/SwapFlowService.cs index 30a40623..430a5e53 100644 --- a/YLErpDAL/Modules/SwapModule/SwapFlowService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapFlowService.cs @@ -372,16 +372,16 @@ namespace YLErp.Modules.SwapModule exportModel.PositionType = item.PositionType==1?"多头":"空头"; exportModel.UnderlyingCode = item.UnderlyingCode; exportModel.MatuirityDate = item.MatuirityDate.OtcFormatDate(); - exportModel.TradingAmountAvg = item.TradingAmountAvg.OtcFormatMoney(grouping: false); - exportModel.TradingAmountFeeAvg = item.TradingAmountFeeAvg.OtcFormatMoney(grouping: false); + exportModel.TradingAmountAvg = item.TradingAmountAvg.OtcFormat(OtcFormatFlag.umprice); + exportModel.TradingAmountFeeAvg = item.TradingAmountFeeAvg.OtcFormat(OtcFormatFlag.umprice); exportModel.Quantity = item.Quantity.OtcFormatMoney(false, 4); - exportModel.TradingAmount = item.TradingAmount.OtcFormatMoney(false, 2); + exportModel.TradingAmount = item.TradingAmount.OtcFormatMoney(false, 4); exportModel.ContractSize = item.ContractSize.ToString(); - exportModel.TradingFee = item.TradingFee.OtcFormatMoney(false, 2); - exportModel.TradingFeePending = item.TradingFeePending.OtcFormatMoney(false, 2); - exportModel.DividendPending = item.DividendPending.OtcFormatMoney(false, 2); - exportModel.MarkClosePnl = item.MarkClosePnl.OtcFormatMoney(false, 2); - exportModel.DividendIn = item.DividendIn.OtcFormatMoney(false, 2); + exportModel.TradingFee = item.TradingFee.OtcFormatMoney(false, 4); + exportModel.TradingFeePending = item.TradingFeePending.OtcFormatMoney(false, 4); + exportModel.DividendPending = item.DividendPending.OtcFormatMoney(false, 4); + exportModel.MarkClosePnl = item.MarkClosePnl.OtcFormatMoney(false, 4); + exportModel.DividendIn = item.DividendIn.OtcFormatMoney(false, 4); exportModel.OptLog = item.OptLog; exportModel.InitYtm = item.InitYtm; list.Add(exportModel); diff --git a/YLErpWeb/Views/SwapTrade2/EventList.cshtml b/YLErpWeb/Views/SwapTrade2/EventList.cshtml index c3905e38..cfbe53fc 100644 --- a/YLErpWeb/Views/SwapTrade2/EventList.cshtml +++ b/YLErpWeb/Views/SwapTrade2/EventList.cshtml @@ -12,7 +12,7 @@ - + }
@@ -28,4 +28,4 @@
-
+ \ No newline at end of file diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/eventlist.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/eventlist.js index c8c32767..e9f8f6b7 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/eventlist.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/eventlist.js @@ -176,31 +176,36 @@ var getColModelGrid = function () { label: '成交全价', width: 90, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'TradingAmountFeeAvg', label: '成交全价(含费)', width: 90, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'TradingAmountNetAvg', label: '成交净价', width: 90, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'InitYtm', label: '成交收益率', width: 90, align: 'center', - formatter: EventNineDecimalFormat + formatter: function (cellValue, options, rowObject) { + if (cellValue == null) { + return ""; + } + return otcformat.trading.premiumRateP(cellValue); + } }, { name: 'TradingAmountNetFeeAvg', label: '成交净价(含费)', width: 90, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'Quantity', label: '成交数量/张数', @@ -212,7 +217,7 @@ var getColModelGrid = function () { label: '成交金额(元)', width: 90, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'ContractSize', label: '乘数', @@ -225,31 +230,31 @@ var getColModelGrid = function () { label: '交易费用佣金', width: 90, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'TradingFeePending', label: '待结算交易费用佣金', width: 90, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'DividendPending', label: '待结算分红收益', width: 90, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'MarkClosePnl', label: '浮动端平仓盈亏·浮动', width: 160, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice }, { name: 'DividendIn', label: '浮动端平仓盈亏·分红', width: 160, align: 'center', - formatter: EventTwoDecimalFormat + formatter: otcformat.trading.umprice } ]; return col; @@ -257,23 +262,6 @@ var getColModelGrid = function () { var colModelGrid = getColModelGrid(); -function EventTwoDecimalFormat(cellValue) { - if (cellValue === null || cellValue === undefined || cellValue === '') { - return ''; - } - var price = Number(cellValue); - return isFinite(price) ? price.toFixed(2) : cellValue; -} - -function EventNineDecimalFormat(cellValue) { - if (cellValue === null || cellValue === undefined || cellValue === '') { - return ''; - } - var price = Number(cellValue); - return isFinite(price) ? price.toFixed(9) : cellValue; -} - - function gridComplete() { $('.ui-jqgrid-bdiv', '#gbox_listGrid').floatingScroll(); } From 63932918a1cbc344209eaf88d9540d622471096a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Tue, 28 Jul 2026 14:50:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Revert=20"feat(swaptrade):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=A5=E7=BB=88=E6=8C=81=E4=BB=93=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD=E5=92=8C=E7=B2=BE=E5=BA=A6?= =?UTF-8?q?=E6=8E=A7=E5=88=B6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1c91bca347a115cb62935376f7fcf38108a06d7. --- YLErpDAL/DataBase/YLContext.cs | 18 +--------- .../Scripts/app/swaptrade/EodPositionRisks.js | 36 ++----------------- YLErpWeb/wwwroot/Scripts/utils.js | 8 ++--- 3 files changed, 5 insertions(+), 57 deletions(-) diff --git a/YLErpDAL/DataBase/YLContext.cs b/YLErpDAL/DataBase/YLContext.cs index b9eb9d20..78936a0c 100644 --- a/YLErpDAL/DataBase/YLContext.cs +++ b/YLErpDAL/DataBase/YLContext.cs @@ -1,7 +1,4 @@ using BaseOUDAL; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using System.ComponentModel.DataAnnotations.Schema; -using System.Reflection; using YLErp.Core.DBModels; using YLErp.Model; @@ -17,19 +14,6 @@ namespace YLErp.BLL protected override void OnModelCreating(ModelBuilder modelBuilder) { - var clientBalanceMoneyConverter = new ValueConverter( - value => value.HasValue ? Convert.ToDecimal(value.Value) : null, - value => value.HasValue ? (double)value.Value : null); - var clientBalanceDaily = modelBuilder.Entity(); - foreach (var property in typeof(ClientBalanceDaily).GetProperties() - .Where(property => property.PropertyType == typeof(double?) - && property.GetCustomAttribute() == null)) - { - clientBalanceDaily.Property(property.Name) - .HasConversion(clientBalanceMoneyConverter) - .HasColumnType("decimal(20,6)"); - } - modelBuilder.Entity().HasKey(c => new { c.PGroup, c.PName }); modelBuilder.Entity().HasKey(c => new { c.ValueDate, c.OptionCode }); modelBuilder.Entity().HasKey(c => new { c.From, c.Key }); @@ -430,4 +414,4 @@ namespace YLErp.BLL public DbSet glms_risk_variable { get; set; } } -} +} \ No newline at end of file diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/EodPositionRisks.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/EodPositionRisks.js index ca12a59f..99067de4 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/EodPositionRisks.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/EodPositionRisks.js @@ -168,9 +168,7 @@ function colModelGridEodPosition() { index: 'eodPosition.PosiNetPrice', width: 90, align: 'center', - formatter: PriceFormat, - exportFormatter: ExportPriceNineDecimalFormat, - exportNumberFormat: '0.000000000' + formatter: PriceFormat }, { name: 'eodPosition.PosiGrossPrice', label: '期初价格-不含费', @@ -178,8 +176,6 @@ function colModelGridEodPosition() { width: 90, align: 'center', formatter: PriceFormat, - exportFormatter: ExportPriceNineDecimalFormat, - exportNumberFormat: '0.000000000' }, { name: 'eodPosition.PosiQuantity', label: '名义数量', @@ -747,7 +743,7 @@ function exportVisibleColumns() { var tabName = page.tabIndex == 2 ? '框架合约' : '日终持仓'; var fileName = '日终持仓风险_互换_' + tabName + (dateStr ? '_' + dateStr : ''); if (page.tabIndex != 2) { - exportEodPositionRows(jgrid, fileName); + main.exportVisibleColumnsToExcel(jgrid, fileName, null); return; } @@ -774,26 +770,6 @@ function exportVisibleColumns() { }); } -function exportEodPositionRows(jgrid, fileName) { - var exportPostData = $.extend({}, GetPostData(), { - page: jgrid.jqGrid('getGridParam', 'page'), - rows: jgrid.jqGrid('getGridParam', 'rowNum'), - sidx: jgrid.jqGrid('getGridParam', 'sortname'), - sord: jgrid.jqGrid('getGridParam', 'sortorder') - }); - $.ajax({ - url: queryurl, - type: 'POST', - dataType: 'json', - traditional: true, - data: exportPostData - }).done(function (result) { - main.exportVisibleColumnsToExcel(jgrid, fileName, null, result && result.rows ? result.rows : []); - }).fail(function () { - main.message && main.message('导出失败,无法获取日终持仓数据'); - }); -} - function getVisibleEodSwapBusinessColumnNames(jgrid) { var colModel = jgrid.jqGrid('getGridParam', 'colModel') || []; return colModel.filter(function (col) { @@ -827,14 +803,6 @@ function PriceFormat(cellValue, options, rowObject) { return otcformat.trading.umprice(cellValue); } -function ExportPriceNineDecimalFormat(cellValue) { - if (cellValue === null || cellValue === undefined || cellValue === '') { - return ''; - } - var price = Number(cellValue); - return isFinite(price) ? price.toFixed(9) : cellValue; -} - function RealizedPnlFormat(cellValue, options, rowObject) { return otcformat.trading.tradePrice(cellValue); } diff --git a/YLErpWeb/wwwroot/Scripts/utils.js b/YLErpWeb/wwwroot/Scripts/utils.js index 95c78d12..a615eda2 100644 --- a/YLErpWeb/wwwroot/Scripts/utils.js +++ b/YLErpWeb/wwwroot/Scripts/utils.js @@ -1236,9 +1236,7 @@ main.exportVisibleColumnsToExcel = function (jgrid, fileName, groupConfig, expor exportCols.forEach(function (col) { var colIndex = colModel.indexOf(col); var rawValue = $.jgrid.getAccessor(row, col.name); - var formattedValue = typeof col.exportFormatter === 'function' - ? col.exportFormatter(rawValue, row) - : gridElement && gridElement.formatter + var formattedValue = gridElement && gridElement.formatter ? gridElement.formatter(rowIndex + 1, rawValue, colIndex, row, 'add') : rawValue; formattedRow[col.name] = $('
').html(formattedValue == null ? '' : String(formattedValue)).text().replace(/\u00a0/g, ''); @@ -1265,9 +1263,7 @@ main.exportVisibleColumnsToExcel = function (jgrid, fileName, groupConfig, expor for (var c = 0; c < exportCols.length; c++) { var val = rows[i][exportCols[c].name]; if (val === undefined || val === null) val = ''; - var numberFormat = exportCols[c].exportNumberFormat; - var style = numberFormat ? ' style="mso-number-format:\'' + escapeXml(String(numberFormat)) + '\';"' : ''; - html += '' + escapeXml(String(val)) + ''; + html += '' + escapeXml(String(val)) + ''; } html += ''; }