客户适当性有效期
This commit is contained in:
@@ -20,7 +20,16 @@ namespace YLErp.Modules.DataProviderModule
|
||||
|| db.eod_stock_price.Any(n => n.ValueDate == valueDate)
|
||||
|| db.china_bond_valuation.Any(n => n.valuation_date == valueDate && n.dirty_price_close > 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 校验FR007价格
|
||||
/// </summary>
|
||||
/// <param name="valueDate"></param>
|
||||
/// <returns></returns>
|
||||
public static bool CheckFR007Price(DateTime valueDate)
|
||||
{
|
||||
using var db = DbContextFactory.GetYLDbContext();
|
||||
return db.eod_commodity_future_price.Any(n => n.ValueDate == valueDate && n.UnderlyingCode == "FR007");
|
||||
}
|
||||
/// <summary>
|
||||
/// 检查是否存在收盘价
|
||||
/// </summary>
|
||||
@@ -123,7 +132,7 @@ namespace YLErp.Modules.DataProviderModule
|
||||
|
||||
valueDate = valueDate.Date;
|
||||
using var db = DbContextFactory.GetYLDbContext();
|
||||
var data = db.eod_commodity_future_price.Where(x => x.ValueDate <= valueDate && x.UnderlyingCode == underlyingCode).OrderByDescending(o => o.ValueDate).FirstOrDefault();
|
||||
var data = db.eod_commodity_future_price.Where(x => x.ValueDate == valueDate && x.UnderlyingCode == underlyingCode).OrderByDescending(o => o.ValueDate).FirstOrDefault();
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,10 @@ namespace YLErp.Modules.EodModule.SettlementModule
|
||||
var clienIds = _context.Request.ClientIds;
|
||||
|
||||
IQueryable<string> allQuery = null;
|
||||
|
||||
if (!EodPriceQueryService.CheckFR007Price(_context.SettleDate))
|
||||
{
|
||||
_context.RaiseError(Step, $"{_context.SettleDate:yyyy年MM月dd日}FR007价格未入库");
|
||||
}
|
||||
//判断当日结算价是否已经入库
|
||||
if (!EodPriceQueryService.CheckDbExists(_context.SettleDate))
|
||||
{
|
||||
|
||||
@@ -4097,10 +4097,6 @@ namespace YLErp.Modules.RiskModule
|
||||
throw new ServiceException("未找到客户信息");
|
||||
}
|
||||
var dealDate = DateTime.Parse(clientRiskCheckReq.dealDate);
|
||||
if (client.EvaluateExpireDate< dealDate)
|
||||
{
|
||||
throw new ServiceException("适当性评估已经过期,只有在适当性有效期内才可以新开仓");
|
||||
}
|
||||
using var bondDb = new BondOmsDBContext();
|
||||
var (clientPositions, clientOrderPositions) = GetClientPositionsAndOrders(bondDb, clientRiskCheckReq.orderId);
|
||||
var position = clientPositions
|
||||
@@ -4113,6 +4109,14 @@ namespace YLErp.Modules.RiskModule
|
||||
var ums = GetUnderlyings(umCodes);
|
||||
|
||||
var checkPoisiList = BuildCheckQuotaMoitorModels(clientPositions, ums, dealDate);
|
||||
var underlyingPositions = checkPoisiList.Where(x => x.UnderlyingCode == clientRiskCheckReq.securityId).ToList();
|
||||
var radio = clientRiskCheckReq.side == 0 ? 1 : -1;
|
||||
var qty = underlyingPositions.Sum(s => s.Qty * (s.Side == 0 ? 1 : -1));
|
||||
var posiRadio = qty > 0 ? 1 : -1;
|
||||
if (radio!= posiRadio&& client.EvaluateExpireDate < dealDate)
|
||||
{
|
||||
throw new ServiceException("适当性评估已经过期,只有在适当性有效期内才可以新开仓");
|
||||
}
|
||||
foreach (var settingItem in precheckQuotaSettingList)
|
||||
{
|
||||
var clientRiskCheckItem = CreateClientRiskCheckItem(settingItem);
|
||||
|
||||
@@ -434,7 +434,7 @@ namespace YLErp.Modules.SwapModule
|
||||
position.FloatRate = Convert.ToDecimal(floatRate);
|
||||
positionClone.FloatRate = position.FloatRate;
|
||||
}
|
||||
else if (needPrice)
|
||||
else
|
||||
{
|
||||
throw new Exception($"获取不到{position.FloatRateUnderlyingCode}在{rateDate:yyyy年MM月dd日}的价格");
|
||||
}
|
||||
@@ -641,7 +641,7 @@ namespace YLErp.Modules.SwapModule
|
||||
floatRate = floatRate1;
|
||||
}
|
||||
}
|
||||
else if (needPrice && QdpCalendarHelper.IsHoliday(fr007RateDate))
|
||||
else
|
||||
{
|
||||
throw new Exception($"获取不到{position.FloatRateUnderlyingCode}在{fr007RateDate:yyyy年MM月dd日}的价格");
|
||||
}
|
||||
@@ -714,7 +714,7 @@ namespace YLErp.Modules.SwapModule
|
||||
floatRate = floatRate1;
|
||||
}
|
||||
}
|
||||
else if (needPrice && QdpCalendarHelper.IsHoliday(fr007RateDate))
|
||||
else
|
||||
{
|
||||
throw new Exception($"获取不到{position.FloatRateUnderlyingCode}在{fr007RateDate:yyyy年MM月dd日}的价格");
|
||||
}
|
||||
|
||||
@@ -33,22 +33,11 @@ const editConfig =
|
||||
title: "适当性管理",
|
||||
className: "",
|
||||
fields: [
|
||||
{ name: "ProperClientClass", label: "适当性类型", type: "select", appendBlank: true, dictionaryKey: "适当性客户分类" },
|
||||
{ name: "AppropriatenessDegree", label: "适当性评级", type: "select", dictionaryKey: "适当性评级" },
|
||||
{ name: "EvaluateDate", label: "评估日期", type: "date" },
|
||||
{ name: "IsAssessmentResultChange", label: "评估结果变动", type: "select" },
|
||||
{ name: "EvaluateDate", label: "准入或回访日期", type: "date" },
|
||||
|
||||
{ type: "new-col" },
|
||||
|
||||
{ name: "IsEvaluate", label: "是否评估", required: true, type: "select" },
|
||||
{ name: "RiskServiceDegree", label: "可接受风险服务", required: true, type: "select" },
|
||||
{ name: "EvaluateOfValidity", label: "评估有效期", type: "select" },
|
||||
{ name: "ChangeReasonAndEvaluationResults", label: "变动原因及历史", type: "text" },
|
||||
|
||||
{ type: "new-col" },
|
||||
|
||||
{ name: "AppropriatenessAssessor", label: "适当性评估人", type: "select", appendBlank: true },
|
||||
{ name: "DisbeliefRecord", label: "失信行为记录", type: "text" },
|
||||
{ name: "EvaluateOfValidity", label: "适当性有效期", type: "select" },
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -195,7 +195,7 @@ function FormatColData(colData) {
|
||||
a.optionHide = true;
|
||||
a.frozen = true;
|
||||
break;
|
||||
case 'ClientName':
|
||||
case 'Name':
|
||||
a.optionHide = true;
|
||||
a.frozen = true;
|
||||
a.formatter = clientNameFormat;
|
||||
@@ -312,15 +312,6 @@ function gridComplete() {
|
||||
}
|
||||
function clientNameFormat(c, o, r) {
|
||||
var html = r.Name;
|
||||
if (r.IsTradeCredit && r.IsCreditOn) {
|
||||
html += "<img title='期权费已授信' style='cursor:help;width:18px;' src='/images/duigou.png'/>";
|
||||
}
|
||||
if (!r.HasDocuments) {
|
||||
html += "<img title='未上传任何文件' style='cursor:help;width:18px;' src='/images/light_yellow.png'/>";
|
||||
}
|
||||
if (r.IsExistContactExpired) {
|
||||
html += "<img title='联系人或法人登记信息已过期' style='cursor:help;width:18px;' src='/images/light_red.png'/>";
|
||||
}
|
||||
if (r.AssessmentExpired) {
|
||||
html += '<i class="fa fa-exclamation tip" aria-hidden="true" title="适当性评估已过期" ></i>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user