diff --git a/YLErpDAL/Modules/ClientModule/ClientSaveService.cs b/YLErpDAL/Modules/ClientModule/ClientSaveService.cs
index 468306f9..b56b4083 100644
--- a/YLErpDAL/Modules/ClientModule/ClientSaveService.cs
+++ b/YLErpDAL/Modules/ClientModule/ClientSaveService.cs
@@ -52,7 +52,7 @@ namespace YLErp.Modules.ClientModule
//多选框未选择时未赋值null,TryUpdateModel无法更新,特殊处理
req.ProtocolSignVersion = req.ProtocolSignVersion;
- req.DerivativesInvestmentVarieties = req.DerivativesInvestmentVarieties;
+ req.DerivativesInvestmentVarieties = req.DerivativesInvestmentVarieties ?? "2";
req.TransactionTarget = req.TransactionTarget;
if (req.EvaluateDate != null && req.EvaluateOfValidity != null)
{
@@ -335,7 +335,7 @@ namespace YLErp.Modules.ClientModule
//增加评估日志
AddClientAssessmentLog(dbModel, changeStr, isAddNew);
- SaveClientCustomerManage(dbModel.id,req.CustomerManagerId);
+ SaveClientCustomerManage(dbModel.id, req.CustomerManagerId);
return dbModel;
}
///
@@ -343,9 +343,9 @@ namespace YLErp.Modules.ClientModule
///
///
///
- private void SaveClientCustomerManage(int clientId,string customerManageIds)
+ private void SaveClientCustomerManage(int clientId, string customerManageIds)
{
- var clientManagers = DbContext.client_customer_manage.Where(x=>x.ClientId==clientId);
+ var clientManagers = DbContext.client_customer_manage.Where(x => x.ClientId == clientId);
DbContext.client_customer_manage.RemoveRange(clientManagers);
if (!string.IsNullOrEmpty(customerManageIds))
{
@@ -355,8 +355,8 @@ namespace YLErp.Modules.ClientModule
var CustomerManagerIds = customerManageIds.Split(',').ToList();
CustomerManagerIds.ForEach(a =>
{
- var sysUserId=Convert.ToInt32(a);
- ClientCustomerManage clientCustomer=new ClientCustomerManage();
+ var sysUserId = Convert.ToInt32(a);
+ ClientCustomerManage clientCustomer = new ClientCustomerManage();
clientCustomer.ClientId = clientId;
clientCustomer.SysuserId = sysUserId;
clientCustomer.create_time = DateTime.Now;
@@ -832,7 +832,7 @@ namespace YLErp.Modules.ClientModule
throw new ServiceException($"{field.label} 必须填写");
}
}
- else if (field.name== "TradingInstType"&& (TradingInstTypeEnum)prop.GetValue(req, null) == TradingInstTypeEnum.None)
+ else if (field.name == "TradingInstType" && (TradingInstTypeEnum)prop.GetValue(req, null) == TradingInstTypeEnum.None)
{
throw new ServiceException($"{field.label} 必须填写");
}
@@ -998,12 +998,12 @@ namespace YLErp.Modules.ClientModule
///
///
///
- public void UpdateClientOutNumber(string clientNumber,string outNumer)
+ public void UpdateClientOutNumber(string clientNumber, string outNumer)
{
- var client= DbContext.client.FirstOrDefault(x=>x.Number==clientNumber);
- if (client!=null)
+ var client = DbContext.client.FirstOrDefault(x => x.Number == clientNumber);
+ if (client != null)
{
- client.OutNumber= outNumer;
+ client.OutNumber = outNumer;
DbContext.SaveChanges();
}
}
diff --git a/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs b/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs
index 706a5423..37ef242b 100644
--- a/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs
+++ b/YLErpDAL/Modules/RiskModule/QuotaMonitorService.cs
@@ -4757,8 +4757,6 @@ namespace YLErp.Modules.RiskModule
throw new ArgumentNullException(nameof(tradeObj.TradeDate), "交易日期不能为空");
}
- _logger.Info($"[限额试算] 检查持仓 - positions.Count: {positions?.Count ?? 0}");
-
var fundStatus = CheckFund(tradeList, tradeObj.StockEqvNotional, tradeObj.ClientId, out var fundMsg, out var availableMsg);
//var riskWarningStatus = CheckRiskWarning(tradeList, out var riskWarningMsg);
string riskWarningMsg = string.Empty;
@@ -4771,7 +4769,9 @@ namespace YLErp.Modules.RiskModule
}
string quotaWarningMsg = "", quotaMsg = "";
bool quotaWarningStatus = true, quotaStatus = true;
+
var positions = DbContext.swap_position.Where(x => x.SwapTradeId == tradeId && x.PosiQuantity > 0 && x.IsInitial && !x.Invalid).ToList();
+ _logger.Info($"[限额试算] 检查持仓 - positions.Count: {positions?.Count ?? 0}");
quotaStatus = CheckUnderlyingWhiteList(tradeObj.ClientId, positions, out quotaMsg);
if (quotaStatus)
{