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.
 
 
 
 
 
 

164 lines
4.7 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.LR_CodeDemo;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using Learun.Application.Base.SystemModule;
  7. namespace Learun.Application.Web.Areas.LR_CodeDemo.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架
  11. /// Copyright (c) 2013-2018 上海力软信息技术有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2019-06-10 17:21
  14. /// 描 述:工单管理
  15. /// </summary>
  16. public class WorkOrderController : MvcControllerBase
  17. {
  18. private WorkOrderIBLL workOrderIBLL = new WorkOrderBLL();
  19. private CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL();
  20. #region 视图功能
  21. /// <summary>
  22. /// 主页面
  23. /// <summary>
  24. /// <returns></returns>
  25. [HttpGet]
  26. public ActionResult Index()
  27. {
  28. return View();
  29. }
  30. /// <summary>
  31. /// 表单页
  32. /// <summary>
  33. /// <returns></returns>
  34. [HttpGet]
  35. public ActionResult Form()
  36. {
  37. return View();
  38. }
  39. #endregion
  40. #region 获取数据
  41. /// <summary>
  42. /// 获取页面显示列表数据
  43. /// <summary>
  44. /// <param name="queryJson">查询参数</param>
  45. /// <returns></returns>
  46. [HttpGet]
  47. [AjaxOnly]
  48. public ActionResult GetPageList(string pagination, string queryJson)
  49. {
  50. Pagination paginationobj = pagination.ToObject<Pagination>();
  51. var data = workOrderIBLL.GetPageList(paginationobj, queryJson);
  52. var jsonData = new
  53. {
  54. rows = data,
  55. total = paginationobj.total,
  56. page = paginationobj.page,
  57. records = paginationobj.records
  58. };
  59. return Success(jsonData);
  60. }
  61. /// <summary>
  62. /// 获取大屏显示数据
  63. /// <summary>
  64. /// <returns></returns>
  65. [HttpGet]
  66. [AjaxOnly]
  67. public ActionResult GetList()
  68. {
  69. var data = workOrderIBLL.GetList();
  70. return Success(data);
  71. }
  72. /// <summary>
  73. /// 获取打印数据
  74. /// <summary>
  75. /// <returns></returns>
  76. [HttpGet]
  77. [AjaxOnly]
  78. public ActionResult GetPrintItem(string keyValue)
  79. {
  80. var data = workOrderIBLL.GetPrintItem(keyValue);
  81. return Success(data);
  82. }
  83. /// <summary>
  84. /// 获取表单数据
  85. /// <summary>
  86. /// <returns></returns>
  87. [HttpGet]
  88. [AjaxOnly]
  89. public ActionResult GetFormData(string keyValue)
  90. {
  91. var LR_Demo_WorkOrderData = workOrderIBLL.GetLR_Demo_WorkOrderEntity( keyValue );
  92. var jsonData = new {
  93. LR_Demo_WorkOrder = LR_Demo_WorkOrderData,
  94. };
  95. return Success(jsonData);
  96. }
  97. /// <summary>
  98. /// 获取表单数据
  99. /// <summary>
  100. /// <returns></returns>
  101. [HttpGet]
  102. [AjaxOnly]
  103. public ActionResult GetFormDataByProcessId(string processId)
  104. {
  105. var LR_Demo_WorkOrderData = workOrderIBLL.GetEntityByProcessId( processId );
  106. var jsonData = new {
  107. LR_Demo_WorkOrder = LR_Demo_WorkOrderData,
  108. };
  109. return Success(jsonData);
  110. }
  111. /// <summary>
  112. /// 获取左侧树形数据
  113. /// <summary>
  114. /// <returns></returns>
  115. [HttpGet]
  116. [AjaxOnly]
  117. public ActionResult GetTree()
  118. {
  119. var data = workOrderIBLL.GetTree();
  120. return Success(data);
  121. }
  122. #endregion
  123. #region 提交数据
  124. /// <summary>
  125. /// 删除实体数据
  126. /// <param name="keyValue">主键</param>
  127. /// <summary>
  128. /// <returns></returns>
  129. [HttpPost]
  130. [AjaxOnly]
  131. public ActionResult DeleteForm(string keyValue)
  132. {
  133. workOrderIBLL.DeleteEntity(keyValue);
  134. return Success("删除成功!");
  135. }
  136. /// <summary>
  137. /// 保存实体数据(新增、修改)
  138. /// <param name="keyValue">主键</param>
  139. /// <summary>
  140. /// <returns></returns>
  141. [HttpPost]
  142. [ValidateAntiForgeryToken]
  143. [AjaxOnly]
  144. public ActionResult SaveForm(string keyValue, string strEntity)
  145. {
  146. LR_Demo_WorkOrderEntity entity = strEntity.ToObject<LR_Demo_WorkOrderEntity>();
  147. workOrderIBLL.SaveEntity(keyValue,entity);
  148. if (string.IsNullOrEmpty(keyValue))
  149. {
  150. }
  151. return Success("保存成功!");
  152. }
  153. #endregion
  154. }
  155. }