feat:打通前后端链路。老风控新风控映射:禁止=》Error,需审批=》RiskWarning(新状态,需二次确认,并记录日志),提示、通过=》Success(提示增加TIpMessage)

This commit is contained in:
ruisu
2026-06-26 17:01:21 +08:00
parent 32b7de93e2
commit 0c2a4b3afb
10 changed files with 197 additions and 62 deletions
@@ -1,4 +1,4 @@
using BaseOUDAL;
using BaseOUDAL;
using DocumentFormat.OpenXml.Office2010.Excel;
using OfficeOpenXml.Drawing;
using Org.BouncyCastle.Ocsp;
@@ -46,7 +46,7 @@ namespace YLErp.Modules.TradeModule.DealModule
/// <summary>
/// 2021-02-04改造:批量确认因为耗时太长,用户多页面(交易列表,今日交易)并发确认导致生成多条期权费资金记录
/// </summary>
public TradeConfirmResultModel tradeConfirm(IEnumerable<int> tradeids, bool ignoreMoneyCheck = false, bool isSkipApproval = false)
public TradeConfirmResultModel tradeConfirm(IEnumerable<int> tradeids, bool ignoreMoneyCheck = false, bool isSkipApproval = false, bool ignoreRiskWarning = false)
{
if (tradeids is null || !tradeids.Any(n => n > 0))
{
@@ -76,6 +76,7 @@ namespace YLErp.Modules.TradeModule.DealModule
var hasTradeProcess = HasTradeProcess();
var sbError = new StringBuilder();
var sbTip = new StringBuilder();
var result = new TradeConfirmResultModel
{
confirmedTradeIds = new List<int>(),
@@ -99,7 +100,8 @@ namespace YLErp.Modules.TradeModule.DealModule
isSkipApproval: isSkipApproval,
confirmedTradeIds: result.confirmedTradeIds,
changeConfirmPaths: result.changeConfirmPaths,
continueQuotaCheck: idCache.Contains(pid));
continueQuotaCheck: idCache.Contains(pid),
ignoreRiskWarning: ignoreRiskWarning);
if (pid > 0)
{
idCache.Add(pid);
@@ -114,7 +116,8 @@ namespace YLErp.Modules.TradeModule.DealModule
result.LackOfMoney = true;
break;
}
if (temp.RetCode == TradeOpenRetCode.QuotaTrialError || temp.RetCode == TradeOpenRetCode.FundStatus)
//此处LackOfMoney仅仅代表需要前端二次处理,不代表资金缺乏,延用老逻辑
if (temp.RetCode == TradeOpenRetCode.QuotaTrialError || temp.RetCode == TradeOpenRetCode.FundStatus || temp.RetCode == TradeOpenRetCode.RiskWarning)
{
result.LackOfMoney = true;
result.TrialDataId = temp.TrialDataId;
@@ -128,6 +131,11 @@ namespace YLErp.Modules.TradeModule.DealModule
sbError.AppendLine(temp.ErrorMsg);
}
if (!string.IsNullOrEmpty(temp.TipMsg))
{
sbTip.AppendLine(temp.TipMsg);
}
Helpers.LockHelper.Release(lockKeyId);
}
}
@@ -135,6 +143,7 @@ namespace YLErp.Modules.TradeModule.DealModule
DbContext.SaveChanges();
result.errorMsg = sbError.ToString();
result.tipMsg = sbTip.ToString();
return result;
}
@@ -152,7 +161,7 @@ namespace YLErp.Modules.TradeModule.DealModule
/// <param name="continueQuotaCheck"></param>
/// <returns></returns>
private TradeOpenResult ConfirmTrade(int tid, bool isBatch, bool hasTradeProcess,
bool ignoreMoneyCheck, bool isSkipApproval, List<int> confirmedTradeIds, List<string> changeConfirmPaths, bool continueQuotaCheck = false)
bool ignoreMoneyCheck, bool isSkipApproval, List<int> confirmedTradeIds, List<string> changeConfirmPaths, bool continueQuotaCheck = false, bool ignoreRiskWarning = false)
{
var td = DbContext.trade.FirstOrDefault(t => t.id == tid);
var result = new TradeOpenResult(td ?? new trade());
@@ -207,7 +216,7 @@ namespace YLErp.Modules.TradeModule.DealModule
}
var trialService = new QuotaMonitorService(this);
if (!trialService.QuotaCheck(ref result))
if (!trialService.QuotaCheck(ref result, ignoreRiskWarning))
{
return result;
}
@@ -223,6 +232,10 @@ namespace YLErp.Modules.TradeModule.DealModule
history = "特权账户批量确认自动" + history;
}
}
else if (ignoreRiskWarning)
{
history = "风控预警确认-" + history;
}
//进入交易审批流程
if (hasTradeProcess && !isSkipApproval)
{
@@ -609,6 +622,7 @@ namespace YLErp.Modules.TradeModule.DealModule
public List<int> confirmedTradeIds;
public List<string> changeConfirmPaths;
public string errorMsg;
public string tipMsg;
public string type;
}
}
@@ -1,4 +1,4 @@
using BaseOUDAL;
using BaseOUDAL;
using YLErp.BLL;
using YLErp.BLL.Eod;
using YLErp.Model;
@@ -792,6 +792,10 @@ namespace YLErp.Modules.TradeModule.DealModule
/// 错误信息
/// </summary>
public string ErrorMsg;
/// <summary>
/// 提示信息
/// </summary>
public string TipMsg;
/// <summary>
/// 变更确认书路径
@@ -831,6 +835,10 @@ namespace YLErp.Modules.TradeModule.DealModule
/// </summary>
FundStatus,
/// <summary>
/// 风控预警二次确认
/// </summary>
RiskWarning,
/// <summary>
/// 无审核权限
/// </summary>
NoRight