From 11459ed73f67aa08f047a7feb817eb4be60006f3 Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 20 Aug 2026 12:31:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(swap):=20EQD-6977=20swap=5Fflow=5Fevent=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20is=5Fpenalty=5Finterest=20=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 模型属性 IsPenaltyInterest + Column(is_penalty_interest) 显式映射;增量 DDL 落 DbUpdate/Ver-5.7.0/prod.sql。存量 DEFAULT 0 自动为否。列命名 snake_case 与全表 PascalCase 不一致,评审文档已标注待拍板。 --- Framework/YLErp.Core/DBModels/SwapFlowEvent.cs | 9 +++++++++ .../YLErp.Resources/DbUpdate/Ver-5.7.0/prod.sql | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Framework/YLErp.Resources/DbUpdate/Ver-5.7.0/prod.sql diff --git a/Framework/YLErp.Core/DBModels/SwapFlowEvent.cs b/Framework/YLErp.Core/DBModels/SwapFlowEvent.cs index b635b672..179525cd 100644 --- a/Framework/YLErp.Core/DBModels/SwapFlowEvent.cs +++ b/Framework/YLErp.Core/DBModels/SwapFlowEvent.cs @@ -344,6 +344,15 @@ namespace YLErp.DBModels [DataChange] public decimal InterestClosePnL { get; set; } + /// + /// 是否罚息(EQD-6977):提前终止平仓时利息端按持有至到期计息的标志。0=否,1=是。 + /// 存量数据因 DEFAULT 0 自动为否;新增罚息事件由接缝层置 1。 + /// + [DisplayName("是否罚息")] + [DataChange] + [Column("is_penalty_interest")] + public int IsPenaltyInterest { get; set; } + public long? EventId { get; set; } public int? ClientId { get; set; } public decimal? FloatRate { get; set; } diff --git a/Framework/YLErp.Resources/DbUpdate/Ver-5.7.0/prod.sql b/Framework/YLErp.Resources/DbUpdate/Ver-5.7.0/prod.sql new file mode 100644 index 00000000..24e0a16b --- /dev/null +++ b/Framework/YLErp.Resources/DbUpdate/Ver-5.7.0/prod.sql @@ -0,0 +1,12 @@ +-- EQD-6977 提前终止平仓罚息:swap_flow_event 增加“是否罚息”标志列 +-- 关联评审:outputs/EQD-6977_DDL发布评审.md +-- 影响范围:仅新增一列,存量数据经 DEFAULT 0 自动置“否”,符合需求“存量合约默认不罚息”。 +-- 发布窗口:建议在低峰/维护窗口执行(见评审文档锁表风险说明)。 +SET FOREIGN_KEY_CHECKS=0; + +ALTER TABLE `swap_flow_event` + ADD COLUMN `is_penalty_interest` tinyint(1) NOT NULL DEFAULT 0 + COMMENT '是否罚息(EQD-6977):提前终止平仓时利息端按持有至到期计息。0=否,1=是' + AFTER `InterestClosePnL`; + +SET FOREIGN_KEY_CHECKS=1;