feat: 保证金链路补全排查日志(Info为主,仅追保顶层异常用Error)

- EOD追保生成主流程:入口汇总/六处跳过原因/决策中间量(维持·已缴·目标·已补足·增量)/建腿落库/幂等清理/收尾汇总,顶层异常Error留栈
- 预付金模板取数:三级层级命中来源(交易绑定/客户默认/全局默认)+明细行命中(品种·期限档·x/y),null返回各留一句
- 规则15引擎:成功路径补收盘价→维持保证金,与既有无价格告警闭环
- EOD/实时客户资金:每客户一行维度分流结果(MarginWatchRule·可用资金·追保金额·可取资金及全部输入)
- 预付金缺口查询:非规则15剔除数与按客户追加合计;预付金簿记:授信/现金拆分结果
This commit is contained in:
hjhan
2026-08-28 12:08:27 +08:00
parent e52f5bfeb5
commit 03629a6dcd
7 changed files with 95 additions and 6 deletions
@@ -1,6 +1,7 @@
using YLErp.BLL;
using YLErp.DBModels;
using YLErp.Enums;
using YLErp.Helpers;
using YLErp.Modules.MarginModule;
namespace YLErp.Modules.SwapModule.Margin
@@ -18,6 +19,8 @@ namespace YLErp.Modules.SwapModule.Margin
/// </summary>
public static class SwapSpanBalanceQueryService
{
private static readonly IYcLogger logger = LogFactory.GetLogger("预付金缺口查询");
/// <summary>
/// 客户维度输入:互换初始保证金(净收取为正,按客户汇总)。
/// 初始保证金 = 应付预付金流水收付净额 + 初始预付金授信占用净额(非"追加保证金"前缀、关联交易)——
@@ -95,6 +98,11 @@ namespace YLErp.Modules.SwapModule.Margin
.Select(t => t.id)
.ToHashSet();
maintenance = maintenance.Where(x => rule15TradeIds.Contains(x.TradeId)).ToList();
var droppedCount = spanTradeIds.Count - rule15TradeIds.Count;
if (droppedCount > 0)
{
logger.Info($"预付金缺口查询:{valueDate:yyyy-MM-dd} {droppedCount}笔有span交易模板非规则15(或三级未命中),不计入交易维度追加合计");
}
if (maintenance.Count == 0)
{
return result;
@@ -142,6 +150,8 @@ namespace YLErp.Modules.SwapModule.Margin
result[group.Key] = total;
}
logger.Info($"预付金缺口查询:{valueDate:yyyy-MM-dd} 规则15交易{rule15TradeIds.Count}笔,客户{result.Count}个,交易维度追加合计:{string.Join("", result.Select(kv => $"{kv.Key}={kv.Value:0.00}"))}");
return result;
}
}