You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
166 lines
3.7 KiB
166 lines
3.7 KiB
4 years ago
|
using learun.iapplication;
|
||
|
using learun.util;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||
|
|
||
|
namespace EC.Web.Areas.LR_TaskScheduling.Controllers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 版 本 EasyCode EC管理后台
|
||
|
/// Copyright (c) 2019-present EC管理有限公司
|
||
|
/// 创建人:tobin
|
||
|
/// 日 期:2019.11.04
|
||
|
/// 描 述:任务计划模板
|
||
|
/// </summary>
|
||
|
[Area("LR_TaskScheduling")]
|
||
|
public class TSSchemeController : MvcControllerBase
|
||
|
{
|
||
|
private TSSchemeIBLL _tSSchemeIBLL;
|
||
|
|
||
|
public TSSchemeController(TSSchemeIBLL tSSchemeIBLL)
|
||
|
{
|
||
|
_tSSchemeIBLL = tSSchemeIBLL;
|
||
|
}
|
||
|
|
||
|
#region 视图功能
|
||
|
|
||
|
/// <summary>
|
||
|
/// 主页面
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
public IActionResult Index()
|
||
|
{
|
||
|
return View();
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 表单页
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
public IActionResult Form()
|
||
|
{
|
||
|
return View();
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 新增明细页
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
public ActionResult AddDetailedForm()
|
||
|
{
|
||
|
return View();
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 查看预置表达式
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
public IActionResult SelectExpressForm()
|
||
|
{
|
||
|
return View();
|
||
|
}
|
||
|
|
||
|
#endregion 视图功能
|
||
|
|
||
|
#region 获取数据
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取列表分页数据
|
||
|
/// </summary>
|
||
|
/// <param name="pagination">分页参数</param>
|
||
|
/// <param name="queryJson">查询参数</param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
[AjaxOnly]
|
||
|
public async Task<IActionResult> GetPageList(string pagination, string queryJson)
|
||
|
{
|
||
|
Pagination paginationobj = pagination.ToObject<Pagination>();
|
||
|
var data = await _tSSchemeIBLL.GetPageList(paginationobj, queryJson);
|
||
|
var jsonData = new
|
||
|
{
|
||
|
rows = data,
|
||
|
paginationobj.total,
|
||
|
paginationobj.page,
|
||
|
paginationobj.records
|
||
|
};
|
||
|
return Success(jsonData);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取表单数据
|
||
|
/// </summary>
|
||
|
/// <param name="keyValue">主键</param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
[AjaxOnly]
|
||
|
public async Task<IActionResult> GetFormData(string keyValue)
|
||
|
{
|
||
|
var schemeInfoEntity = await _tSSchemeIBLL.GetSchemeInfoEntity(keyValue);
|
||
|
return Success(schemeInfoEntity);
|
||
|
}
|
||
|
|
||
|
#endregion 获取数据
|
||
|
|
||
|
#region 提交数据
|
||
|
|
||
|
/// <summary>
|
||
|
/// 删除实体数据
|
||
|
/// </summary>
|
||
|
/// <param name="keyValue">主键</param>
|
||
|
/// <returns></returns>
|
||
|
[HttpPost]
|
||
|
[AjaxOnly]
|
||
|
public async Task<IActionResult> DeleteForm(string keyValue)
|
||
|
{
|
||
|
await _tSSchemeIBLL.DeleteEntity(keyValue);
|
||
|
return SuccessInfo("删除成功!");
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 保存实体数据(新增、修改)
|
||
|
/// </summary>
|
||
|
/// <param name="keyValue">主键</param>
|
||
|
/// <returns></returns>
|
||
|
[HttpPost]
|
||
|
[AjaxOnly]
|
||
|
public async Task<IActionResult> SaveForm(string keyValue, TSSchemeInfoEntity entity)
|
||
|
{
|
||
|
await _tSSchemeIBLL.SaveEntity(keyValue, entity);
|
||
|
return SuccessInfo("保存成功!");
|
||
|
}
|
||
|
|
||
|
#endregion 提交数据
|
||
|
|
||
|
#region 扩展应用
|
||
|
|
||
|
/// <summary>
|
||
|
/// 暂停一个任务
|
||
|
/// </summary>
|
||
|
/// <param name="processId">任务进程主键</param>
|
||
|
/// <returns></returns>
|
||
|
public async Task<IActionResult> PauseJob(string processId)
|
||
|
{
|
||
|
await _tSSchemeIBLL.PauseJob(processId);
|
||
|
return SuccessInfo("操作成功!");
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 启动一个任务
|
||
|
/// </summary>
|
||
|
/// <param name="processId">任务进程主键</param>
|
||
|
/// <returns></returns>
|
||
|
public async Task<IActionResult> ResumeJob(string processId)
|
||
|
{
|
||
|
await _tSSchemeIBLL.EnAbleJob(processId);
|
||
|
return SuccessInfo("操作成功!");
|
||
|
}
|
||
|
|
||
|
#endregion 扩展应用
|
||
|
}
|
||
|
}
|