70 lines
2.2 KiB
C#
70 lines
2.2 KiB
C#
using YLErp.Modules.ExchangeTradeModule;
|
|
using YLErp.Modules.SuperviseReportModule.ChangJiangReport.Service;
|
|
using YLErp.Modules.SystemModule;
|
|
|
|
namespace YLErp.Web.Areas.Admin.Controllers
|
|
{
|
|
public class ToolsController : AdminBaseController
|
|
{
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 重新初始化实时风险计算
|
|
/// </summary>
|
|
public JsonResult AjaxResetTradeRiskCalcTaskRunner()
|
|
{
|
|
Modules.TradeRiskCalcModule.TradeRiskCalcTaskRunner.Reset();
|
|
return JsonSuccess();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 重置对冲交易持仓
|
|
/// </summary>
|
|
public JsonResult AjaxResetTradePosition()
|
|
{
|
|
new ExchangeTradePositionService(CurUser).ResetExchangeTradePosition();
|
|
return JsonSuccess();
|
|
}
|
|
|
|
public JsonResult AjaxResetsysUser()
|
|
{
|
|
var functionRightXmlFilePath = Server.MapPath("/App_Data/FunctionRight.xml");
|
|
new SysFunctionService(CurUser).SyncFunctionRight(functionRightXmlFilePath);
|
|
BaseOUDAL.UserBLL.AddDefaultUser();
|
|
FunctionHelper.Initialize();
|
|
return JsonSuccess();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 长江监管报告-场外业务持仓表
|
|
/// </summary>
|
|
public JsonResult AjaxChangeJiangSuperviseReportPosition(ChangeJiangSuperviseReportPositionRequest req)
|
|
{
|
|
if (req == null)
|
|
{
|
|
return JsonError("参数不可为空");
|
|
}
|
|
|
|
if (req.Date == DateTime.MinValue)
|
|
{
|
|
return JsonError("未传入有效的结算日期");
|
|
}
|
|
|
|
var nv = YieldChain.Helpers.UrlHelper.ParseQueryString(PS.Config.ErpElement.Supervise_Position);
|
|
|
|
var changes = new SuperviseReportPositionService(OptUserInfo.SystemUser).SaveReportData(req.Date.Date, nv?["敞口算法"], req.ClearExistings);
|
|
|
|
return JsonSuccessMessage($"执行完成,共更新{changes}条");
|
|
}
|
|
}
|
|
|
|
public class ChangeJiangSuperviseReportPositionRequest
|
|
{
|
|
public DateTime Date { get; set; }
|
|
|
|
public bool ClearExistings { get; set; }
|
|
}
|
|
} |