fix(dividend): 公司行为优化

- 债券付息查询/BondPayment/BondPaymentList这个界面 不再查询公司行为除权表

- 公司行为事件的说明 格式化一下变为:调整前:名义本金:XXXX  期初标的价格:XXXX 持仓数量:XXXX
调整后:名义本金:XXXX  期初标的价格:XXXX 持仓数量:XXXX

- 报错信息修改:当某个标的的除权除息数据仍有交易引用时
则修改标的公司行为数据时则提示“不可修改,有交易【交易编号】使用了该条除权除息数据”。
This commit is contained in:
张名锐
2026-08-25 15:39:01 +08:00
parent 695d78810f
commit f7766fb723
7 changed files with 154 additions and 93 deletions
@@ -247,8 +247,8 @@ namespace YLErp.Modules.SwapModule
}
/// <summary>
/// 公司行为说明使用稳定的键值格式,完整保留调整前后名义本金、价格、数量
/// 待实现分红和现金流变化,操作历史无需重新计算即可核对
/// 公司行为说明仅展示调整前后名义本金、期初标的价格和持仓数量
/// 便于操作历史直接比对持仓基线
/// </summary>
public static string BuildCorporateActionEventReason(CorporateActionEventData data)
{
@@ -257,37 +257,11 @@ namespace YLErp.Modules.SwapModule
return "公司行为快照为空";
}
// 使用 InvariantCulture 固定小数与日期格式,说明文本不随服务器区域设置变化。
// 使用 InvariantCulture 固定小数格式,说明文本不随服务器区域设置变化。
string D(decimal value) => value.ToString(CultureInfo.InvariantCulture);
string Date(DateTime? value) => value.HasValue
? value.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)
: "";
return string.Join("; ", new[]
{
$"公司行为[{data.UnderlyingCode}]",
$"ExDividendDate={Date(data.ExDividendDate)}",
$"EffectiveDate={Date(data.EffectiveDate)}",
$"ExDividendInfoId={data.ExDividendInfoId}",
$"PositionId={data.PositionId}",
$"GiveCashAmount={D(data.GiveCashAmount)}",
$"GiveShareAmount={D(data.GiveShareAmount)}",
$"Split={(data.Split.HasValue ? D(data.Split.Value) : "")}",
$"RationedSharesAmount={D(data.RationedSharesAmount)}",
$"RationedSharesPrice={D(data.RationedSharesPrice)}",
"调整前",
$"BeforeNotional={D(data.BeforeNotional)}",
$"BeforePrice={D(data.BeforePrice)}",
$"BeforeQuantity={D(data.BeforeQuantity)}",
$"BeforePendingDividend={D(data.BeforePendingDividend)}",
"调整后",
$"AfterNotional={D(data.AfterNotional)}",
$"AfterPrice={D(data.AfterPrice)}",
$"AfterQuantity={D(data.AfterQuantity)}",
$"AfterPendingDividend={D(data.AfterPendingDividend)}",
$"CashFlowChange={D(data.CashFlowChange)}",
$"Applied={data.Applied}"
});
return $"调整前:名义本金:{D(data.BeforeNotional)} 期初标的价格:{D(data.BeforePrice)} 持仓数量:{D(data.BeforeQuantity)}"
+ Environment.NewLine
+ $"调整后:名义本金:{D(data.AfterNotional)} 期初标的价格:{D(data.AfterPrice)} 持仓数量:{D(data.AfterQuantity)}";
}
public void DeleteEvent(int tradeId)