Merge branch 'glms/feature/1.4.2' of http://git.yiliantech.com/gitlab/otc-dev/zszq-trs into glms/feature/1.4.2

This commit is contained in:
锦麟 王
2026-06-25 20:35:01 +08:00
3 changed files with 19 additions and 6 deletions
@@ -1047,10 +1047,10 @@ namespace YLErp.Modules.RiskModule
}; };
setValue(swap, swapSetting); setValue(swap, swapSetting);
swap.DV = eodSwapDV; swap.DV = eodSwapDV;
//swap.Quota_DV_Upper = tradeDvSetting?.QuotaUpperLimit ?? double.NaN; swap.Quota_DV_Upper = tradeDvSetting?.QuotaUpperLimit ?? double.NaN;
//swap.Quota_DV_Lower = tradeDvSetting?.QuotaLowerLimit ?? double.NaN; swap.Quota_DV_Lower = tradeDvSetting?.QuotaLowerLimit ?? double.NaN;
//swap.Quota_DV_wUpper = tradeDvSetting?.WarningUpperLimit ?? double.NaN; swap.Quota_DV_wUpper = tradeDvSetting?.WarningUpperLimit ?? double.NaN;
//swap.Quota_DV_wLower = tradeDvSetting?.WarningLowerLimit ?? double.NaN; swap.Quota_DV_wLower = tradeDvSetting?.WarningLowerLimit ?? double.NaN;
var underly = GetEodTradePositionPnl(req.ValueDate); var underly = GetEodTradePositionPnl(req.ValueDate);
var unTrade = new QuotaMonitor_Global() var unTrade = new QuotaMonitor_Global()
{ {
@@ -1781,6 +1781,7 @@ namespace YLErp.Modules.SwapModule
eod_Swap.MarketValueLong = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Long).Sum(s => s.UnderlyingMarketValue); eod_Swap.MarketValueLong = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Long).Sum(s => s.UnderlyingMarketValue);
eod_Swap.MarketValueShort = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Short).Sum(s => s.UnderlyingMarketValue); eod_Swap.MarketValueShort = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Short).Sum(s => s.UnderlyingMarketValue);
eod_Swap.FloatingPnL = positions.Sum(s => s.PosiProfitSum); eod_Swap.FloatingPnL = positions.Sum(s => s.PosiProfitSum);
eod_Swap.dv01 = positions.Sum(s => s.dv01 ?? 0);
decimal interestPnL = 0; decimal interestPnL = 0;
interestPositions.ForEach(x => interestPositions.ForEach(x =>
{ {
@@ -1845,6 +1846,7 @@ namespace YLErp.Modules.SwapModule
eod_Swap.MarketValueLong = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Long).Sum(s => s.UnderlyingMarketValue); eod_Swap.MarketValueLong = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Long).Sum(s => s.UnderlyingMarketValue);
eod_Swap.MarketValueShort = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Short).Sum(s => s.UnderlyingMarketValue); eod_Swap.MarketValueShort = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Short).Sum(s => s.UnderlyingMarketValue);
eod_Swap.FloatingPnL = positions.Sum(s => s.PosiProfitSum); eod_Swap.FloatingPnL = positions.Sum(s => s.PosiProfitSum);
eod_Swap.dv01 = positions.Sum(s => s.dv01 ?? 0);
interestPositions.ForEach(x => interestPositions.ForEach(x =>
{ {
decimal ratio = x.InterestDirection == (int)SwapDirectionEnum. ? 1 : -1;//收取为正,支付为负 decimal ratio = x.InterestDirection == (int)SwapDirectionEnum. ? 1 : -1;//收取为正,支付为负
@@ -2033,6 +2035,9 @@ namespace YLErp.Modules.SwapModule
var client = DataCacheProvider.GetClientDataSource().GetData(item.ClientId); var client = DataCacheProvider.GetClientDataSource().GetData(item.ClientId);
item.SwapTradeTypeStr = client?.SwapTradeTypeStr; item.SwapTradeTypeStr = client?.SwapTradeTypeStr;
} }
var dv01 = query.Sum(O => O.position.dv01??0);
retListResult.Sum = new {DV = dv01 };
return retListResult; return retListResult;
} }
@@ -38,7 +38,7 @@ $(function () {
pagerpos: 'left', pagerpos: 'left',
rowNum: 25, rowNum: 25,
rowList: [25, 50, 100, 200, 10000], rowList: [25, 50, 100, 200, 10000],
footerrow: false, footerrow: page.tabIndex == 2,
loadComplete: gridComplete, loadComplete: gridComplete,
onPaging: onJqgridPaging, onPaging: onJqgridPaging,
grouping: true grouping: true
@@ -616,7 +616,12 @@ function colModelGridEodSwap() {
index: 'position.dv01', index: 'position.dv01',
width: 120, width: 120,
align: 'center', align: 'center',
formatter: StockEqvNotionalFormat, formatter: function (cellvalue, options, rowObject) {
if (Number.isNaN(cellvalue)) return "0";
var abs = Math.abs(Number(cellvalue));
if (abs < 0.0001) return "0";
return cellvalue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 4 });
},
}, { }, {
name: 'SwapTradeTypeStr', name: 'SwapTradeTypeStr',
label: '互换类型', label: '互换类型',
@@ -633,6 +638,9 @@ function colModelGridEodSwap() {
function gridComplete() { function gridComplete() {
var jgrid = $(this); var jgrid = $(this);
if (arguments[0].Sum) {
jgrid.footerData("set", { 'position.dv01': arguments[0].Sum["DV"] });
}
main.setcolumnChooser(jgrid, page.configcolumn_data); main.setcolumnChooser(jgrid, page.configcolumn_data);
$(window).resize(); $(window).resize();
} }