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.
 
 
 
 
 
 

115 lines
3.7 KiB

  1. using Learun.Application.WorkFlow;
  2. using Learun.Util;
  3. using System.Web.Mvc;
  4. namespace Learun.Application.Web.Areas.LR_WorkFlowModule.Controllers
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创建人:陈彬彬
  10. /// 日 期:2017.04.17
  11. /// 描 述:工作委托
  12. /// </summary>
  13. public class WfDelegateRuleController : MvcControllerBase
  14. {
  15. private WfDelegateRuleIBLL wfDelegateRuleIBLL = new WfDelegateRuleBLL();
  16. #region 视图功能
  17. [HttpGet]
  18. public ActionResult Index()
  19. {
  20. return View();
  21. }
  22. [HttpGet]
  23. public ActionResult Form()
  24. {
  25. return View();
  26. }
  27. #endregion
  28. #region 获取数据
  29. /// <summary>
  30. /// 获取分页数据
  31. /// </summary>
  32. /// <param name="pagination">分页参数</param>
  33. /// <param name="keyword">关键字</param>
  34. /// <returns></returns>
  35. [HttpGet]
  36. [AjaxOnly]
  37. public ActionResult GetPageList(string pagination, string keyword)
  38. {
  39. UserInfo userInfo = LoginUserInfo.Get();
  40. Pagination paginationobj = pagination.ToObject<Pagination>();
  41. var data = wfDelegateRuleIBLL.GetPageList(paginationobj, keyword, userInfo);
  42. var jsonData = new
  43. {
  44. rows = data,
  45. total = paginationobj.total,
  46. page = paginationobj.page,
  47. records = paginationobj.records,
  48. };
  49. return JsonResult(jsonData);
  50. }
  51. /// <summary>
  52. /// 获取关联模板数据
  53. /// </summary>
  54. /// <param name="keyValue">主键</param>
  55. /// <returns></returns>
  56. [HttpGet]
  57. [AjaxOnly]
  58. public ActionResult GetRelationList(string keyValue)
  59. {
  60. var relationList = wfDelegateRuleIBLL.GetRelationList(keyValue);
  61. return JsonResult(relationList);
  62. }
  63. #endregion
  64. #region 提交数据
  65. /// <summary>
  66. /// 保存流程模板
  67. /// </summary>
  68. /// <param name="keyValue">主键</param>
  69. /// <param name="schemeInfo">表单设计模板信息</param>
  70. /// <param name="shcemeAuthorize">模板权限信息</param>
  71. /// <param name="scheme">模板内容</param>
  72. /// <param name="type">类型1.正式2.草稿</param>
  73. /// <returns></returns>
  74. [HttpPost]
  75. [ValidateAntiForgeryToken]
  76. [AjaxOnly]
  77. public ActionResult SaveForm(string keyValue, string strEntity, string strSchemeInfo)
  78. {
  79. WfDelegateRuleEntity entity = strEntity.ToObject<WfDelegateRuleEntity>();
  80. wfDelegateRuleIBLL.SaveEntity(keyValue, entity, strSchemeInfo.Split(','));
  81. return Success("保存成功!");
  82. }
  83. /// <summary>
  84. /// 删除模板数据
  85. /// </summary>
  86. /// <param name="keyValue">主键</param>
  87. /// <returns></returns>
  88. [HttpPost]
  89. [AjaxOnly]
  90. public ActionResult DeleteForm(string keyValue)
  91. {
  92. wfDelegateRuleIBLL.DeleteEntity(keyValue);
  93. return Success("删除成功!");
  94. }
  95. /// <summary>
  96. /// 启用/停用表单
  97. /// </summary>
  98. /// <param name="keyValue">主键</param>
  99. /// <param name="state">状态1启用0禁用</param>
  100. /// <returns></returns>
  101. [HttpPost]
  102. [AjaxOnly]
  103. public ActionResult UpDateSate(string keyValue, int state)
  104. {
  105. wfDelegateRuleIBLL.UpdateState(keyValue, state);
  106. return Success((state == 1 ? "启用" : "禁用") + "成功!");
  107. }
  108. #endregion
  109. }
  110. }