diff --git a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs index 4972eba5..5edf5907 100644 --- a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs +++ b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs @@ -187,7 +187,21 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator ? client.Name : $"{client.Manager}作为管理人代表{client.Name}"; - dic["主协议编号"] = client.MainProtocolCode ?? ""; + // 主协议编号:优先取 client 表字段,为空时从 client_meta 表兜底 + var mainProtocolCode = client.MainProtocolCode; + if (string.IsNullOrWhiteSpace(mainProtocolCode)) + { + mainProtocolCode = Context.GetClientMeta(client.id, ConsTradeMetaKey.MainProtocolCode)?.MetaValue; + } + dic["主协议编号"] = mainProtocolCode ?? ""; + + // 补充协议编号:优先取 client 表字段,为空时从 client_meta 表兜底 + var supProtocolCode = client.SupProtocolCode; + if (string.IsNullOrWhiteSpace(supProtocolCode)) + { + supProtocolCode = Context.GetClientMeta(client.id, ConsTradeMetaKey.SupProtocolCode)?.MetaValue; + } + dic["补充协议编号"] = supProtocolCode ?? ""; dic["名义本金"] = trade.OriginalStockEqvNotional?.ToString("N2") ?? "0.00"; // 银行账户信息 @@ -208,7 +222,7 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator var bond = JsonHelper.Deserialize(underlying.ExJson) ?? new UnderlyingBond(); dic["参考标的发行人"] = bond.UnderlyingIssuer ?? ""; dic["参考标的担保人"] = ""; - dic["票面利率"] = (bond.CouponRate ?? 0).ToString("N4"); + dic["票面利率"] = ((double)(bond.CouponRate ?? 0) * 100).ToString("N4"); dic["参考标的到期日"] = underlying.MaturityDate?.ToString("yyyy年M月d日") ?? ""; } @@ -326,7 +340,7 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator dic["利率类型"] = "浮动利率"; dic["IsFloat"] = "☑"; dic["固定利率"] = ""; - dic["利差"] = ((double)interestMargin.InterestRateDefault * 10000).ToString("N2"); + dic["利差"] = ((double)interestMargin.InterestRateDefault * 10000).ToString("N0"); dic["重置频率"] = (interestMargin.interest_rest_days ?? 0) + "天"; } }