102 lines
3.7 KiB
C#
102 lines
3.7 KiB
C#
using YLErp.Modules.ApiModule;
|
|
using YLErp.Modules.DataCacheModule;
|
|
using YLErp.Modules.DataProviderModule;
|
|
using YLErp.Modules.EodModule;
|
|
using YLErp.QdpModule;
|
|
|
|
namespace YLErp.Web.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 系统信息控制器
|
|
/// </summary>
|
|
[MyAuthorizeIgnore]
|
|
public class SysInfoController : BaseController
|
|
{
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Test()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Debug()
|
|
{
|
|
var valueDate = valuedateBLL.GetNonHolidayDefore(valuedateBLL.ValueDate.AddDays(-1));
|
|
var startDate = valuedateBLL.SystemDate.AccruedTotalPnlStartDate ?? DateTime.MinValue;
|
|
var list = new AccruedTotalPnlService<eod_trade_position_hedgevol>(OptUserInfo.SystemUser).GetFinishedTradePnls(startDate, valueDate);
|
|
return View(list);
|
|
}
|
|
|
|
public ActionResult DataCache()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public JsonResult AjaxGetDataCache(string name)
|
|
{
|
|
switch (name)
|
|
{
|
|
case nameof(underlying_manager):
|
|
return JsonSuccessData(DataCacheProvider.GetUnderlyingDataSource().AsQueryable().ToArray());
|
|
case nameof(AssetUnit):
|
|
return JsonSuccessData(DataCacheProvider.GetAssetUnitDataSource().AsQueryable().ToArray());
|
|
case nameof(Variety):
|
|
return JsonSuccessData(DataCacheProvider.GetVarietyDataSource().AsQueryable().ToArray());
|
|
case nameof(ExchangeListOption):
|
|
return JsonSuccessData(DataCacheProvider.GetExchangeListOptionDataSource().AsQueryable().ToArray());
|
|
case nameof(CorrelationTable):
|
|
return JsonSuccessData(DataCacheProvider.GetCorrelationDataSource().AsQueryable().ToArray());
|
|
case nameof(StockCommissionConfig):
|
|
return JsonSuccessData(DataCacheProvider.GetStockCommissionDataSource().AsQueryable().ToArray());
|
|
case nameof(ExchangeAccount):
|
|
return JsonSuccessData(DataCacheProvider.GetExchangeAccountDataSource().AsQueryable().ToArray());
|
|
case nameof(Client):
|
|
return JsonSuccessData(DataCacheProvider.GetClientDataSource().AsQueryable().ToArray());
|
|
case nameof(Market):
|
|
return JsonSuccessData(DataCacheProvider.GetMarketDataSource().AsQueryable().ToArray());
|
|
}
|
|
return JsonSuccessData(new object[0]);
|
|
}
|
|
|
|
public ActionResult AjaxGetDataCacheTables()
|
|
{
|
|
var tables = DataCacheManager.GetSinkTables();
|
|
return JsonSuccessData(tables);
|
|
}
|
|
|
|
public ActionResult AjaxGetDataCacheData(string tableName)
|
|
{
|
|
var json = DataCacheManager.GetSinkData(tableName);
|
|
return JsonSuccessData(json);
|
|
}
|
|
|
|
//标的自动选择
|
|
public ActionResult UnderlyingAuto()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult AjaxTradePnlStaticsData()
|
|
{
|
|
if (AppHelper.RunTradeRiskCalcV2)
|
|
{
|
|
var valueDate = QdpCalendarHelper.GetNonHoliday(DateTime.Today);
|
|
var result = TradePnlStaticsDataProvider.Default.GetDatas(valueDate);
|
|
return Json(new { date = valueDate, data = result });
|
|
}
|
|
else
|
|
{
|
|
var json = TapConsoleApiHelper.GetTradePnlStaticsData();
|
|
return Content(json, "application/json");
|
|
}
|
|
}
|
|
|
|
public ActionResult Error()
|
|
{
|
|
return View();
|
|
}
|
|
}
|
|
} |