diff --git a/Framework/YLErp.Core/DBModels/TradeExtend.cs b/Framework/YLErp.Core/DBModels/TradeExtend.cs index 883010c5..15829dd4 100644 --- a/Framework/YLErp.Core/DBModels/TradeExtend.cs +++ b/Framework/YLErp.Core/DBModels/TradeExtend.cs @@ -97,6 +97,13 @@ namespace YLErp.DBModels [JsonIgnore] public bool CalcLast => InterestCalcMode?.EndsWith("1") ?? true; + /// + /// 是否罚息(EQD-6977):提前终止平仓时利息端按持有至到期计息的簿记默认值。 + /// 平仓页默认带出此值、可修改,以平仓时选择为准(当次选择经 UnwindData.IsPenaltyInterest 走请求,不回写)。 + /// 存量 JSON 无此键 → 反序列化默认 false("否"),零回填。 + /// + public bool IsPenaltyInterest { get; set; } + /// ///多空组合浮动端 收取方向 1:收取,2:支付 /// diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 1160d34f..0a238637 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -258,6 +258,8 @@ namespace YLErp.Modules.SwapModule unwindData.PosiNotionalValue = Convert.ToDecimal(td.StockEqvNotional); unwindData.PositionQty = position != null ? position.PosiQuantity : Convert.ToDecimal(td.TradeAmount); unwindData.AnnualDays = tradeExtend == null ? 365 : tradeExtend.ExtendObj.AnnualDays; + // EQD-6977 罚息:平仓页「是否罚息」默认带出簿记值;以平仓时选择为准(可改),此处仅默认值 + unwindData.IsPenaltyInterest = tradeExtend != null && tradeExtend.ExtendObj.IsPenaltyInterest; unwindData.CloseMethod = (int)CloseMethodEnum.全部平仓; // 占期初(original)语义(A):默认"平掉剩余全部持仓" = 剩余名义本金/期初名义本金。 // 未平仓时 PosiNotionalValue==NotionalValue → 1(平100%);部分平仓后自动变为剩余比例(如已平10%则默认90%)。 diff --git a/YLErpWeb/Controllers/SwapTrade2Controller.cs b/YLErpWeb/Controllers/SwapTrade2Controller.cs index 2f282b7b..33c82881 100644 --- a/YLErpWeb/Controllers/SwapTrade2Controller.cs +++ b/YLErpWeb/Controllers/SwapTrade2Controller.cs @@ -400,13 +400,13 @@ namespace YLErp.Web.Controllers /// /// /// - public JsonResult GetUnwindInterestList(DateTime valueDate,DateTime unwindDate, int tradeId, decimal closePercent, int eventType, decimal notionalValue = 0, decimal posiNotionalValue = 0) + public JsonResult GetUnwindInterestList(DateTime valueDate,DateTime unwindDate, int tradeId, decimal closePercent, int eventType, decimal notionalValue = 0, decimal posiNotionalValue = 0, bool isPenaltyInterest = false) { unwindDate = valueDate; // 前端按"占期初(original)"语义传 closePercent(A);后端 GetUnwindInterests 按"占剩余(remaining)"语义(B)计算。 // 多空互换前端不传 notionalValue/posiNotionalValue(默认 0),则跳过转换保持原行为。 var convertedClosePercent = SwapDealService.ToRemainingClosePercent(closePercent, notionalValue, posiNotionalValue); - var interests = new SwapDealService(CurUser).GetUnwindInterests(valueDate, unwindDate, tradeId, convertedClosePercent, eventType); + var interests = new SwapDealService(CurUser).GetUnwindInterests(valueDate, unwindDate, tradeId, convertedClosePercent, eventType, isPenaltyInterest); foreach (var interest in interests) { interest.TdInterestAmount=Math.Round(interest.TdInterestAmount, ConsGlobal.MoneyRound,MidpointRounding.AwayFromZero);