From 99ffa9c2bb7ff119b67d72cd69ee3d60391a201c Mon Sep 17 00:00:00 2001 From: hjhan Date: Wed, 25 Mar 2026 10:40:12 +0800 Subject: [PATCH] =?UTF-8?q?style(logging):=20=E8=B0=83=E6=95=B4=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=BA=A7=E5=88=AB=E4=BB=8E=E9=94=99=E8=AF=AF=E5=88=B0?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20-=20=E5=B0=86=20QuotaMonitorService=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=A9=BA=E5=80=BC=E6=A3=80=E6=9F=A5=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=BB=8E=20Error=20=E7=BA=A7=E5=88=AB=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=20Info=20=E7=BA=A7=E5=88=AB=20-=20=E5=B0=86=20SwapEod?= =?UTF-8?q?PositionService=20=E4=B8=AD=E7=9A=84=E5=8F=82=E6=95=B0=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=97=A5=E5=BF=97=E4=BB=8E=20Error=20=E7=BA=A7?= =?UTF-8?q?=E5=88=AB=E6=94=B9=E4=B8=BA=20Info=20=E7=BA=A7=E5=88=AB=20-=20?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E5=8E=9F=E6=9C=89=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=8A=9B=E5=87=BA=E9=80=BB=E8=BE=91=E4=B8=8D=E5=8F=98=EF=BC=8C?= =?UTF-8?q?=E4=BB=85=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=20-=20=E7=BB=9F=E4=B8=80=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=9B=B8=E5=85=B3=E7=9A=84=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/RiskModule/QuotaMonitorService.cs | 8 ++++---- .../SwapModule/SwapEodPositionService.cs | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs b/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs index bf5b1926..7c43ed2c 100644 --- a/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs +++ b/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs @@ -4952,13 +4952,13 @@ namespace YLErp.Modules.RiskModule var item = positions[i]; if (item == null) { - _logger.Error($"[CheckUnderlyingWhiteList] 错误: positions[{i}] 为 null"); + _logger.Info($"[CheckUnderlyingWhiteList] positions[{i}] 为 null"); quotaMsg = "持仓数据异常:存在空记录"; return false; } if (string.IsNullOrEmpty(item.UnderlyingCode)) { - _logger.Error($"[CheckUnderlyingWhiteList] 错误: positions[{i}].UnderlyingCode 为 null 或空 - id: {item.id}, SwapTradeId: {item.SwapTradeId}"); + _logger.Info($"[CheckUnderlyingWhiteList] positions[{i}].UnderlyingCode 为 null 或空 - id: {item.id}, SwapTradeId: {item.SwapTradeId}"); quotaMsg = "持仓数据异常:标的代码为空"; return false; } @@ -5073,7 +5073,7 @@ namespace YLErp.Modules.RiskModule if (trades == null || trades.Count == 0) { - _logger.Error("[CheckFund] 错误: trades 为 null 或空列表"); + _logger.Info("[CheckFund] trades 为 null 或空列表"); msg = "交易列表为空"; return false; } @@ -5139,7 +5139,7 @@ namespace YLErp.Modules.RiskModule // 检查 ExerciseDate 是否为 null if (!trades[0].ExerciseDate.HasValue) { - _logger.Error($"[CheckFund] 错误: trades[0].ExerciseDate 为 null - tradeId: {trades[0].id}"); + _logger.Info($"[CheckFund] trades[0].ExerciseDate 为 null - tradeId: {trades[0].id}"); msg = "交易行权日期不能为空"; return false; } diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index c05a5b0a..95fef6b3 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -223,25 +223,25 @@ namespace YLErp.Modules.SwapModule // 验证关键参数 if (td == null) { - Log.Error("[DealInterests] 参数错误: td (trade) 为 null"); + Log.Info("[DealInterests] 参数验证: td (trade) 为 null"); throw new ArgumentNullException(nameof(td), "交易对象不能为null"); } if (interestList == null) { - Log.Error($"[DealInterests] 参数错误: interestList 为 null, td.id: {td.id}"); + Log.Info($"[DealInterests] 参数验证: interestList 为 null, td.id: {td.id}"); throw new ArgumentNullException(nameof(interestList), "利息腿列表不能为null"); } if (flowEvents == null) { - Log.Error($"[DealInterests] 参数错误: flowEvents 为 null, td.id: {td.id}"); + Log.Info($"[DealInterests] 参数验证: flowEvents 为 null, td.id: {td.id}"); throw new ArgumentNullException(nameof(flowEvents), "流水事件列表不能为null"); } if (autoInterests == null) { - Log.Error($"[DealInterests] 参数错误: autoInterests 为 null, td.id: {td.id}"); + Log.Info($"[DealInterests] 参数验证: autoInterests 为 null, td.id: {td.id}"); throw new ArgumentNullException(nameof(autoInterests), "自动互换列表不能为null"); } var hasClose = flowEvents.Any(x => x.EventType == (int)SwapEventTypeEnum.平仓); @@ -715,25 +715,25 @@ namespace YLErp.Modules.SwapModule // 详细的参数验证 if (td == null) { - Log.Error("[SaveAutoEodInterestPosition] 参数错误: td (trade) 为 null"); + Log.Info("[SaveAutoEodInterestPosition] 参数验证: td (trade) 为 null"); throw new ArgumentNullException(nameof(td), "交易对象不能为null"); } if (position == null) { - Log.Error($"[SaveAutoEodInterestPosition] 参数错误: position 为 null, td.id: {td.id}"); + Log.Info($"[SaveAutoEodInterestPosition] 参数验证: position 为 null, td.id: {td.id}"); throw new ArgumentNullException(nameof(position), "持仓对象不能为null"); } if (interval == null) { - Log.Error($"[SaveAutoEodInterestPosition] 参数错误: interval 为 null, td.id: {td.id}, position.id: {position.id}"); + Log.Info($"[SaveAutoEodInterestPosition] 参数验证: interval 为 null, td.id: {td.id}, position.id: {position.id}"); throw new ArgumentNullException(nameof(interval), "观察日信息不能为null"); } if (td.trade_extend == null) { - Log.Error($"[SaveAutoEodInterestPosition] 参数错误: td.trade_extend 为 null, td.id: {td.id}, td.TradeNumber: {td.TradeNumber}"); + Log.Info($"[SaveAutoEodInterestPosition] 参数验证: td.trade_extend 为 null, td.id: {td.id}, td.TradeNumber: {td.TradeNumber}"); throw new ArgumentNullException("td.trade_extend", "交易扩展信息不能为null"); } @@ -742,7 +742,7 @@ namespace YLErp.Modules.SwapModule // 验证 ExtendObj if (td.trade_extend.ExtendObj == null) { - Log.Error($"[SaveAutoEodInterestPosition] 参数错误: td.trade_extend.ExtendObj 为 null, td.id: {td.id}"); + Log.Info($"[SaveAutoEodInterestPosition] 参数验证: td.trade_extend.ExtendObj 为 null, td.id: {td.id}"); throw new ArgumentNullException("td.trade_extend.ExtendObj", "交易扩展对象不能为null"); }