Files
zszq-trs/Framework/YLErp.Core/DBModels/BondPayment.cs
T
张名锐 392e36a820 feat(bond): 添加公司行为现金分红标识并优化付息计算逻辑
- 在 BondPayment 模型中添加 IsCorporateActionCashDividend 属性用于区分不同数据来源
- 修改 BondPaymentService 中的 CalcPayment 方法,按每条记录来源分别处理金额单位转换
- 更新单元测试以验证混合债券付息和公司行为分红的正确计算
- 移除不再需要的 useBondPriceScale 参数简化方法接口
- 修正注释说明以反映新的按记录类型分别计算的逻辑
2026-08-21 16:51:55 +08:00

125 lines
3.7 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YieldChain.Security;
using YLErp.DBModels.Base;
namespace YLErp.DBModels
{
/// <summary>
/// 债券期间付息表
/// </summary>
[Table("bond_payment_info")]
public class BondPayment
{
public long id { get; set; }
/// <summary>
/// 加密主键
/// </summary>
[NotMapped]
public string EncryptId
{
get { return DataProtect.Encrypt(id.ToString()); }
}
/// <summary>
/// 债券代码
/// </summary>
[Column("inner_code")]
public int inner_code { get; set; }
[Column("underlying_code")]
public string underlyingCode { get; set; }
/// <summary>
/// 债券代码
/// </summary>
[DisplayName("债券代码")]
[NotMapped]
public string security_id { get; set; }
/// <summary>
/// 债券名称
/// </summary>
[DisplayName("债券名称")]
[NotMapped]
public string symbol { get; set; }
/// <summary>
/// 利息税率(%)
/// </summary>
[DisplayName("利息税率(%)")]
[Column("interest_tax_rate")]
public decimal? coupon_rate { get; set; }
/// <summary>
/// 现金流发放日
/// </summary>
[DisplayName("理论付息(兑付)日")]
[Column("pay_date_PL")]
public DateTime? payment_date_pl { get; set; }
/// <summary>
/// 现金流发放日
/// </summary>
[DisplayName("实际付息(兑付)日")]
[Column("pay_date_act")]
public DateTime? payment_date { get; set; }
/// <summary>
/// 债权登记日(除息/归属截止日)——票息归属按此判定,而非支付日
/// </summary>
[DisplayName("债权登记日")]
[Column("reg_date")]
public DateTime? reg_date { get; set; }
/// <summary>
/// 每张兑付利息额
/// </summary>
[DisplayName("每张兑付利息额")]
[Column("paying_interest")]
public decimal? payment_interest { get; set; }
/// <summary>
/// 每张兑付本金额
/// </summary>
[DisplayName("每张兑付本金额")]
[Column("paying_principal")]
public decimal? payment_parvalue { get; set; }
/// <summary>
/// 每张兑付本息额
/// </summary>
[DisplayName("每张兑付本息额")]
[Column("paying_price")]
public decimal? paying_price { get; set; }
/// <summary>
/// 渠道来源
/// </summary>
[Column("info_source")]
public string channel_source { get; set; }
/// <summary>
/// 聚源JSID
/// </summary>
public long jsid { get; set; }
/// <summary>
/// 发布时间
/// </summary>
[Column("insert_time")]
public DateTime? create_time { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[DisplayName("更新时间")]
[Column("update_time")]
public DateTime? update_time { get; set; }
/// <summary>
/// 是否由 ex_dividend_info 在内存中补充的 Stock/Fund 公司行为现金分红。
/// bond_payment_info 原生记录的 paying_interest 按每 100 份存储;公司行为记录的
/// GiveCashAmount 按每 10 份存储。该标记只在运行时区分两种金额单位,不落库。
/// </summary>
[NotMapped]
public bool IsCorporateActionCashDividend { get; set; }
}
}