diff --git a/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs b/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs index 1997faf2..f47b6cee 100644 --- a/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs +++ b/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs @@ -4464,12 +4464,7 @@ namespace YLErp.Modules.RiskModule public bool QuotaCheck(ref TradeOpenResult res) { - return QuotaCheck(ref res, false); - } - - public bool QuotaCheck(ref TradeOpenResult res, bool ignoreRiskWarning) - { - if (res == null || res.Trade == null) + if (res == null && res.Trade == null) { throw new ArgumentNullException(nameof(res)); } @@ -4478,7 +4473,7 @@ namespace YLErp.Modules.RiskModule var tradeNumber = DbContext.trade.Where(O => O.id == tradeId).Select(O => O.TradeNumber).FirstOrDefault(); var trialService = new QuotaMonitorService(this); var quotaObj = trialService.QuotaCheck(tradeId, 1); - if (quotaObj.TrialStatus == QuotaTrialStatusEnum.Success)//这次计算结果是通过,直接通过 + if (quotaObj.TrialStatus == QuotaTrialStatusEnum.Success)//这次计算结果是通过,直接通过 { if (!string.IsNullOrWhiteSpace(quotaObj.AvailableForClient)) // 返回用户资金情况 { @@ -4486,12 +4481,6 @@ namespace YLErp.Modules.RiskModule res.TrialDataId = quotaObj.id; return false; } - //成功状态下,如果触发TIp检查,提示用户 - if (!string.IsNullOrWhiteSpace(quotaObj.RiskWarningDetails)) - { - res.TrialDataId = quotaObj.id; - res.TipMsg = quotaObj.RiskWarningDetails; - } return true; } var lastTrial = trialService.QueryLastQuotaTrial(tradeId, true); @@ -4500,27 +4489,8 @@ namespace YLErp.Modules.RiskModule new TradeRiskCheckLogService(UserInfo).AddLog(quotaObj); } //否则的情况是上次没算,这次是预警,或上次算了,结果是不通过\通过或预警,这次是预警或不通过,提示用户; + res.RetCode = TradeOpenRetCode.QuotaTrialError; res.TrialDataId = quotaObj.id; - //汇总各类检查详情,避免只展示RiskWarningDetails而漏掉其它老风控检查 - var detailParts = new List(); - if (!string.IsNullOrWhiteSpace(quotaObj.FundCheckDetails)) - detailParts.Add($"应付资金检查:{quotaObj.FundCheckDetails}"); - if (!string.IsNullOrWhiteSpace(quotaObj.QuotaCheckDetails)) - detailParts.Add($"限额检查:{quotaObj.QuotaCheckDetails}"); - if (!string.IsNullOrWhiteSpace(quotaObj.RiskWarningDetails)) - detailParts.Add($"风险预警:{quotaObj.RiskWarningDetails}"); - if (!string.IsNullOrWhiteSpace(quotaObj.QuotaWarningDetails)) - detailParts.Add($"限额预警:{quotaObj.QuotaWarningDetails}"); - res.ErrorMsg = string.Join("\n", detailParts); - var isRiskApprovalWarning = quotaObj.TrialStatus == QuotaTrialStatusEnum.Warning - && !string.IsNullOrWhiteSpace(quotaObj.RiskWarningDetails); - //需清除ErrorMsg,不然外部调用会认为失败 - if (ignoreRiskWarning && isRiskApprovalWarning) - { - res.ErrorMsg = string.Empty; - return true; - } - res.RetCode = isRiskApprovalWarning ? TradeOpenRetCode.RiskWarning : TradeOpenRetCode.QuotaTrialError; return false; } diff --git a/YLErpDAL/Modules/RiskModule/TradeRiskCheckLogService.cs b/YLErpDAL/Modules/RiskModule/TradeRiskCheckLogService.cs index 53ac78c3..4456edfe 100644 --- a/YLErpDAL/Modules/RiskModule/TradeRiskCheckLogService.cs +++ b/YLErpDAL/Modules/RiskModule/TradeRiskCheckLogService.cs @@ -146,39 +146,6 @@ namespace YLErp.Modules.RiskModule DbContext.SaveChanges(); } - public void AddWarningDecisionLog(int quotaTrialId, string decision) - { - var quotaTrial = DbContext.quotaTrial.FirstOrDefault(x => x.id == quotaTrialId); - if (quotaTrial == null) - { - return; - } - var td = DbContext.trade.FirstOrDefault(x => x.id == quotaTrial.TradeId); - trade_risk_check_log log = new trade_risk_check_log(); - if (td != null) - { - var client = DataCacheProvider.GetClientDataSource().GetData(td.ClientId); - log.client_number = client?.Number; - } - var worker = new IdWorker(1, 1); - log.id = worker.NextId(); - log.trial_result = (int)quotaTrial.TrialStatus; - log.client_name = quotaTrial.ClientName; - log.trader = td?.TraderName; - log.trade_number = quotaTrial.TradeNumber; - log.risk_warning = string.IsNullOrWhiteSpace(quotaTrial.RiskWarningDetails) - ? $"[风控预警处理]{decision}" - : quotaTrial.RiskWarningDetails + Environment.NewLine + $"[风控预警处理]{decision}"; - log.limit_warning = quotaTrial.QuotaCheckDetails; - log.remark = string.IsNullOrWhiteSpace(quotaTrial.Remark) - ? $"风控预警处理结果:{decision}" - : quotaTrial.Remark + ";风控预警处理结果:" + decision; - log.create_user = UserId; - log.create_time = DateTime.Now; - DbContext.trade_risk_check_log.Add(log); - DbContext.SaveChanges(); - } - /// /// 回退重置 /// diff --git a/YLErpDAL/Modules/TradeModule/DealModule/TradeConfirmService.cs b/YLErpDAL/Modules/TradeModule/DealModule/TradeConfirmService.cs index bedb5873..ad24077c 100644 --- a/YLErpDAL/Modules/TradeModule/DealModule/TradeConfirmService.cs +++ b/YLErpDAL/Modules/TradeModule/DealModule/TradeConfirmService.cs @@ -46,7 +46,7 @@ namespace YLErp.Modules.TradeModule.DealModule /// /// 2021-02-04改造:批量确认因为耗时太长,用户多页面(交易列表,今日交易)并发确认导致生成多条期权费资金记录 /// - public TradeConfirmResultModel tradeConfirm(IEnumerable tradeids, bool ignoreMoneyCheck = false, bool isSkipApproval = false, bool ignoreRiskWarning = false) + public TradeConfirmResultModel tradeConfirm(IEnumerable tradeids, bool ignoreMoneyCheck = false, bool isSkipApproval = false) { if (tradeids is null || !tradeids.Any(n => n > 0)) { @@ -76,7 +76,6 @@ namespace YLErp.Modules.TradeModule.DealModule var hasTradeProcess = HasTradeProcess(); var sbError = new StringBuilder(); - var sbTip = new StringBuilder(); var result = new TradeConfirmResultModel { confirmedTradeIds = new List(), @@ -100,8 +99,7 @@ namespace YLErp.Modules.TradeModule.DealModule isSkipApproval: isSkipApproval, confirmedTradeIds: result.confirmedTradeIds, changeConfirmPaths: result.changeConfirmPaths, - continueQuotaCheck: idCache.Contains(pid), - ignoreRiskWarning: ignoreRiskWarning); + continueQuotaCheck: idCache.Contains(pid)); if (pid > 0) { idCache.Add(pid); @@ -116,8 +114,7 @@ namespace YLErp.Modules.TradeModule.DealModule result.LackOfMoney = true; break; } - //此处LackOfMoney仅仅代表需要前端二次处理,不代表资金缺乏,延用老逻辑 - if (temp.RetCode == TradeOpenRetCode.QuotaTrialError || temp.RetCode == TradeOpenRetCode.FundStatus || temp.RetCode == TradeOpenRetCode.RiskWarning) + if (temp.RetCode == TradeOpenRetCode.QuotaTrialError || temp.RetCode == TradeOpenRetCode.FundStatus) { result.LackOfMoney = true; result.TrialDataId = temp.TrialDataId; @@ -131,12 +128,6 @@ namespace YLErp.Modules.TradeModule.DealModule sbError.AppendLine(temp.ErrorMsg); } - if (!string.IsNullOrEmpty(temp.TipMsg)) - { - result.TrialDataId = temp.TrialDataId; - sbTip.AppendLine(temp.TipMsg); - } - Helpers.LockHelper.Release(lockKeyId); } } @@ -144,7 +135,6 @@ namespace YLErp.Modules.TradeModule.DealModule DbContext.SaveChanges(); result.errorMsg = sbError.ToString(); - result.tipMsg = sbTip.ToString(); return result; } @@ -162,7 +152,7 @@ namespace YLErp.Modules.TradeModule.DealModule /// /// private TradeOpenResult ConfirmTrade(int tid, bool isBatch, bool hasTradeProcess, - bool ignoreMoneyCheck, bool isSkipApproval, List confirmedTradeIds, List changeConfirmPaths, bool continueQuotaCheck = false, bool ignoreRiskWarning = false) + bool ignoreMoneyCheck, bool isSkipApproval, List confirmedTradeIds, List changeConfirmPaths, bool continueQuotaCheck = false) { var td = DbContext.trade.FirstOrDefault(t => t.id == tid); var result = new TradeOpenResult(td ?? new trade()); @@ -217,7 +207,7 @@ namespace YLErp.Modules.TradeModule.DealModule } var trialService = new QuotaMonitorService(this); - if (!trialService.QuotaCheck(ref result, ignoreRiskWarning)) + if (!trialService.QuotaCheck(ref result)) { return result; } @@ -233,10 +223,6 @@ namespace YLErp.Modules.TradeModule.DealModule history = "特权账户批量确认自动" + history; } } - else if (ignoreRiskWarning) - { - history = "风控预警确认-" + history; - } //进入交易审批流程 if (hasTradeProcess && !isSkipApproval) { @@ -623,7 +609,6 @@ namespace YLErp.Modules.TradeModule.DealModule public List confirmedTradeIds; public List changeConfirmPaths; public string errorMsg; - public string tipMsg; public string type; } } diff --git a/YLErpDAL/Modules/TradeModule/DealModule/TradeOpenService.cs b/YLErpDAL/Modules/TradeModule/DealModule/TradeOpenService.cs index 448967ec..3819c4d1 100644 --- a/YLErpDAL/Modules/TradeModule/DealModule/TradeOpenService.cs +++ b/YLErpDAL/Modules/TradeModule/DealModule/TradeOpenService.cs @@ -792,10 +792,6 @@ namespace YLErp.Modules.TradeModule.DealModule /// 错误信息 /// public string ErrorMsg; - /// - /// 提示信息 - /// - public string TipMsg; /// /// 变更确认书路径 @@ -835,10 +831,6 @@ namespace YLErp.Modules.TradeModule.DealModule /// FundStatus, /// - /// 风控预警二次确认 - /// - RiskWarning, - /// /// 无审核权限 /// NoRight diff --git a/YLErpDAL/Modules/TradeModule/TradeBLL.cs b/YLErpDAL/Modules/TradeModule/TradeBLL.cs index 993be3a9..dc3d354a 100644 --- a/YLErpDAL/Modules/TradeModule/TradeBLL.cs +++ b/YLErpDAL/Modules/TradeModule/TradeBLL.cs @@ -25,8 +25,6 @@ namespace YLErp.BLL /// public const string LackOfMoney = "LackOfMoney"; - public const string RiskWarningConfirm = "RiskWarningConfirm"; - public const string IgnoreBreak = "IgnoreBreak"; /// diff --git a/YLErpWeb/App_Data/Config/otcformat.js b/YLErpWeb/App_Data/Config/otcformat.js index 92b1f226..d4c79353 100644 --- a/YLErpWeb/App_Data/Config/otcformat.js +++ b/YLErpWeb/App_Data/Config/otcformat.js @@ -1,2 +1,125 @@ var main = main || {}; -main.formatOptions = { "trading": { "umprice": { "trimTailZeros": true, "precision": 9, "grouping": true, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "umpriceP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "umpricePR": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "tradeSinglePrice": { "trimTailZeros": true, "precision": 9, "grouping": true, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "premiumRateP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "premiumRate": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "tradePrice": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "StockEqvNotional": { "trimTailZeros": true, "precision": 9, "grouping": true, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "notional": { "trimTailZeros": true, "precision": 9, "grouping": true, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "notionalP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "volatility": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "volatilityP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "greek": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "marginRateP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "marginRate": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 } } }; \ No newline at end of file +main.formatOptions={ + "trading": { + "umprice": { + "precision": 9, + "grouping": true, + "rounded": true, + "percent": false, + "minDecimals": 9, + "maxDecimals": 0 + }, + "umpriceP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "umpricePR": { + "precision": 4, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 4, + "maxDecimals": 2 + }, + "tradeSinglePrice": { + "precision": 2, + "grouping": true, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "premiumRateP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "premiumRate": { + "precision": 4, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 4, + "maxDecimals": 2 + }, + "tradePrice": { + "precision": 2, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "StockEqvNotional": { + "precision": 2, + "grouping": true, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "notional": { + "precision": 2, + "grouping": true, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "notionalP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "volatility": { + "precision": 4, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 4, + "maxDecimals": 2 + }, + "volatilityP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "greek": { + "precision": 2, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "marginRateP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "marginRate": { + "precision": 4, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 4, + "maxDecimals": 2 + } + } +}; \ No newline at end of file diff --git a/YLErpWeb/Controllers/tradeController.cs b/YLErpWeb/Controllers/tradeController.cs index 9959628b..428a4c66 100644 --- a/YLErpWeb/Controllers/tradeController.cs +++ b/YLErpWeb/Controllers/tradeController.cs @@ -2456,35 +2456,18 @@ namespace YLErp.Web.Controllers } var config = valuedateBLL.SystemDate; var ignoreMoneyCheck = tradeidArr.Count() == 1 && additionalProcessing == tradeBLL.LackOfMoney; - var ignoreRiskWarning = tradeidArr.Count() == 1 && additionalProcessing == tradeBLL.RiskWarningConfirm; var isSkipApproval = false; if (CurUser.交易管理_特批批量确认 && isSkipCheck) { ignoreMoneyCheck = true; isSkipApproval = true; } - var result = new TradeConfirmService(CurUser).tradeConfirm(tradeidArr, ignoreMoneyCheck, isSkipApproval, ignoreRiskWarning); + var result = new TradeConfirmService(CurUser).tradeConfirm(tradeidArr, ignoreMoneyCheck, isSkipApproval); //如果客户缺少资金而操作者有交易特批权限 - if (!ignoreMoneyCheck && !ignoreRiskWarning && result.LackOfMoney) + if (!ignoreMoneyCheck && result.LackOfMoney) { - if (result.type == TradeOpenRetCode.RiskWarning.ToString()) - { - return JsonSuccessData(new { proccessType = "AdditionalProcessing", type = tradeBLL.RiskWarningConfirm, TrialDataId = result.TrialDataId, message = result.errorMsg, typecode = result.type }); - } - if (result.type == TradeOpenRetCode.FundStatus.ToString()) - { - return JsonSuccessData(new { proccessType = "AdditionalProcessing", type = "", TrialDataId = result.TrialDataId, message = result.errorMsg, typecode = result.type }); - } - if (result.type == TradeOpenRetCode.LackOfMoney.ToString() || ((PS.Config.ErpElement.Company == Configuration.CompanyEnum.天风 || config.SpecialOperateForTrade == 1) && string.IsNullOrWhiteSpace(result.type))) - { - return JsonSuccessData(new { proccessType = "AdditionalProcessing", type = tradeBLL.LackOfMoney, TrialDataId = result.TrialDataId, message = result.errorMsg, typecode = result.type }); - } - //限额试算不通过(老风控检查失败),展示详情但不允许审批 - if (result.type == TradeOpenRetCode.QuotaTrialError.ToString()) - { - return JsonSuccessData(new { proccessType = "QuotaTrialError", TrialDataId = result.TrialDataId, message = result.errorMsg, typecode = result.type }); - } + return JsonSuccessData(new { proccessType = "AdditionalProcessing", type = PS.Config.ErpElement.Company == Configuration.CompanyEnum.天风 || config.SpecialOperateForTrade == 1 ? tradeBLL.LackOfMoney : "", TrialDataId = result.TrialDataId, message = result.errorMsg, typecode = result.type }); } //生成交易确认书 @@ -2492,7 +2475,7 @@ namespace YLErp.Web.Controllers { new TradeContractGenerateService(CurUser).GenerateContractsAsync(result.confirmedTradeIds, "确认书"); } - //有ErrorMsg则认为失败 + if (!string.IsNullOrEmpty(result.errorMsg)) { if (result.changeConfirmPaths?.Count > 0) @@ -2503,12 +2486,11 @@ namespace YLErp.Web.Controllers } else { - var successMsg = string.IsNullOrWhiteSpace(result.tipMsg) ? "操作完成" : result.tipMsg; if (result.changeConfirmPaths?.Count > 0) { - return JsonSuccess(successMsg, new { generateChangeSuccess = true, url = result.changeConfirmPaths, TrialDataId = result.TrialDataId }); + return JsonSuccess("操作完成", new { generateChangeSuccess = true, url = result.changeConfirmPaths }); } - return JsonSuccess(successMsg, new { TrialDataId = result.TrialDataId }); + return JsonSuccess("操作完成"); } } @@ -8414,20 +8396,6 @@ namespace YLErp.Web.Controllers return JsonSuccess(); } - public JsonResult SaveRiskWarningDecisionLog(int quotaTrialId, string decision) - { - try - { - new TradeRiskCheckLogService(CurUser).AddWarningDecisionLog(quotaTrialId, decision); - } - catch (Exception ex) - { - LogFactory.GetLogger("SaveRiskWarningDecisionLog").Error(ex); - return JsonError("保存风控预警处理结果失败!"); - } - return JsonSuccess(); - } - [MyAuthorize("风险控制-接口审批列表")] public ActionResult InterfaceApproval() { diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeView.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeView.js index 8527190b..f32dc0ea 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeView.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeView.js @@ -59,61 +59,8 @@ var confirmFunc = function (id, additionalProcessing) { main.message(data.msg); return; } - - if (data.obj && data.obj.proccessType === "QuotaTrialError") { - //限额试算不通过(老风控检查失败),展示详情表格但不允许审批 - if (data.obj.TrialDataId) { - var quotaTrialErrorLayerSetting = { - type: 2, - title: "提示", - shadeClose: false, - shade: 0.4, - area: ['800px', '500px'], - content: "/trade/showQuotaTrial?id=" + data.obj.TrialDataId, - yes: function (index) { - layer.close(layerIndex); - }, - cancel: function () { - if (window.parent && window.parent.reloadtrade) { - window.parent.reloadtrade(); - } - layer.close(layerIndex); - } - }; - quotaTrialErrorLayerSetting.btn = ["关闭"]; - layerIndex = layer.open(quotaTrialErrorLayerSetting); - } - else if (data.obj.message) { - main.message(data.obj.message); - } - return; - } if (data.obj && data.obj.proccessType === "AdditionalProcessing") { if (data.obj.TrialDataId) { - var isRiskWarningConfirm = data.obj.type === "RiskWarningConfirm"; - var additionalProcessingType = isRiskWarningConfirm ? "RiskWarningConfirm" : "LackOfMoney"; - var saveQuotaTrial = function (obj) { - var saveSuccess = true; - if (obj.Data.Remark && obj.Data.Remark.length > 0) { - main.post("/trade/SaveQuotaTrial", obj.Data, { async: false }).done(function (res) { - if (!res || !res.success) { - saveSuccess = false; - main.message(res.msg); - } - }); - } - return saveSuccess; - }; - var saveRiskWarningDecisionLog = function (quotaTrialId, decision) { - var saveSuccess = true; - main.post("/trade/SaveRiskWarningDecisionLog", { quotaTrialId: quotaTrialId, decision: decision }, { async: false }).done(function (res) { - if (!res || !res.success) { - saveSuccess = false; - main.message(res.msg); - } - }); - return saveSuccess; - }; var layerSetting = { type: 2, title: "提示", @@ -123,27 +70,19 @@ var confirmFunc = function (id, additionalProcessing) { content: "/trade/showQuotaTrial?id=" + data.obj.TrialDataId, yes: function (index) { var obj = window["layui-layer-iframe" + index].page; - if (!obj.Data.Remark || obj.Data.Remark.length <= 0) { - main.message("必须填写说明内容,才可以录入交易"); + if (obj.Data.Remark && obj.Data.Remark.length > 0) { + main.post("/trade/SaveQuotaTrial", obj.Data, { async: false }).done(function (res) { + if (!res || !res.success) { + main.message(res.msg); + } + }); + layer.close(layerIndex); + confirmFunc(id, "LackOfMoney"); return; } - if (!saveQuotaTrial(obj)) { - return; - } - if (isRiskWarningConfirm) { - if (!saveRiskWarningDecisionLog(obj.Data.id, "确认通过")) { - return; - } - } - layer.close(layerIndex); - confirmFunc(id, additionalProcessingType); + main.message("必须填写说明内容,才可以录入交易"); }, cancel: function () { - var iframeWindow = window["layui-layer-iframe" + this.index]; - var pageObj = iframeWindow && iframeWindow.page; - if (isRiskWarningConfirm && pageObj && pageObj.Data && pageObj.Data.id) { - saveRiskWarningDecisionLog(pageObj.Data.id, "取消不通过"); - } if (window.parent && window.parent.reloadtrade) { window.parent.reloadtrade(); } @@ -153,11 +92,8 @@ var confirmFunc = function (id, additionalProcessing) { if (data.obj.type === "LackOfMoney") { layerSetting.btn = [page.buttonStr, '取消']; } - else if (isRiskWarningConfirm) { - layerSetting.btn = ["交易特批", '取消']; - } - // 只展示“资金状况”的情况 - else if (data.obj.typecode === "FundStatus") { + // 只展示"资金状况"的情况 + if (data.obj.typecode === "FundStatus") { layerSetting.btn = ["确认", '取消']; } @@ -170,38 +106,6 @@ var confirmFunc = function (id, additionalProcessing) { } return; } - if (data.msg && data.msg !== "操作完成") { - //新风控 ShowTip 提示:交易已确认成功,但触发提示规则,弹窗展示试算详情 - if (data.obj && data.obj.TrialDataId) { - var showTipLayerSetting = { - type: 2, - title: "提示", - shadeClose: false, - shade: 0.4, - area: ['800px', '500px'], - content: "/trade/showQuotaTrial?id=" + data.obj.TrialDataId, - yes: function (index) { - layer.close(layerIndex); - closetradeWindow(); - }, - cancel: function () { - if (window.parent && window.parent.reloadtrade) { - window.parent.reloadtrade(); - } - layer.close(layerIndex); - closetradeWindow(); - } - }; - showTipLayerSetting.btn = ["关闭"]; - layerIndex = layer.open(showTipLayerSetting); - } - else { - main.alert(data.msg, function () { - closetradeWindow(); - }); - } - return; - } if (window.parent && window.parent.reloadtrade) { window.parent.reloadtrade(); } @@ -211,8 +115,6 @@ var confirmFunc = function (id, additionalProcessing) { } } closetradeWindow(); - }).fail(function (err) { - console.log("[swapTradeView.tradeConfirm] fail, err=", err); }); }; function confirmTrade(id) { diff --git a/YLErpWeb/wwwroot/Scripts/app/trade/tradeview.js b/YLErpWeb/wwwroot/Scripts/app/trade/tradeview.js index c1943d3b..85b56acb 100644 --- a/YLErpWeb/wwwroot/Scripts/app/trade/tradeview.js +++ b/YLErpWeb/wwwroot/Scripts/app/trade/tradeview.js @@ -85,34 +85,6 @@ var confirmFunc = function (id, additionalProcessing) { } if (data.obj && data.obj.proccessType === "AdditionalProcessing") { if (data.obj.TrialDataId) { - var isRiskWarningConfirm = data.obj.type === "RiskWarningConfirm"; - var additionalProcessingType = isRiskWarningConfirm ? "RiskWarningConfirm" : "LackOfMoney"; - var saveQuotaTrial = function (obj) { - var saveSuccess = true; - if (obj.IsTF && (!obj.Data.Remark || obj.Data.Remark.length <= 0)) { - main.message("必须填写说明内容,才可以录入交易"); - return false; - } - if (obj.Data.Remark && obj.Data.Remark.length > 0) { - main.post("/trade/SaveQuotaTrial", obj.Data, { async: false }).done(function (res) { - if (!res || !res.success) { - saveSuccess = false; - main.message(res.msg); - } - }); - } - return saveSuccess; - }; - var saveRiskWarningDecisionLog = function (quotaTrialId, decision) { - var saveSuccess = true; - main.post("/trade/SaveRiskWarningDecisionLog", { quotaTrialId: quotaTrialId, decision: decision }, { async: false }).done(function (res) { - if (!res || !res.success) { - saveSuccess = false; - main.message(res.msg); - } - }); - return saveSuccess; - }; var layerSetting = { type: 2, title: "提示", @@ -122,23 +94,31 @@ var confirmFunc = function (id, additionalProcessing) { content: "/trade/showQuotaTrial?id=" + data.obj.TrialDataId, yes: function (index) { var obj = window["layui-layer-iframe" + index].page; - if (!saveQuotaTrial(obj)) { - return; - } - if (isRiskWarningConfirm) { - if (!saveRiskWarningDecisionLog(obj.Data.id, "确认通过")) { + if (obj.IsTF) { + if (obj.Data.Remark && obj.Data.Remark.length > 0) { + main.post("/trade/SaveQuotaTrial", obj.Data, { async: false }).done(function (res) { + if (!res || !res.success) { + main.message(res.msg); + } + }); + layer.close(layerIndex); + confirmFunc(id, "LackOfMoney"); return; } + main.message("必须填写说明内容,才可以录入交易"); + } else { + if (obj.Data.Remark && obj.Data.Remark.length > 0) { + main.post("/trade/SaveQuotaTrial", obj.Data, { async: false }).done(function (res) { + if (!res || !res.success) { + main.message(res.msg); + } + }); + } + layer.close(layerIndex); + confirmFunc(id, "LackOfMoney"); } - layer.close(layerIndex); - confirmFunc(id, additionalProcessingType); }, cancel: function () { - var iframeWindow = window["layui-layer-iframe" + this.index]; - var pageObj = iframeWindow && iframeWindow.page; - if (isRiskWarningConfirm && pageObj && pageObj.Data && pageObj.Data.id) { - saveRiskWarningDecisionLog(pageObj.Data.id, "取消不通过"); - } if (window.parent && window.parent.reloadtrade) { window.parent.reloadtrade(); } @@ -148,10 +128,8 @@ var confirmFunc = function (id, additionalProcessing) { if (data.obj.type === "LackOfMoney") { layerSetting.btn = [page.buttonStr, '取消']; } - else if (isRiskWarningConfirm) { - layerSetting.btn = ["交易特批", '取消']; - } - else if (data.obj.typecode === "FundStatus") { + // 只展示"资金状况"的情况 + if (data.obj.typecode === "FundStatus") { layerSetting.btn = ["确认", '取消']; } @@ -189,14 +167,6 @@ var confirmFunc = function (id, additionalProcessing) { }); }); } - if (data.msg && data.msg !== "操作完成") { - main.alert(data.msg, function () { - if (blClose) { - closetradeWindow(); - } - }); - return; - } if (blClose) { closetradeWindow(); }